Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Unified Diff: tests/PictureTest.cpp

Issue 495793002: Our SkPicture::Analysis visitors should recurse into nested pictures. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkRecords.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PictureTest.cpp
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 6a93a9dd1bd1ab0415b74119aad0f3b1f3c16cdc..cb29b37dc7533d1d7d7028b53daa7447da4be3aa 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
}
« no previous file with comments | « src/core/SkRecords.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698