diff options
author | mtklein <mtklein@google.com> | 2016-04-27 09:29:34 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-27 09:29:34 -0700 |
commit | 569b02151f399628b0c0c0ca825dfe7b6e2795e1 (patch) | |
tree | 8c10668cf5feee18fbe7fa3e691449753fe875f0 /tests/FlattenDrawableTest.cpp | |
parent | d636950e8ecba89c0021ce4e76037c67aa6ee2cd (diff) |
Revert of Enable flattening of SkRecordedDrawable (patchset #8 id:140001 of https://codereview.chromium.org/1913843002/ )
Reason for revert:
Release mode bots appear to be crashing while loading .skp files in nanobench.
Original issue's description:
> Enable flattening of SkRecordedDrawable
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1913843002
>
> Committed: https://skia.googlesource.com/skia/+/d636950e8ecba89c0021ce4e76037c67aa6ee2cd
TBR=djsollen@google.com,reed@google.com,msarett@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review-Url: https://codereview.chromium.org/1923393002
Diffstat (limited to 'tests/FlattenDrawableTest.cpp')
-rw-r--r-- | tests/FlattenDrawableTest.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/tests/FlattenDrawableTest.cpp b/tests/FlattenDrawableTest.cpp index 2132729330..c7fff12326 100644 --- a/tests/FlattenDrawableTest.cpp +++ b/tests/FlattenDrawableTest.cpp @@ -246,42 +246,3 @@ DEF_TEST(FlattenDrawable, r) { REPORTER_ASSERT(r, 3 == integer->c()); REPORTER_ASSERT(r, 4 == integer->d()); } - -DEF_TEST(FlattenRecordedDrawable, r) { - // Record a set of canvas draw commands - SkPictureRecorder recorder; - SkCanvas* canvas = recorder.beginRecording(1000.0f, 1000.0f); - canvas->drawPoint(42.0f, 17.0f, SK_ColorGREEN); - SkPaint paint; - paint.setColor(SK_ColorRED); - canvas->drawPaint(paint); - SkPaint textPaint; - textPaint.setColor(SK_ColorBLUE); - canvas->drawText("TEXT", 4, 467.0f, 100.0f, textPaint); - - // Draw some drawables as well - SkAutoTUnref<SkDrawable> drawable(new IntDrawable(1, 2, 3, 4)); - SkAutoTUnref<RootDrawable> root(new RootDrawable(5, 6, 7, 8, paint, 9, 10, 11, 12, drawable)); - canvas->drawDrawable(root, 747.0f, 242.0f); - SkAutoTUnref<PaintDrawable> paintDrawable(new PaintDrawable(paint)); - canvas->drawDrawable(paintDrawable, 500.0, 500.0f); - SkAutoTUnref<CompoundDrawable> comDrawable(new CompoundDrawable(13, 14, 15, 16, textPaint)); - canvas->drawDrawable(comDrawable, 10.0f, 10.0f); - - // Serialize the recorded drawable - sk_sp<SkDrawable> recordedDrawable = recorder.finishRecordingAsDrawable(); - SkWriteBuffer writeBuffer; - writeBuffer.writeFlattenable(recordedDrawable.get()); - - // Copy the contents of the write buffer into a read buffer - sk_sp<SkData> data = SkData::MakeUninitialized(writeBuffer.bytesWritten()); - writeBuffer.writeToMemory(data->writable_data()); - SkReadBuffer readBuffer(data->data(), data->size()); - register_test_drawables(readBuffer); - - // Deserialize and verify the drawable - SkAutoTUnref<SkDrawable> out((SkDrawable*) - readBuffer.readFlattenable(SkFlattenable::kSkDrawable_Type)); - REPORTER_ASSERT(r, out); - REPORTER_ASSERT(r, !strcmp("SkRecordedDrawable", out->getTypeName())); -} |