From fad98562d8f9db63839a8d902a301b174320f27f Mon Sep 17 00:00:00 2001 From: brianosman Date: Wed, 4 May 2016 11:06:28 -0700 Subject: Prototype code that turns any/every flattenable into JSON This makes inspecting things in SkDebugger far more useful - any filter or other complex object on the paint is ultimately visible. You still have to do some guess work to figure out what the fields actually mean, but you can at least cross-reference with the code in flatten(). Screenshots: Before: https://screenshot.googleplex.com/a6JM5HBBe6G.png After : https://screenshot.googleplex.com/XQfr4YJ6mnH.png Changes to public API are just removals and changes to make some functions virtual. TBR=reed@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1920423002 Review-Url: https://codereview.chromium.org/1920423002 --- tests/FlattenDrawableTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/FlattenDrawableTest.cpp') diff --git a/tests/FlattenDrawableTest.cpp b/tests/FlattenDrawableTest.cpp index 2132729330..e70404b639 100644 --- a/tests/FlattenDrawableTest.cpp +++ b/tests/FlattenDrawableTest.cpp @@ -210,7 +210,7 @@ DEF_TEST(FlattenDrawable, r) { SkPaint paint; paint.setColor(SK_ColorBLUE); SkAutoTUnref root(new RootDrawable(5, 6, 7, 8, paint, 9, 10, 11, 12, drawable)); - SkWriteBuffer writeBuffer; + SkBinaryWriteBuffer writeBuffer; writeBuffer.writeFlattenable(root); // Copy the contents of the write buffer into a read buffer @@ -270,7 +270,7 @@ DEF_TEST(FlattenRecordedDrawable, r) { // Serialize the recorded drawable sk_sp recordedDrawable = recorder.finishRecordingAsDrawable(); - SkWriteBuffer writeBuffer; + SkBinaryWriteBuffer writeBuffer; writeBuffer.writeFlattenable(recordedDrawable.get()); // Copy the contents of the write buffer into a read buffer -- cgit v1.2.3