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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/core/SkRecorder.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBBoxHierarchy.h" 8 #include "SkBBoxHierarchy.h"
9 #include "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 1304
1305 // The picture shares the immutable pixels but copies the mutable ones. 1305 // The picture shares the immutable pixels but copies the mutable ones.
1306 REPORTER_ASSERT(r, mut.pixelRef()->unique()); 1306 REPORTER_ASSERT(r, mut.pixelRef()->unique());
1307 REPORTER_ASSERT(r, !immut.pixelRef()->unique()); 1307 REPORTER_ASSERT(r, !immut.pixelRef()->unique());
1308 1308
1309 // When the picture goes away, it's just our bitmaps holding the refs. 1309 // When the picture goes away, it's just our bitmaps holding the refs.
1310 pic.reset(NULL); 1310 pic.reset(NULL);
1311 REPORTER_ASSERT(r, mut.pixelRef()->unique()); 1311 REPORTER_ASSERT(r, mut.pixelRef()->unique());
1312 REPORTER_ASSERT(r, immut.pixelRef()->unique()); 1312 REPORTER_ASSERT(r, immut.pixelRef()->unique());
1313 } 1313 }
1314
1315 // getRecordingCanvas() should return a SkCanvas when recording, null when not r ecording.
1316 DEF_TEST(Picture_getRecordingCanvas, r) {
1317 SkPictureRecorder rec;
1318 REPORTER_ASSERT(r, !rec.getRecordingCanvas());
1319 for (int i = 0; i < 3; i++) {
1320 rec.beginRecording(100, 100);
1321 REPORTER_ASSERT(r, rec.getRecordingCanvas());
1322 rec.endRecording()->unref();
1323 REPORTER_ASSERT(r, !rec.getRecordingCanvas());
1324 }
1325 }
OLDNEW
« 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