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

Unified Diff: gm/simpleaaclip.cpp

Issue 2355483002: abstract name of clipping ops, to transtion to a more restricted set (Closed)
Patch Set: no need for ifdef for globals Created 4 years, 3 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 | « gm/samplerstress.cpp ('k') | gm/skbug1719.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/simpleaaclip.cpp
diff --git a/gm/simpleaaclip.cpp b/gm/simpleaaclip.cpp
index b5aa3ae2a31343649400420a4ec2ce0d1443ba81..87dc6877ef5a9cfe4269f97507f6f712842a51e6 100644
--- a/gm/simpleaaclip.cpp
+++ b/gm/simpleaaclip.cpp
@@ -67,12 +67,12 @@ protected:
INHERITED::setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
- void buildRgn(SkAAClip* clip, SkRegion::Op op) {
+ void buildRgn(SkAAClip* clip, SkCanvas::ClipOp op) {
clip->setPath(fBasePath, nullptr, true);
SkAAClip clip2;
clip2.setPath(fRectPath, nullptr, true);
- clip->op(clip2, op);
+ clip->op(clip2, (SkRegion::Op)op);
}
void drawOrig(SkCanvas* canvas) {
@@ -85,7 +85,7 @@ protected:
canvas->drawRect(fRect, paint);
}
- void drawRgnOped(SkCanvas* canvas, SkRegion::Op op, SkColor color) {
+ void drawRgnOped(SkCanvas* canvas, SkCanvas::ClipOp op, SkColor color) {
SkAAClip clip;
@@ -97,7 +97,7 @@ protected:
paint_rgn(canvas, clip, paint);
}
- void drawPathsOped(SkCanvas* canvas, SkRegion::Op op, SkColor color) {
+ void drawPathsOped(SkCanvas* canvas, SkCanvas::ClipOp op, SkColor color) {
this->drawOrig(canvas);
@@ -106,11 +106,11 @@ protected:
// create the clip mask with the supplied boolean op
if (kPath_GeomType == fGeomType) {
// path-based case
- canvas->clipPath(fBasePath, SkRegion::kReplace_Op, true);
+ canvas->clipPath(fBasePath, SkCanvas::kReplace_Op, true);
canvas->clipPath(fRectPath, op, true);
} else {
// rect-based case
- canvas->clipRect(fBase, SkRegion::kReplace_Op, true);
+ canvas->clipRect(fBase, SkCanvas::kReplace_Op, true);
canvas->clipRect(fRect, op, true);
}
@@ -144,14 +144,14 @@ protected:
const struct {
SkColor fColor;
const char* fName;
- SkRegion::Op fOp;
+ SkCanvas::ClipOp fOp;
} gOps[] = {
- { SK_ColorBLACK, "Difference", SkRegion::kDifference_Op },
- { SK_ColorRED, "Intersect", SkRegion::kIntersect_Op },
- { sk_tool_utils::color_to_565(0xFF008800), "Union", SkRegion::kUnion_Op },
- { SK_ColorGREEN, "Rev Diff", SkRegion::kReverseDifference_Op },
- { SK_ColorYELLOW, "Replace", SkRegion::kReplace_Op },
- { SK_ColorBLUE, "XOR", SkRegion::kXOR_Op },
+ { SK_ColorBLACK, "Difference", SkCanvas::kDifference_Op },
+ { SK_ColorRED, "Intersect", SkCanvas::kIntersect_Op },
+ { sk_tool_utils::color_to_565(0xFF008800), "Union", SkCanvas::kUnion_Op },
+ { SK_ColorGREEN, "Rev Diff", SkCanvas::kReverseDifference_Op },
+ { SK_ColorYELLOW, "Replace", SkCanvas::kReplace_Op },
+ { SK_ColorBLUE, "XOR", SkCanvas::kXOR_Op },
};
SkPaint textPaint;
« no previous file with comments | « gm/samplerstress.cpp ('k') | gm/skbug1719.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698