aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-08-21 09:11:37 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-21 09:11:38 -0700
commit53fecfb15d254397ab03032b888daa9d15c487b6 (patch)
tree369d07782c33d2a1547b155f46c6d4beb1a2686e /tests
parentc2d04e1bb8e8a0973e74d17811c6a9b586719766 (diff)
Our SkPicture::Analysis visitors should recurse into nested pictures.
BUG=skia: R=tomhudson@google.com, mtklein@google.com, reed@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/495793002
Diffstat (limited to 'tests')
-rw-r--r--tests/PictureTest.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 6a93a9dd1b..cb29b37dc7 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -843,6 +843,17 @@ static void test_gpu_veto(skiatest::Reporter* reporter,
picture.reset(recorder.endRecording());
// ... but only when applied to drawPoint() calls
REPORTER_ASSERT(reporter, !picture->suitableForGpuRasterization(NULL));
+
+ // Nest the previous picture inside a new one.
+ // This doesn't work in the old backend.
+ if (useNewPath) {
+ canvas = GENERATE_CANVAS(recorder, useNewPath);
+ {
+ canvas->drawPicture(picture.get());
+ }
+ picture.reset(recorder.endRecording());
+ REPORTER_ASSERT(reporter, !picture->suitableForGpuRasterization(NULL));
+ }
}
#undef GENERATE_CANVAS
@@ -1043,6 +1054,17 @@ static void test_has_text(skiatest::Reporter* reporter, bool useNewPath) {
}
picture.reset(recorder.endRecording());
REPORTER_ASSERT(reporter, picture->hasText());
+
+ // Nest the previous picture inside a new one.
+ // This doesn't work in the old backend.
+ if (useNewPath) {
+ canvas = BEGIN_RECORDING;
+ {
+ canvas->drawPicture(picture.get());
+ }
+ picture.reset(recorder.endRecording());
+ REPORTER_ASSERT(reporter, picture->hasText());
+ }
#undef BEGIN_RECORDING
}