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

Unified Diff: tests/PictureTest.cpp

Issue 1067893002: SkCanvas::resetForNextPicture() (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Return null when we're not recording. Should fix printing failures. Created 5 years, 8 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/SkRecorder.cpp ('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 14e703fce4129912a4b175e1432bebd879c1b5da..153695b773d34c0d75778a5eeb0cf05dfa7bc9d4 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -1311,3 +1311,15 @@ DEF_TEST(Picture_BitmapLeak, r) {
REPORTER_ASSERT(r, mut.pixelRef()->unique());
REPORTER_ASSERT(r, immut.pixelRef()->unique());
}
+
+// getRecordingCanvas() should return a SkCanvas when recording, null when not recording.
+DEF_TEST(Picture_getRecordingCanvas, r) {
+ SkPictureRecorder rec;
+ REPORTER_ASSERT(r, !rec.getRecordingCanvas());
+ for (int i = 0; i < 3; i++) {
+ rec.beginRecording(100, 100);
+ REPORTER_ASSERT(r, rec.getRecordingCanvas());
+ rec.endRecording()->unref();
+ REPORTER_ASSERT(r, !rec.getRecordingCanvas());
+ }
+}
« no previous file with comments | « src/core/SkRecorder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698