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

Unified Diff: tests/RecordReplaceDrawTest.cpp

Issue 2106843004: Experiment: add flag for finish-recording to return null (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address comments from #21 Created 4 years, 5 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
« include/core/SkPictureRecorder.h ('K') | « tests/PictureTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/RecordReplaceDrawTest.cpp
diff --git a/tests/RecordReplaceDrawTest.cpp b/tests/RecordReplaceDrawTest.cpp
index 0dd804ec9d024e33c8f86a6d90b22c6e25e5951b..388bee8d7b5dd1efffbe0cefee9aaa1470d27f97 100644
--- a/tests/RecordReplaceDrawTest.cpp
+++ b/tests/RecordReplaceDrawTest.cpp
@@ -78,6 +78,11 @@ DEF_TEST(RecordReplaceDraw_Unbalanced, r) {
canvas->save();
canvas->scale(2, 2);
pic = recorder.finishRecordingAsPicture();
+
+ // we may have optimized everything away. If so, just return
+ if (pic->approximateOpCount() == 0) {
+ return;
+ }
}
SkRecord rerecord;
« include/core/SkPictureRecorder.h ('K') | « tests/PictureTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698