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

Side by Side Diff: tests/DeferredCanvasTest.cpp

Issue 778563002: Revert "Change clear() to respect the clip" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/utils/debugger/SkDebugCanvas.cpp ('k') | tests/RecordDrawTest.cpp » ('j') | 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 "../src/image/SkImagePriv.h" 8 #include "../src/image/SkImagePriv.h"
9 #include "../src/image/SkSurface_Base.h" 9 #include "../src/image/SkSurface_Base.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 canvas->clear(0x00000000); 277 canvas->clear(0x00000000);
278 canvas->restore(); 278 canvas->restore();
279 REPORTER_ASSERT(reporter, canvas->isFreshFrame()); 279 REPORTER_ASSERT(reporter, canvas->isFreshFrame());
280 280
281 // Verify that clear within a layer does NOT trigger a fresh frame 281 // Verify that clear within a layer does NOT trigger a fresh frame
282 canvas->saveLayer(NULL, NULL); 282 canvas->saveLayer(NULL, NULL);
283 canvas->clear(0x00000000); 283 canvas->clear(0x00000000);
284 canvas->restore(); 284 canvas->restore();
285 REPORTER_ASSERT(reporter, !canvas->isFreshFrame()); 285 REPORTER_ASSERT(reporter, !canvas->isFreshFrame());
286 286
287 // Verify that a clear with clipping triggers a fresh frame
288 // (clear is not affected by clipping)
289 canvas->save();
290 canvas->clipRect(partialRect, SkRegion::kIntersect_Op, false);
291 canvas->clear(0x00000000);
292 canvas->restore();
293 REPORTER_ASSERT(reporter, canvas->isFreshFrame());
294
287 // Verify that full frame rects with different forms of opaque paint 295 // Verify that full frame rects with different forms of opaque paint
288 // trigger frames to be marked as fresh 296 // trigger frames to be marked as fresh
289 { 297 {
290 SkPaint paint; 298 SkPaint paint;
291 paint.setStyle(SkPaint::kFill_Style); 299 paint.setStyle(SkPaint::kFill_Style);
292 paint.setAlpha(255); 300 paint.setAlpha(255);
293 canvas->drawRect(fullRect, paint); 301 canvas->drawRect(fullRect, paint);
294 REPORTER_ASSERT(reporter, canvas->isFreshFrame()); 302 REPORTER_ASSERT(reporter, canvas->isFreshFrame());
295 } 303 }
296 { 304 {
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 TestDeferredCanvasSurface(reporter, NULL); 907 TestDeferredCanvasSurface(reporter, NULL);
900 TestDeferredCanvasSetSurface(reporter, NULL); 908 TestDeferredCanvasSetSurface(reporter, NULL);
901 } 909 }
902 910
903 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) { 911 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) {
904 if (factory != NULL) { 912 if (factory != NULL) {
905 TestDeferredCanvasSurface(reporter, factory); 913 TestDeferredCanvasSurface(reporter, factory);
906 TestDeferredCanvasSetSurface(reporter, factory); 914 TestDeferredCanvasSetSurface(reporter, factory);
907 } 915 }
908 } 916 }
OLDNEW
« no previous file with comments | « src/utils/debugger/SkDebugCanvas.cpp ('k') | tests/RecordDrawTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698