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

Unified Diff: tests/PictureTest.cpp

Issue 14819008: Fix SkPicture path bound optimization to handle inverse filled paths. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 7 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/SkPictureRecord.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PictureTest.cpp
===================================================================
--- tests/PictureTest.cpp (revision 9020)
+++ tests/PictureTest.cpp (working copy)
@@ -449,6 +449,26 @@
}
}
+static void test_inverse_fill_clip_opt(skiatest::Reporter* reporter) {
+ // Regression test for crbug.com/229011
+ SkPicture picture;
+ SkCanvas* canvas = picture.beginRecording(10, 10,
+ SkPicture::kUsePathBoundsForClip_RecordingFlag);
+ SkRect rect = SkRect::MakeXYWH(SkIntToScalar(4), SkIntToScalar(4),
+ SkIntToScalar(2), SkIntToScalar(2));
+ SkPath path;
+ path.addRect(rect);
+ path.setFillType(SkPath::kInverseEvenOdd_FillType);
+ canvas->clipPath(path);
+ SkIRect clipBounds;
+ bool nonEmpty = canvas->getClipDeviceBounds(&clipBounds);
+ REPORTER_ASSERT(reporter, true == nonEmpty);
+ REPORTER_ASSERT(reporter, 0 == clipBounds.fLeft);
+ REPORTER_ASSERT(reporter, 0 == clipBounds.fTop);
+ REPORTER_ASSERT(reporter, 10 == clipBounds.fBottom);
+ REPORTER_ASSERT(reporter, 10 == clipBounds.fRight);
+}
+
static void TestPicture(skiatest::Reporter* reporter) {
#ifdef SK_DEBUG
test_deleting_empty_playback();
@@ -460,6 +480,7 @@
test_gatherpixelrefs(reporter);
test_bitmap_with_encoded_data(reporter);
test_clone_empty(reporter);
+ test_inverse_fill_clip_opt(reporter);
}
#include "TestClassDef.h"
« no previous file with comments | « src/core/SkPictureRecord.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698