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

Side by Side Diff: tests/DeferredCanvasTest.cpp

Issue 772533004: Change clear() to respect the clip (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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
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 #if 0
mtklein 2014/12/02 15:27:37 Can you swap this to #ifdef SK_CLEAR_IGNORES_CLIP
reed1 2014/12/02 16:21:15 Shouldn't I just remove this?
287 // Verify that a clear with clipping triggers a fresh frame 288 // Verify that a clear with clipping triggers a fresh frame
288 // (clear is not affected by clipping) 289 // (clear is not affected by clipping)
289 canvas->save(); 290 canvas->save();
290 canvas->clipRect(partialRect, SkRegion::kIntersect_Op, false); 291 canvas->clipRect(partialRect, SkRegion::kIntersect_Op, false);
291 canvas->clear(0x00000000); 292 canvas->clear(0x00000000);
292 canvas->restore(); 293 canvas->restore();
293 REPORTER_ASSERT(reporter, canvas->isFreshFrame()); 294 REPORTER_ASSERT(reporter, canvas->isFreshFrame());
295 #endif
294 296
295 // Verify that full frame rects with different forms of opaque paint 297 // Verify that full frame rects with different forms of opaque paint
296 // trigger frames to be marked as fresh 298 // trigger frames to be marked as fresh
297 { 299 {
298 SkPaint paint; 300 SkPaint paint;
299 paint.setStyle(SkPaint::kFill_Style); 301 paint.setStyle(SkPaint::kFill_Style);
300 paint.setAlpha(255); 302 paint.setAlpha(255);
301 canvas->drawRect(fullRect, paint); 303 canvas->drawRect(fullRect, paint);
302 REPORTER_ASSERT(reporter, canvas->isFreshFrame()); 304 REPORTER_ASSERT(reporter, canvas->isFreshFrame());
303 } 305 }
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 TestDeferredCanvasSurface(reporter, NULL); 909 TestDeferredCanvasSurface(reporter, NULL);
908 TestDeferredCanvasSetSurface(reporter, NULL); 910 TestDeferredCanvasSetSurface(reporter, NULL);
909 } 911 }
910 912
911 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) { 913 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) {
912 if (factory != NULL) { 914 if (factory != NULL) {
913 TestDeferredCanvasSurface(reporter, factory); 915 TestDeferredCanvasSurface(reporter, factory);
914 TestDeferredCanvasSetSurface(reporter, factory); 916 TestDeferredCanvasSetSurface(reporter, factory);
915 } 917 }
916 } 918 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698