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

Unified Diff: tests/CanvasTest.cpp

Issue 735233003: SkCanvas::clear() should call down to devices even when the clip is empty. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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/SkCanvas.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/CanvasTest.cpp
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index 5437d5b2da96a0463041574b8772c664468a275c..58be9dadb2cfa1f8f5bf8cbf992dd05d39656d79 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -795,3 +795,17 @@ DEF_TEST(Canvas, reporter) {
test_newraster(reporter);
}
+
+// Make sure SkCanvas passes clear() calls down to its devices even when they're clipped out.
+DEF_TEST(Canvas_clear, reporter) {
+ SkBitmap bm;
+ bm.allocN32Pixels(1,1);
+
+ SkCanvas canvas(bm);
+ canvas.clear(SK_ColorRED);
+ REPORTER_ASSERT(reporter, SK_ColorRED == bm.getColor(0,0));
+
+ canvas.clipRect(SkRect::MakeEmpty());
+ canvas.clear(SK_ColorGREEN);
+ REPORTER_ASSERT(reporter, SK_ColorGREEN == bm.getColor(0,0));
+}
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698