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

Unified Diff: gm/circularclips.cpp

Issue 1110173002: Do circular clipping in normalized space (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix comments Created 5 years, 8 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 | « no previous file | src/gpu/effects/GrOvalEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/circularclips.cpp
diff --git a/gm/circularclips.cpp b/gm/circularclips.cpp
index 4a98de4efa7bba791bd6e4ab691ee5db25cdc4cc..15f583f67de2fc92e709828b96c80f10e42d6fab 100644
--- a/gm/circularclips.cpp
+++ b/gm/circularclips.cpp
@@ -49,6 +49,20 @@ protected:
SkPaint fillPaint;
+ // Giant background circular clips (AA, non-inverted, replace/isect)
+ fillPaint.setColor(0x80808080);
+ canvas->save();
+ canvas->scale(10, 10);
+ canvas->translate(-((fX1 + fX2)/2 - fR), -(fY - 2*fR/3));
+ canvas->clipPath(fCircle1, SkRegion::kReplace_Op, true);
+ canvas->clipPath(fCircle2, SkRegion::kIntersect_Op, true);
+
+ canvas->drawRect(rect, fillPaint);
+
+ canvas->restore();
+
+ fillPaint.setColor(0xFF000000);
+
for (size_t i = 0; i < 4; i++) {
fCircle1.toggleInverseFillType();
if (i % 2 == 0) {
« no previous file with comments | « no previous file | src/gpu/effects/GrOvalEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698