diff options
author | Mike Reed <reed@google.com> | 2018-01-26 13:26:38 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-27 04:02:55 +0000 |
commit | 8005bff7e631a269f0dfaae93ff9963dc0e5ff39 (patch) | |
tree | 7bb38b497f219b8890e2a574e208777861e919be /tests/PictureTest.cpp | |
parent | 5bcef359b2d223a7c67e286850ecfd5c19d8b6c7 (diff) |
hide picture virtuals (no public callers)
This prepares the way for a clean impl of a "placeholder" picture that never unrolls
Bug: skia:
Change-Id: I3b5785c5c94432b54e9a7dc280b2a6e716592473
Reviewed-on: https://skia-review.googlesource.com/100260
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'tests/PictureTest.cpp')
-rw-r--r-- | tests/PictureTest.cpp | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp index 714338f9d1..4eeec35497 100644 --- a/tests/PictureTest.cpp +++ b/tests/PictureTest.cpp @@ -19,7 +19,7 @@ #include "SkMD5.h" #include "SkMiniRecorder.h" #include "SkPaint.h" -#include "SkPicture.h" +#include "SkPicturePriv.h" #include "SkPictureRecorder.h" #include "SkPixelRef.h" #include "SkRectPriv.h" @@ -446,7 +446,7 @@ static void test_cull_rect_reset(skiatest::Reporter* reporter) { canvas->drawRect(bounds, paint); canvas->drawRect(bounds, paint); sk_sp<SkPicture> p(recorder.finishRecordingAsPictureWithCull(bounds)); - const SkBigPicture* picture = p->asSkBigPicture(); + const SkBigPicture* picture = SkPicturePriv::AsBigPicture(p.get()); REPORTER_ASSERT(reporter, picture); SkRect finalCullRect = picture->cullRect(); @@ -813,24 +813,3 @@ DEF_TEST(Picture_UpdatedCull_2, r) { REPORTER_ASSERT(r, pic->cullRect() == SkRectPriv::MakeLargest()); } -DEF_TEST(Picture_RecordsFlush, r) { - SkPictureRecorder recorder; - - auto canvas = recorder.beginRecording(SkRect::MakeWH(100,100)); - for (int i = 0; i < 10; i++) { - canvas->clear(0); - for (int j = 0; j < 10; j++) { - canvas->drawRect(SkRect::MakeXYWH(i*10,j*10,10,10), SkPaint()); - } - canvas->flush(); - } - - // Did we record the flushes? - auto pic = recorder.finishRecordingAsPicture(); - REPORTER_ASSERT(r, pic->approximateOpCount() == 120); // 10 clears, 100 draws, 10 flushes - - // Do we serialize and deserialize flushes? - auto skp = pic->serialize(); - auto back = SkPicture::MakeFromData(skp->data(), skp->size()); - REPORTER_ASSERT(r, back->approximateOpCount() == pic->approximateOpCount()); -} |