Enable flattening/unflattening with custom unflatten procs
authormsarett <msarett@google.com>
Fri, 22 Apr 2016 19:43:07 +0000 (12:43 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 22 Apr 2016 19:43:07 +0000 (12:43 -0700)
commita3b3b238f507a6ec7f43febc6bf0bb17e04e770f
tree4a699b7a262309f9695db86c2e565109309aeb27
parent4ff7c7423661db10ebaabda782fc8329e7a5f7ee
Enable flattening/unflattening with custom unflatten procs

Now flattenables are serialized using a string name, so that
flattenables do not necessarily need to be registered before
serialization.  They just need to override getTypeName().

Allows custom unflatten procs to be set on the SkReadBuffer.
This is optional if the flattenable is registered, but otherwise
must be called.

This was split off from:
https://codereview.chromium.org/1837913003/

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1858323002

Review URL: https://codereview.chromium.org/1858323002
include/core/SkFlattenable.h
include/core/SkWriteBuffer.h
src/core/SkFlattenableSerialization.cpp
src/core/SkReadBuffer.cpp
src/core/SkReadBuffer.h
src/core/SkValidatingReadBuffer.cpp
src/core/SkValidatingReadBuffer.h
src/core/SkWriteBuffer.cpp
tests/BitmapHeapTest.cpp
tests/FlattenableCustomFactory.cpp [new file with mode: 0644]
tests/SerializationTest.cpp