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

Unified Diff: tests/QuickRejectTest.cpp

Issue 983243003: optimization/fix: dirty the clip-bounds when we mod the clip in savelayer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix ws nit Created 5 years, 9 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/SkCanvas.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/QuickRejectTest.cpp
diff --git a/tests/QuickRejectTest.cpp b/tests/QuickRejectTest.cpp
index cefde1235452442507604a7c1a9e0cc60ed7451d..447d81615b624cd29a07933fc5fb9ec3a6e6e0e4 100644
--- a/tests/QuickRejectTest.cpp
+++ b/tests/QuickRejectTest.cpp
@@ -87,6 +87,23 @@ static void test_drawBitmap(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, 0xFFFFFFFF == *dst.getAddr32(5, 5));
}
+static void test_layers(skiatest::Reporter* reporter) {
+ SkCanvas canvas(100, 100);
+
+ SkRect r = SkRect::MakeWH(10, 10);
+ REPORTER_ASSERT(reporter, false == canvas.quickReject(r));
+
+ r.offset(300, 300);
+ REPORTER_ASSERT(reporter, true == canvas.quickReject(r));
+
+ // Test that saveLayer updates quickReject
+ SkRect bounds = SkRect::MakeLTRB(50, 50, 70, 70);
+ canvas.saveLayer(&bounds, NULL);
+ REPORTER_ASSERT(reporter, true == canvas.quickReject(SkRect::MakeWH(10, 10)));
+ REPORTER_ASSERT(reporter, false == canvas.quickReject(SkRect::MakeWH(60, 60)));
+}
+
DEF_TEST(QuickReject, reporter) {
test_drawBitmap(reporter);
+ test_layers(reporter);
}
« 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