remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS
authorMike Reed <reed@google.com>
Thu, 8 Dec 2016 21:06:37 +0000 (16:06 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Thu, 8 Dec 2016 21:45:27 +0000 (21:45 +0000)
switch over to SkClipOps now that SK_SUPPORT_LEGACY_CLIP_REGIONOPS is gone

BUG=skia:

Change-Id: Ifdc8b3746d508348a40cc009a4e529a1cb3c405d
Reviewed-on: https://skia-review.googlesource.com/5714
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
72 files changed:
bench/AAClipBench.cpp
fuzz/FuzzDrawFunctions.cpp
gm/blurredclippedcircle.cpp
gm/circularclips.cpp
gm/complexclip.cpp
gm/complexclip2.cpp
gm/complexclip3.cpp
gm/complexclip_blur_tiled.cpp
gm/convexpolyclip.cpp
gm/megalooper.cpp
gm/simpleaaclip.cpp
gm/windowrectangles.cpp
include/core/SkCanvas.h
include/core/SkClipStack.h
include/core/SkPictureAnalyzer.h
include/private/SkRecords.h
include/utils/SkDumpCanvas.h
include/utils/SkLuaCanvas.h
include/utils/SkNWayCanvas.h
samplecode/SampleApp.cpp
samplecode/SampleClip.cpp
samplecode/SampleComplexClip.cpp
samplecode/SampleFatBits.cpp
samplecode/SampleIdentityScale.cpp
samplecode/SampleLayers.cpp
src/core/SkCanvas.cpp
src/core/SkClipStack.cpp
src/core/SkLiteDL.cpp
src/core/SkLiteDL.h
src/core/SkLiteRecorder.cpp
src/core/SkLiteRecorder.h
src/core/SkPictureAnalyzer.cpp
src/core/SkPictureFlat.h
src/core/SkPicturePlayback.cpp
src/core/SkPictureRecord.cpp
src/core/SkPictureRecord.h
src/core/SkRecorder.cpp
src/core/SkRecorder.h
src/effects/SkXfermodeImageFilter.cpp
src/gpu/GrClipStackClip.cpp
src/gpu/GrReducedClip.cpp
src/pdf/SkPDFCanvas.cpp
src/pdf/SkPDFCanvas.h
src/pdf/SkPDFDevice.cpp
src/pipe/SkPipeCanvas.cpp
src/pipe/SkPipeCanvas.h
src/pipe/SkPipeReader.cpp
src/svg/SkSVGDevice.cpp
src/utils/SkCanvasStack.cpp
src/utils/SkCanvasStack.h
src/utils/SkCanvasStateUtils.cpp
src/utils/SkDeferredCanvas.cpp
src/utils/SkDeferredCanvas.h
src/utils/SkDumpCanvas.cpp
src/utils/SkLuaCanvas.cpp
src/utils/SkNWayCanvas.cpp
tests/CanvasStateHelpers.cpp
tests/CanvasStateTest.cpp
tests/CanvasTest.cpp
tests/ClipBoundsTest.cpp
tests/ClipStackTest.cpp
tests/GrShapeTest.cpp
tests/PictureTest.cpp
tests/ReadPixelsTest.cpp
tests/SkLiteDLTest.cpp
tests/WritePixelsTest.cpp
tools/debugger/SkDebugCanvas.cpp
tools/debugger/SkDebugCanvas.h
tools/debugger/SkDrawCommand.cpp
tools/debugger/SkDrawCommand.h
tools/debugger/SkObjectParser.cpp
tools/debugger/SkObjectParser.h

index f91216e965619aebc7850675006f25a8d5859fc2..f3159b6168851ffb2bca070c01fb6c465288f9f7 100644 (file)
@@ -59,9 +59,9 @@ protected:
             canvas->save();
 #if 1
             if (fDoPath) {
-                canvas->clipPath(fClipPath, SkCanvas::kReplace_Op, fDoAA);
+                canvas->clipPath(fClipPath, kReplace_SkClipOp, fDoAA);
             } else {
-                canvas->clipRect(fClipRect, SkCanvas::kReplace_Op, fDoAA);
+                canvas->clipRect(fClipRect, kReplace_SkClipOp, fDoAA);
             }
 
             canvas->drawRect(fDrawRect, paint);
@@ -130,8 +130,7 @@ protected:
             SkASSERT(path.isConvex());
 
             canvas->clipPath(path,
-                             0 == depth ? SkCanvas::kReplace_Op :
-                                          SkCanvas::kIntersect_Op,
+                             0 == depth ? kReplace_SkClipOp : kIntersect_SkClipOp,
                              fDoAA);
 
             if (kNestingDepth == depth) {
index c14b29a6e2568ccf881c7ad2bdb55065c2d7f955..cee866c0c3961ff4354d823c058ee8d38f0a3092 100644 (file)
@@ -198,7 +198,7 @@ static void fuzz_drawRect(Fuzz* fuzz) {
     fuzz->next(&bl);
     fuzz->next(&a, &b, &c, &d);
     r = SkRect::MakeXYWH(a, b, c, d);
-    cnv->clipRect(r, SkCanvas::kIntersect_Op, bl);
+    cnv->clipRect(r, kIntersect_SkClipOp, bl);
 }
 
 static void fuzz_drawPath(Fuzz* fuzz) {
@@ -249,7 +249,7 @@ static void fuzz_drawPath(Fuzz* fuzz) {
 
     bool bl;
     fuzz->next(&bl);
-    cnv->clipPath(path, SkCanvas::kIntersect_Op, bl);
+    cnv->clipPath(path, kIntersect_SkClipOp, bl);
 }
 
 static void fuzz_drawBitmap(Fuzz* fuzz) {
index e2cb288cd5e57f18190bfa570dc4c432a160c7ac..e9640ec25e1e9d3901c4cff5c571afe9880e7773 100644 (file)
@@ -56,7 +56,7 @@ protected:
 
                     SkRect clipRect2 = SkRect::MakeLTRB(8, 8, 288, 288);
                     SkRRect clipRRect = SkRRect::MakeOval(clipRect2);
-                    canvas->clipRRect(clipRRect, SkCanvas::kDifference_Op, true);
+                    canvas->clipRRect(clipRRect, kDifference_SkClipOp, true);
 
                     SkRect r = SkRect::MakeLTRB(4, 4, 292, 292);
                     SkRRect rr = SkRRect::MakeOval(r);
index f505310e4de688ff37d9b27883dc375de1696c1e..9374f6fb913f14664f02a182024295e0bbd05d0e 100644 (file)
@@ -36,13 +36,13 @@ protected:
     }
 
     void onDraw(SkCanvas* canvas) override {
-        SkCanvas::ClipOp ops[] = {
-            SkCanvas::kDifference_Op,
-            SkCanvas::kIntersect_Op,
-            SkCanvas::kUnion_Op,
-            SkCanvas::kXOR_Op,
-            SkCanvas::kReverseDifference_Op,
-            SkCanvas::kReplace_Op,
+        const SkClipOp ops[] = {
+            kDifference_SkClipOp,
+            kIntersect_SkClipOp,
+            kUnion_SkClipOp,
+            kXOR_SkClipOp,
+            kReverseDifference_SkClipOp,
+            kReplace_SkClipOp,
         };
 
         SkRect rect = SkRect::MakeLTRB(fX1 - fR, fY - fR, fX2 + fR, fY + fR);
index 2f8fa3d32582ccb3fc2770fa4cc224241ff5503e..2ae6a087c66aba01b1e16bbf707c14adf6305855 100644 (file)
@@ -86,14 +86,14 @@ protected:
         paint.setTextSize(SkIntToScalar(20));
 
         constexpr struct {
-            SkCanvas::ClipOp fOp;
+            SkClipOp fOp;
             const char*      fName;
         } gOps[] = { //extra spaces in names for measureText
-            {SkCanvas::kIntersect_Op,         "Isect "},
-            {SkCanvas::kDifference_Op,        "Diff " },
-            {SkCanvas::kUnion_Op,             "Union "},
-            {SkCanvas::kXOR_Op,               "Xor "  },
-            {SkCanvas::kReverseDifference_Op, "RDiff "}
+            {kIntersect_SkClipOp,         "Isect "},
+            {kDifference_SkClipOp,        "Diff " },
+            {kUnion_SkClipOp,             "Union "},
+            {kXOR_SkClipOp,               "Xor "  },
+            {kReverseDifference_SkClipOp, "RDiff "}
         };
 
         canvas->translate(SkIntToScalar(20), SkIntToScalar(20));
index 3180f6681acb22baaed35e3248a915e60a4995fe..71e07c92210624d364b986301d75ae376a50078c 100644 (file)
@@ -83,13 +83,13 @@ protected:
         fPaths[4].addRoundRect(fRects[4], 5, 5);
         fRectColors[4] = SK_ColorCYAN;
 
-        SkCanvas::ClipOp ops[] = {
-            SkCanvas::kDifference_Op,
-            SkCanvas::kIntersect_Op,
-            SkCanvas::kUnion_Op,
-            SkCanvas::kXOR_Op,
-            SkCanvas::kReverseDifference_Op,
-            SkCanvas::kReplace_Op,
+        const SkClipOp ops[] = {
+            kDifference_SkClipOp,
+            kIntersect_SkClipOp,
+            kUnion_SkClipOp,
+            kXOR_SkClipOp,
+            kReverseDifference_SkClipOp,
+            kReplace_SkClipOp,
         };
 
         SkRandom r;
@@ -200,7 +200,7 @@ private:
     SkRRect fRRects[5];
     SkPath fPaths[5];
     SkColor fRectColors[5];
-    SkCanvas::ClipOp fOps[kRows * kCols][5];
+    SkClipOp fOps[kRows * kCols][5];
     SkScalar fWidth;
     SkScalar fHeight;
     SkScalar fTotalWidth;
index 59c78ec5a334ff11c97a297b3c339f52d72f7d00..c174d9d5a8b4a459604da7fa6cc01ac4f23daba0 100644 (file)
@@ -52,14 +52,14 @@ protected:
         paint.setTextSize(SkIntToScalar(20));
 
         constexpr struct {
-            SkCanvas::ClipOp fOp;
-            const char*      fName;
+            SkClipOp    fOp;
+            const char* fName;
         } gOps[] = {
-            {SkCanvas::kIntersect_Op,         "I"},
-            {SkCanvas::kDifference_Op,        "D" },
-            {SkCanvas::kUnion_Op,             "U"},
-            {SkCanvas::kXOR_Op,               "X"  },
-            {SkCanvas::kReverseDifference_Op, "R"}
+            {kIntersect_SkClipOp,         "I"},
+            {kDifference_SkClipOp,        "D" },
+            {kUnion_SkClipOp,             "U"},
+            {kXOR_SkClipOp,               "X"  },
+            {kReverseDifference_SkClipOp, "R"}
         };
 
         canvas->translate(SkIntToScalar(20), SkIntToScalar(20));
index 31db174d0605350bdb1c670cb60777b0a5b2dd35..3a0f0e0cb8dd6c2e5d11c73feda3d16c0e8107b2 100644 (file)
@@ -52,7 +52,7 @@ protected:
                 SkRect rect = SkRect::MakeWH(WIDTH, HEIGHT);
                 tileCanvas->saveLayer(&rect, &blurPaint);
                 SkRRect rrect = SkRRect::MakeRectXY(rect.makeInset(20, 20), 25, 25);
-                tileCanvas->clipRRect(rrect, SkCanvas::kDifference_Op, true);
+                tileCanvas->clipRRect(rrect, kDifference_SkClipOp, true);
                 SkPaint paint;
                 tileCanvas->drawRect(rect, paint);
                 tileCanvas->restore();
index 511695502187834c07cf36785d4299a8066d0870..5a8844abe2285304a471db23e98fdcd8fc84d36e 100644 (file)
@@ -173,7 +173,7 @@ protected:
                         canvas->save();
                     }
                     canvas->translate(x, y);
-                    clip->setOnCanvas(canvas, SkCanvas::kIntersect_Op, SkToBool(aa));
+                    clip->setOnCanvas(canvas, kIntersect_SkClipOp, SkToBool(aa));
                     canvas->drawBitmap(fBmp, 0, 0);
                     canvas->restore();
                     x += fBmp.width() + kMargin;
@@ -199,7 +199,7 @@ protected:
                     SkPath closedClipPath;
                     clip->asClosedPath(&closedClipPath);
                     canvas->drawPath(closedClipPath, clipOutlinePaint);
-                    clip->setOnCanvas(canvas, SkCanvas::kIntersect_Op, SkToBool(aa));
+                    clip->setOnCanvas(canvas, kIntersect_SkClipOp, SkToBool(aa));
                     canvas->scale(1.f, 1.8f);
                     canvas->drawText(kTxt, SK_ARRAY_COUNT(kTxt)-1,
                                      0, 1.5f * txtPaint.getTextSize(),
@@ -227,7 +227,7 @@ private:
 
         Clip () : fClipType(kNone_ClipType) {}
 
-        void setOnCanvas(SkCanvas* canvas, SkCanvas::ClipOp op, bool aa) const {
+        void setOnCanvas(SkCanvas* canvas, SkClipOp op, bool aa) const {
             switch (fClipType) {
                 case kPath_ClipType:
                     canvas->clipPath(fPath, op, aa);
index f5077c02a471f3c9d451bcc0d87c2936f188ad98..57df53aebd184eb1f9b9c2fb450a3e9be1299f44 100644 (file)
@@ -91,8 +91,8 @@ private:
         outerClip.offset(x, y);
 
         canvas->save();
-        canvas->clipRect(outerClip, SkCanvas::kIntersect_Op);
-        canvas->clipRect(innerClip, SkCanvas::kDifference_Op);
+        canvas->clipRect(outerClip, kIntersect_SkClipOp);
+        canvas->clipRect(innerClip, kDifference_SkClipOp);
 
         SkPaint paint;
         paint.setAntiAlias(true);
@@ -146,8 +146,8 @@ private:
             rect.offset(x, y);
 
             canvas->save();
-                canvas->clipRect(outerClip, SkCanvas::kIntersect_Op);
-                canvas->clipRect(rect, SkCanvas::kDifference_Op);
+                canvas->clipRect(outerClip, kIntersect_SkClipOp);
+                canvas->clipRect(rect, kDifference_SkClipOp);
 
                 // move the rect to where we want the blur to appear
                 rect.offset(gBlurOffsets[i]);
@@ -195,8 +195,8 @@ private:
         paint.setLooper(create4Looper(-kOffsetToOutsideClip-kHalfSquareSize, 0));
 
         canvas->save();
-            canvas->clipRect(outerClip, SkCanvas::kIntersect_Op);
-            canvas->clipRect(rect, SkCanvas::kDifference_Op);
+            canvas->clipRect(outerClip, kIntersect_SkClipOp);
+            canvas->clipRect(rect, kDifference_SkClipOp);
 
             rect.offset(SkIntToScalar(kOffsetToOutsideClip+kHalfSquareSize), 0);
             canvas->drawRect(rect, paint);
index 9a8fe61eaa0c1e8756b6caaef20045f7df7efbfa..72a590f8a38acea41c1610a213b8d67b68cdf18f 100644 (file)
@@ -67,7 +67,7 @@ protected:
         INHERITED::setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
     }
 
-    void buildRgn(SkAAClip* clip, SkCanvas::ClipOp op) {
+    void buildRgn(SkAAClip* clip, SkClipOp op) {
         clip->setPath(fBasePath, nullptr, true);
 
         SkAAClip clip2;
@@ -85,7 +85,7 @@ protected:
         canvas->drawRect(fRect, paint);
     }
 
-    void drawRgnOped(SkCanvas* canvas, SkCanvas::ClipOp op, SkColor color) {
+    void drawRgnOped(SkCanvas* canvas, SkClipOp op, SkColor color) {
 
         SkAAClip clip;
 
@@ -97,7 +97,7 @@ protected:
         paint_rgn(canvas, clip, paint);
     }
 
-    void drawPathsOped(SkCanvas* canvas, SkCanvas::ClipOp op, SkColor color) {
+    void drawPathsOped(SkCanvas* canvas, SkClipOp op, SkColor color) {
 
         this->drawOrig(canvas);
 
@@ -144,14 +144,14 @@ protected:
         const struct {
             SkColor         fColor;
             const char*     fName;
-            SkCanvas::ClipOp fOp;
+            SkClipOp        fOp;
         } gOps[] = {
-            { 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           },
+            { SK_ColorBLACK,    "Difference", kDifference_SkClipOp    },
+            { SK_ColorRED,      "Intersect",  kIntersect_SkClipOp     },
+            { sk_tool_utils::color_to_565(0xFF008800), "Union", kUnion_SkClipOp },
+            { SK_ColorGREEN,    "Rev Diff",   kReverseDifference_SkClipOp },
+            { SK_ColorYELLOW,   "Replace",    kReplace_SkClipOp       },
+            { SK_ColorBLUE,     "XOR",        kXOR_SkClipOp           },
         };
 
         SkPaint textPaint;
index 3949b3f41c091fe3daf2b5b9039e3de7c5694f8a..e277db626c022af55de5b10f923e584eb53292d3 100644 (file)
@@ -43,20 +43,20 @@ void WindowRectanglesBaseGM::onDraw(SkCanvas* canvas) {
 
     SkClipStack stack;
     stack.clipRect(SkRect::MakeXYWH(370.75, 80.25, 149, 100), SkMatrix::I(),
-                   SkCanvas::kDifference_Op, false);
+                   kDifference_SkClipOp, false);
     stack.clipRect(SkRect::MakeXYWH(80.25, 420.75, 150, 100), SkMatrix::I(),
-                   SkCanvas::kDifference_Op, true);
+                   kDifference_SkClipOp, true);
     stack.clipRRect(SkRRect::MakeRectXY(SkRect::MakeXYWH(200, 200, 200, 200), 60, 45),
-                    SkMatrix::I(), SkCanvas::kDifference_Op, true);
+                    SkMatrix::I(), kDifference_SkClipOp, true);
 
     SkRRect nine;
     nine.setNinePatch(SkRect::MakeXYWH(550 - 30.25 - 100, 370.75, 100, 150), 12, 35, 23, 20);
-    stack.clipRRect(nine, SkMatrix::I(), SkCanvas::kDifference_Op, true);
+    stack.clipRRect(nine, SkMatrix::I(), kDifference_SkClipOp, true);
 
     SkRRect complx;
     SkVector complxRadii[4] = {{6, 4}, {8, 12}, {16, 24}, {48, 32}};
     complx.setRectRadii(SkRect::MakeXYWH(80.25, 80.75, 100, 149), complxRadii);
-    stack.clipRRect(complx, SkMatrix::I(), SkCanvas::kDifference_Op, false);
+    stack.clipRRect(complx, SkMatrix::I(), kDifference_SkClipOp, false);
 
     this->onCoverClipStack(stack, canvas);
 
@@ -79,7 +79,7 @@ private:
  */
 class ReplayClipStackVisitor final : public SkCanvasClipVisitor {
 public:
-    typedef SkCanvas::ClipOp Op;
+    typedef SkClipOp Op;
     ReplayClipStackVisitor(SkCanvas* canvas) : fCanvas(canvas) {}
     void clipRect(const SkRect& r, Op op, bool aa) override { fCanvas->clipRect(r, op, aa); }
     void clipRRect(const SkRRect& rr, Op op, bool aa) override { fCanvas->clipRRect(rr, op, aa); }
index 9ba441a23adc090c3dc59a6b605002ae19bdea09..3507786ab9a6fdce060f6ff46ffba5f9bc62694c 100644 (file)
@@ -42,8 +42,6 @@ class SkSurface;
 class SkSurface_Base;
 class SkTextBlob;
 
-//#define SK_SUPPORT_LEGACY_CLIP_REGIONOPS
-
 /** \class SkCanvas
 
     A Canvas encapsulates all of the state about drawing into a device (bitmap).
@@ -65,25 +63,6 @@ class SK_API SkCanvas : SkNoncopyable {
     };
 
 public:
-#ifdef SK_SUPPORT_LEGACY_CLIP_REGIONOPS
-    typedef SkRegion::Op ClipOp;
-
-    static const ClipOp kDifference_Op         = SkRegion::kDifference_Op;
-    static const ClipOp kIntersect_Op          = SkRegion::kIntersect_Op;
-    static const ClipOp kUnion_Op              = SkRegion::kUnion_Op;
-    static const ClipOp kXOR_Op                = SkRegion::kXOR_Op;
-    static const ClipOp kReverseDifference_Op  = SkRegion::kReverseDifference_Op;
-    static const ClipOp kReplace_Op            = SkRegion::kReplace_Op;
-#else
-    typedef SkClipOp ClipOp;
-
-    static const ClipOp kDifference_Op         = kDifference_SkClipOp;
-    static const ClipOp kIntersect_Op          = kIntersect_SkClipOp;
-    static const ClipOp kUnion_Op              = kUnion_SkClipOp;
-    static const ClipOp kXOR_Op                = kXOR_SkClipOp;
-    static const ClipOp kReverseDifference_Op  = kReverseDifference_SkClipOp;
-    static const ClipOp kReplace_Op            = kReplace_SkClipOp;
-#endif
     /**
      *  Attempt to allocate raster canvas, matching the ImageInfo, that will draw directly into the
      *  specified pixels. To access the pixels after drawing to them, the caller should call
@@ -493,12 +472,12 @@ public:
      *  @param op The region op to apply to the current clip
      *  @param doAntiAlias true if the clip should be antialiased
      */
-    void clipRect(const SkRect& rect, ClipOp, bool doAntiAlias);
-    void clipRect(const SkRect& rect, ClipOp op) {
+    void clipRect(const SkRect& rect, SkClipOp, bool doAntiAlias);
+    void clipRect(const SkRect& rect, SkClipOp op) {
         this->clipRect(rect, op, false);
     }
     void clipRect(const SkRect& rect, bool doAntiAlias = false) {
-        this->clipRect(rect, kIntersect_Op, doAntiAlias);
+        this->clipRect(rect, kIntersect_SkClipOp, doAntiAlias);
     }
 
     /**
@@ -507,12 +486,12 @@ public:
      *  @param op The region op to apply to the current clip
      *  @param doAntiAlias true if the clip should be antialiased
      */
-    void clipRRect(const SkRRect& rrect, ClipOp op, bool doAntiAlias);
-    void clipRRect(const SkRRect& rrect, ClipOp op) {
+    void clipRRect(const SkRRect& rrect, SkClipOp op, bool doAntiAlias);
+    void clipRRect(const SkRRect& rrect, SkClipOp op) {
         this->clipRRect(rrect, op, false);
     }
     void clipRRect(const SkRRect& rrect, bool doAntiAlias = false) {
-        this->clipRRect(rrect, kIntersect_Op, doAntiAlias);
+        this->clipRRect(rrect, kIntersect_SkClipOp, doAntiAlias);
     }
 
     /**
@@ -521,12 +500,12 @@ public:
      *  @param op The region op to apply to the current clip
      *  @param doAntiAlias true if the clip should be antialiased
      */
-    void clipPath(const SkPath& path, ClipOp op, bool doAntiAlias);
-    void clipPath(const SkPath& path, ClipOp op) {
+    void clipPath(const SkPath& path, SkClipOp op, bool doAntiAlias);
+    void clipPath(const SkPath& path, SkClipOp op) {
         this->clipPath(path, op, false);
     }
     void clipPath(const SkPath& path, bool doAntiAlias = false) {
-        this->clipPath(path, kIntersect_Op, doAntiAlias);
+        this->clipPath(path, kIntersect_SkClipOp, doAntiAlias);
     }
 
     /** EXPERIMENTAL -- only used for testing
@@ -543,7 +522,7 @@ public:
         @param deviceRgn    The region to apply to the current clip
         @param op The region op to apply to the current clip
     */
-    void clipRegion(const SkRegion& deviceRgn, ClipOp op = kIntersect_Op);
+    void clipRegion(const SkRegion& deviceRgn, SkClipOp op = kIntersect_SkClipOp);
 
     /** Return true if the specified rectangle, after being transformed by the
         current matrix, would lie completely outside of the current clip. Call
@@ -1479,10 +1458,10 @@ protected:
         kSoft_ClipEdgeStyle
     };
 
-    virtual void onClipRect(const SkRect& rect, ClipOp, ClipEdgeStyle);
-    virtual void onClipRRect(const SkRRect& rrect, ClipOp, ClipEdgeStyle);
-    virtual void onClipPath(const SkPath& path, ClipOp, ClipEdgeStyle);
-    virtual void onClipRegion(const SkRegion& deviceRgn, ClipOp);
+    virtual void onClipRect(const SkRect& rect, SkClipOp, ClipEdgeStyle);
+    virtual void onClipRRect(const SkRRect& rrect, SkClipOp, ClipEdgeStyle);
+    virtual void onClipPath(const SkPath& path, SkClipOp, ClipEdgeStyle);
+    virtual void onClipRegion(const SkRegion& deviceRgn, SkClipOp);
 
     virtual void onDiscard();
 
@@ -1741,9 +1720,9 @@ private:
 class SkCanvasClipVisitor {
 public:
     virtual ~SkCanvasClipVisitor();
-    virtual void clipRect(const SkRect&, SkCanvas::ClipOp, bool antialias) = 0;
-    virtual void clipRRect(const SkRRect&, SkCanvas::ClipOp, bool antialias) = 0;
-    virtual void clipPath(const SkPath&, SkCanvas::ClipOp, bool antialias) = 0;
+    virtual void clipRect(const SkRect&, SkClipOp, bool antialias) = 0;
+    virtual void clipRRect(const SkRRect&, SkClipOp, bool antialias) = 0;
+    virtual void clipPath(const SkPath&, SkClipOp, bool antialias) = 0;
 };
 
 #endif
index 7a8eb5ca846db484a82f229a386432126494534b..98a3f7698b404631df14511e8b970d4befca3077 100644 (file)
@@ -54,21 +54,21 @@ public:
         static const int kTypeCnt = kLastType + 1;
 
         Element() {
-            this->initCommon(0, SkCanvas::kReplace_Op, false);
+            this->initCommon(0, kReplace_SkClipOp, false);
             this->setEmpty();
         }
 
         Element(const Element&);
 
-        Element(const SkRect& rect, SkCanvas::ClipOp op, bool doAA) {
+        Element(const SkRect& rect, SkClipOp op, bool doAA) {
             this->initRect(0, rect, op, doAA);
         }
 
-        Element(const SkRRect& rrect, SkCanvas::ClipOp op, bool doAA) {
+        Element(const SkRRect& rrect, SkClipOp op, bool doAA) {
             this->initRRect(0, rrect, op, doAA);
         }
 
-        Element(const SkPath& path, SkCanvas::ClipOp op, bool doAA) {
+        Element(const SkPath& path, SkClipOp op, bool doAA) {
             this->initPath(0, path, op, doAA);
         }
 
@@ -94,7 +94,7 @@ public:
         }
 
         //!< Call if getType() is not kEmpty to get the set operation used to combine this element.
-        SkCanvas::ClipOp getOp() const { return fOp; }
+        SkClipOp getOp() const { return fOp; }
 
         //!< Call to get the element as a path, regardless of its type.
         void asPath(SkPath* path) const;
@@ -110,7 +110,7 @@ public:
         void invertShapeFillType();
 
         //!< Sets the set operation represented by the element.
-        void setOp(SkCanvas::ClipOp op) { fOp = op; }
+        void setOp(SkClipOp op) { fOp = op; }
 
         /** The GenID can be used by clip stack clients to cache representations of the clip. The
             ID corresponds to the set of clip elements up to and including this element within the
@@ -202,7 +202,7 @@ public:
         SkTLazy<SkPath> fPath;
         SkRRect         fRRect;
         int             fSaveCount; // save count of stack when this element was added.
-        SkCanvas::ClipOp fOp;
+        SkClipOp        fOp;
         Type            fType;
         bool            fDoAA;
 
@@ -226,23 +226,23 @@ public:
         int                     fGenID;
 
         Element(int saveCount) {
-            this->initCommon(saveCount, SkCanvas::kReplace_Op, false);
+            this->initCommon(saveCount, kReplace_SkClipOp, false);
             this->setEmpty();
         }
 
-        Element(int saveCount, const SkRRect& rrect, SkCanvas::ClipOp op, bool doAA) {
+        Element(int saveCount, const SkRRect& rrect, SkClipOp op, bool doAA) {
             this->initRRect(saveCount, rrect, op, doAA);
         }
 
-        Element(int saveCount, const SkRect& rect, SkCanvas::ClipOp op, bool doAA) {
+        Element(int saveCount, const SkRect& rect, SkClipOp op, bool doAA) {
             this->initRect(saveCount, rect, op, doAA);
         }
 
-        Element(int saveCount, const SkPath& path, SkCanvas::ClipOp op, bool doAA) {
+        Element(int saveCount, const SkPath& path, SkClipOp op, bool doAA) {
             this->initPath(saveCount, path, op, doAA);
         }
 
-        void initCommon(int saveCount, SkCanvas::ClipOp op, bool doAA) {
+        void initCommon(int saveCount, SkClipOp op, bool doAA) {
             fSaveCount = saveCount;
             fOp = op;
             fDoAA = doAA;
@@ -254,13 +254,13 @@ public:
             fGenID = kInvalidGenID;
         }
 
-        void initRect(int saveCount, const SkRect& rect, SkCanvas::ClipOp op, bool doAA) {
+        void initRect(int saveCount, const SkRect& rect, SkClipOp op, bool doAA) {
             fRRect.setRect(rect);
             fType = kRect_Type;
             this->initCommon(saveCount, op, doAA);
         }
 
-        void initRRect(int saveCount, const SkRRect& rrect, SkCanvas::ClipOp op, bool doAA) {
+        void initRRect(int saveCount, const SkRRect& rrect, SkClipOp op, bool doAA) {
             SkRRect::Type type = rrect.getType();
             fRRect = rrect;
             if (SkRRect::kRect_Type == type || SkRRect::kEmpty_Type == type) {
@@ -271,13 +271,13 @@ public:
             this->initCommon(saveCount, op, doAA);
         }
 
-        void initPath(int saveCount, const SkPath& path, SkCanvas::ClipOp op, bool doAA);
+        void initPath(int saveCount, const SkPath& path, SkClipOp op, bool doAA);
 
         void setEmpty();
 
         // All Element methods below are only used within SkClipStack.cpp
         inline void checkEmpty() const;
-        inline bool canBeIntersectedInPlace(int saveCount, SkCanvas::ClipOp op) const;
+        inline bool canBeIntersectedInPlace(int saveCount, SkClipOp op) const;
         /* This method checks to see if two rect clips can be safely merged into one. The issue here
           is that to be strictly correct all the edges of the resulting rect must have the same
           anti-aliasing. */
@@ -346,14 +346,14 @@ public:
      */
     bool asPath(SkPath* path) const;
 
-    void clipDevRect(const SkIRect& ir, SkCanvas::ClipOp op) {
+    void clipDevRect(const SkIRect& ir, SkClipOp op) {
         SkRect r;
         r.set(ir);
         this->clipRect(r, SkMatrix::I(), op, false);
     }
-    void clipRect(const SkRect&, const SkMatrix& matrix, SkCanvas::ClipOp, bool doAA);
-    void clipRRect(const SkRRect&, const SkMatrix& matrix, SkCanvas::ClipOp, bool doAA);
-    void clipPath(const SkPath&, const SkMatrix& matrix, SkCanvas::ClipOp, bool doAA);
+    void clipRect(const SkRect&, const SkMatrix& matrix, SkClipOp, bool doAA);
+    void clipRRect(const SkRRect&, const SkMatrix& matrix, SkClipOp, bool doAA);
+    void clipPath(const SkPath&, const SkMatrix& matrix, SkClipOp, bool doAA);
     // An optimized version of clipDevRect(emptyRect, kIntersect, ...)
     void clipEmpty();
 
@@ -424,7 +424,7 @@ public:
          * Moves the iterator to the topmost element with the specified RegionOp and returns that
          * element. If no clip element with that op is found, the first element is returned.
          */
-        const Element* skipToTopmost(SkCanvas::ClipOp op);
+        const Element* skipToTopmost(SkClipOp op);
 
         /**
          * Restarts the iterator on a clip stack.
index 62dac30f0104a6da4cde99dfdd1b01e9eef5c7d3..52db8334d43e129822b6addb70b39df7c30639e8 100644 (file)
@@ -37,7 +37,7 @@ public:
     /**
      *  Process an explicit clipPath op.
      */
-    void analyzeClipPath(const SkPath&, SkCanvas::ClipOp, bool doAntiAlias);
+    void analyzeClipPath(const SkPath&, SkClipOp, bool doAntiAlias);
 
     /**
      *  Reset all accumulated stats.
index 447764fcedef421cfac4e4160e5bbc3ff26933e4..54efab1891bba9831d1c9211c3c9f8803a8b73e1 100644 (file)
@@ -192,8 +192,8 @@ RECORD(TranslateZ, 0, SkScalar z);
 
 struct ClipOpAndAA {
     ClipOpAndAA() {}
-    ClipOpAndAA(SkCanvas::ClipOp op, bool aa) : op(op), aa(aa) {}
-    SkCanvas::ClipOp op : 31;  // This really only needs to be 3, but there's no win today to do so.
+    ClipOpAndAA(SkClipOp op, bool aa) : op(op), aa(aa) {}
+    SkClipOp op : 31;  // This really only needs to be 3, but there's no win today to do so.
     unsigned         aa :  1;  // MSVC won't pack an enum with an bool, so we call this an unsigned.
 };
 static_assert(sizeof(ClipOpAndAA) == 4, "ClipOpAndAASize");
@@ -213,7 +213,7 @@ RECORD(ClipRect, 0,
 RECORD(ClipRegion, 0,
         SkIRect devBounds;
         SkRegion region;
-        SkCanvas::ClipOp op);
+        SkClipOp op);
 
 // While not strictly required, if you have an SkPaint, it's fastest to put it first.
 RECORD(DrawArc, kDraw_Tag|kHasPaint_Tag,
index c2152f23d893772ecbcb0352c062a2e83ddb1922..c8f977ec1051b7d543fe6b8a4c796fa05b8db536 100644 (file)
@@ -117,10 +117,10 @@ protected:
                         const uint16_t indices[], int indexCount,
                         const SkPaint&) override;
 
-    void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipRRect(const SkRRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipPath(const SkPath&, ClipOp, ClipEdgeStyle) override;
-    void onClipRegion(const SkRegion&, ClipOp) override;
+    void onClipRect(const SkRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRRect(const SkRRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipPath(const SkPath&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRegion(const SkRegion&, SkClipOp) override;
 
     void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) override;
     void onDrawAnnotation(const SkRect&, const char key[], SkData* value) override;
index c03a1f0afc1f7f3b6e07c74d4bc54bbc9f4ff5c1..357ddc81daaa880a63ec57a5344c3dd5310c035d 100644 (file)
@@ -63,10 +63,10 @@ protected:
                         const uint16_t indices[], int indexCount,
                         const SkPaint&) override;
 
-    void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipRRect(const SkRRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipPath(const SkPath&, ClipOp, ClipEdgeStyle) override;
-    void onClipRegion(const SkRegion&, ClipOp) override;
+    void onClipRect(const SkRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRRect(const SkRRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipPath(const SkPath&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRegion(const SkRegion&, SkClipOp) override;
 
     void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) override;
 
index d8856dad0bdd9019a8063f68e2c0bfa83d068611..3ed7d4c41a8389433944b23cdae5ea1496e88f02 100644 (file)
@@ -76,10 +76,10 @@ protected:
                               const uint16_t indices[], int indexCount,
                               const SkPaint&) override;
 
-    void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipRRect(const SkRRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipPath(const SkPath&, ClipOp, ClipEdgeStyle) override;
-    void onClipRegion(const SkRegion&, ClipOp) override;
+    void onClipRect(const SkRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRRect(const SkRRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipPath(const SkPath&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRegion(const SkRegion&, SkClipOp) override;
 
     void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) override;
     void onDrawAnnotation(const SkRect&, const char[], SkData*) override;
index 776844ca762174691c8e047ad61bc0f00b22a421..1acd975989d0796ca7e45c3e5d7a61636d2209bf 100644 (file)
@@ -1370,7 +1370,7 @@ SkCanvas* SampleWindow::beforeChildren(SkCanvas* canvas) {
 
     if (fUseClip) {
         canvas->drawColor(0xFFFF88FF);
-        canvas->clipPath(fClipPath, SkCanvas::kIntersect_Op, true);
+        canvas->clipPath(fClipPath, kIntersect_SkClipOp, true);
     }
 
     // Install a flags filter proxy canvas if needed
index 984a6e5ba51eb0090717ea6ad3c0d4d6e677ac52..82466ba137ce3d6d8d803c66e019135d36b2bf8b 100644 (file)
@@ -142,7 +142,7 @@ protected:
             canvas->save();
             for (size_t i = 0; i < SK_ARRAY_COUNT(gProc); ++i) {
                 canvas->save();
-                canvas->clipPath(clipPath, SkCanvas::kIntersect_Op, SkToBool(aa));
+                canvas->clipPath(clipPath, kIntersect_SkClipOp, SkToBool(aa));
 //                canvas->drawColor(SK_ColorWHITE);
                 gProc[i](canvas, SkToBool(aa));
                 canvas->restore();
index 7439d91f7f0e97e8c7ad83c6bc53387c528533d6..ae8a20f6a5a7f1d7471cb660e728249cd72c57d8 100644 (file)
@@ -79,14 +79,14 @@ protected:
         canvas->drawPath(clipB, paint);
 
         static const struct {
-            SkCanvas::ClipOp fOp;
-            const char*      fName;
+            SkClipOp    fOp;
+            const char* fName;
         } gOps[] = { //extra spaces in names for measureText
-            {SkCanvas::kIntersect_Op,         "Isect "},
-            {SkCanvas::kDifference_Op,        "Diff " },
-            {SkCanvas::kUnion_Op,             "Union "},
-            {SkCanvas::kXOR_Op,               "Xor "  },
-            {SkCanvas::kReverseDifference_Op, "RDiff "}
+            {kIntersect_SkClipOp,         "Isect "},
+            {kDifference_SkClipOp,        "Diff " },
+            {kUnion_SkClipOp,             "Union "},
+            {kXOR_SkClipOp,               "Xor "  },
+            {kReverseDifference_SkClipOp, "RDiff "}
         };
 
         canvas->translate(0, SkIntToScalar(40));
index 82eb25fd702240ee0f6aa10634de1c3cd2afd284..65c929c71aadb016e3bfd2bba7f3309dba9adfdf 100644 (file)
@@ -258,7 +258,7 @@ void FatBits::drawLine(SkCanvas* canvas, SkPoint pts[]) {
         fMinSurface->getCanvas()->save();
         SkRect r = fClipRect;
         r.inset(SK_Scalar1/3, SK_Scalar1/3);
-        fMinSurface->getCanvas()->clipRect(r, SkCanvas::kIntersect_Op, true);
+        fMinSurface->getCanvas()->clipRect(r, kIntersect_SkClipOp, true);
     }
     fMinSurface->getCanvas()->drawLine(pts[0].fX, pts[0].fY, pts[1].fX, pts[1].fY, paint);
     if (fUseClip) {
index 8d1bc369911c590572149949b16fb32600773770..ae6092ac896c67ad6028c9ecd5155e9d37cb9731 100644 (file)
@@ -65,7 +65,7 @@ protected:
           SkRect r = { 100, 100, 356, 356 };
           SkPath clipPath;
           clipPath.addRoundRect(r, SkIntToScalar(5), SkIntToScalar(5));
-          canvas->clipPath(clipPath, SkCanvas::kIntersect_Op, SkToBool(1));
+          canvas->clipPath(clipPath, kIntersect_SkClipOp, true);
           text = "Scaled = 0";
         }
         canvas->drawBitmap( fBM, 100, 100, &paint );
index c086eb048003b1aecf3e15d12b1debfc9ff8a2fd..faf4fde02a45f1e65a7a510401d8b58e115419a5 100644 (file)
@@ -254,7 +254,7 @@ protected:
         m.postTranslate(fCenter.x(), fCenter.y());
         path.transform(m);
 
-        canvas->clipPath(path, SkCanvas::kIntersect_Op, true);
+        canvas->clipPath(path, kIntersect_SkClipOp, true);
         const SkRect bounds = path.getBounds();
 
         SkPaint paint;
index 2dff8e9f89a5274c1a86be1a9c2322867364ea58..430556db7e4099c84ce8c907ae0896cdd60672d8 100644 (file)
@@ -342,7 +342,7 @@ public:
     bool next() {
         if (fMultiDeviceCS && fDevice) {
             // remove the previous device's bounds
-            fMultiDeviceCS->clipDevRect(compute_device_bounds(fDevice), SkCanvas::kDifference_Op);
+            fMultiDeviceCS->clipDevRect(compute_device_bounds(fDevice), kDifference_SkClipOp);
         }
 
         // skip over recs with empty clips
@@ -1104,7 +1104,7 @@ bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveLayerFlags saveLayerFlag
 
     if (BoundsAffectsClip(saveLayerFlags)) {
         // Simplify the current clips since they will be applied properly during restore()
-        fClipStack->clipDevRect(ir, kReplace_Op);
+        fClipStack->clipDevRect(ir, kReplace_SkClipOp);
         fMCRec->fRasterClip.setRect(ir);
         fDeviceClipBounds = qr_clip_bounds(ir);
     }
@@ -1522,13 +1522,13 @@ sk_sp<SkLights> SkCanvas::getLights() const {
 
 //////////////////////////////////////////////////////////////////////////////
 
-void SkCanvas::clipRect(const SkRect& rect, ClipOp op, bool doAA) {
+void SkCanvas::clipRect(const SkRect& rect, SkClipOp op, bool doAA) {
     this->checkForDeferredSave();
     ClipEdgeStyle edgeStyle = doAA ? kSoft_ClipEdgeStyle : kHard_ClipEdgeStyle;
     this->onClipRect(rect, op, edgeStyle);
 }
 
-void SkCanvas::onClipRect(const SkRect& rect, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkCanvas::onClipRect(const SkRect& rect, SkClipOp op, ClipEdgeStyle edgeStyle) {
     const bool isAA = kSoft_ClipEdgeStyle == edgeStyle;
     AutoValidateClip avc(this);
     fClipStack->clipRect(rect, fMCRec->fMatrix, op, isAA);
@@ -1538,7 +1538,7 @@ void SkCanvas::onClipRect(const SkRect& rect, ClipOp op, ClipEdgeStyle edgeStyle
     fDeviceClipBounds = qr_clip_bounds(fMCRec->fRasterClip.getBounds());
 }
 
-void SkCanvas::clipRRect(const SkRRect& rrect, ClipOp op, bool doAA) {
+void SkCanvas::clipRRect(const SkRRect& rrect, SkClipOp op, bool doAA) {
     this->checkForDeferredSave();
     ClipEdgeStyle edgeStyle = doAA ? kSoft_ClipEdgeStyle : kHard_ClipEdgeStyle;
     if (rrect.isRect()) {
@@ -1548,7 +1548,7 @@ void SkCanvas::clipRRect(const SkRRect& rrect, ClipOp op, bool doAA) {
     }
 }
 
-void SkCanvas::onClipRRect(const SkRRect& rrect, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkCanvas::onClipRRect(const SkRRect& rrect, SkClipOp op, ClipEdgeStyle edgeStyle) {
     AutoValidateClip avc(this);
 
     fDeviceCMDirty = true;
@@ -1561,7 +1561,7 @@ void SkCanvas::onClipRRect(const SkRRect& rrect, ClipOp op, ClipEdgeStyle edgeSt
     return;
 }
 
-void SkCanvas::clipPath(const SkPath& path, ClipOp op, bool doAA) {
+void SkCanvas::clipPath(const SkPath& path, SkClipOp op, bool doAA) {
     this->checkForDeferredSave();
     ClipEdgeStyle edgeStyle = doAA ? kSoft_ClipEdgeStyle : kHard_ClipEdgeStyle;
 
@@ -1586,7 +1586,7 @@ void SkCanvas::clipPath(const SkPath& path, ClipOp op, bool doAA) {
     this->onClipPath(path, op, edgeStyle);
 }
 
-void SkCanvas::onClipPath(const SkPath& path, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkCanvas::onClipPath(const SkPath& path, SkClipOp op, ClipEdgeStyle edgeStyle) {
     AutoValidateClip avc(this);
 
     fDeviceCMDirty = true;
@@ -1601,19 +1601,19 @@ void SkCanvas::onClipPath(const SkPath& path, ClipOp op, ClipEdgeStyle edgeStyle
         isAA = getClipStack()->asPath(&tempPath);
         rasterClipPath = &tempPath;
         matrix = &SkMatrix::I();
-        op = kReplace_Op;
+        op = kReplace_SkClipOp;
     }
     fMCRec->fRasterClip.op(*rasterClipPath, *matrix, this->getTopLayerBounds(), (SkRegion::Op)op,
                            isAA);
     fDeviceClipBounds = qr_clip_bounds(fMCRec->fRasterClip.getBounds());
 }
 
-void SkCanvas::clipRegion(const SkRegion& rgn, ClipOp op) {
+void SkCanvas::clipRegion(const SkRegion& rgn, SkClipOp op) {
     this->checkForDeferredSave();
     this->onClipRegion(rgn, op);
 }
 
-void SkCanvas::onClipRegion(const SkRegion& rgn, ClipOp op) {
+void SkCanvas::onClipRegion(const SkRegion& rgn, SkClipOp op) {
     AutoValidateClip avc(this);
 
     fDeviceCMDirty = true;
@@ -3383,13 +3383,6 @@ SkCanvas::SaveLayerStrategy SkNoDrawCanvas::getSaveLayerStrategy(const SaveLayer
 
 ///////////////////////////////////////////////////////////////////////////////
 
-const SkCanvas::ClipOp SkCanvas::kDifference_Op;
-const SkCanvas::ClipOp SkCanvas::kIntersect_Op;
-const SkCanvas::ClipOp SkCanvas::kUnion_Op;
-const SkCanvas::ClipOp SkCanvas::kXOR_Op;
-const SkCanvas::ClipOp SkCanvas::kReverseDifference_Op;
-const SkCanvas::ClipOp SkCanvas::kReplace_Op;
-
 static_assert((int)SkRegion::kDifference_Op         == (int)kDifference_SkClipOp, "");
 static_assert((int)SkRegion::kIntersect_Op          == (int)kIntersect_SkClipOp, "");
 static_assert((int)SkRegion::kUnion_Op              == (int)kUnion_SkClipOp, "");
index f155b49c4f5999264fc70306a75821f3d3d30963..1a1e85f4c5a3c72972bf66afd6bba023248251a9 100644 (file)
@@ -83,7 +83,7 @@ void SkClipStack::Element::replay(SkCanvasClipVisitor* visitor) const {
             visitor->clipRect(this->getRect(), this->getOp(), this->isAA());
             break;
         case kEmpty_Type:
-            visitor->clipRect(kEmptyRect, SkCanvas::kIntersect_Op, false);
+            visitor->clipRect(kEmptyRect, kIntersect_SkClipOp, false);
             break;
     }
 }
@@ -111,7 +111,7 @@ void SkClipStack::Element::invertShapeFillType() {
     }
 }
 
-void SkClipStack::Element::initPath(int saveCount, const SkPath& path, SkCanvas::ClipOp op,
+void SkClipStack::Element::initPath(int saveCount, const SkPath& path, SkClipOp op,
                                     bool doAA) {
     if (!path.isInverseFillType()) {
         SkRect r;
@@ -176,16 +176,16 @@ void SkClipStack::Element::checkEmpty() const {
     SkASSERT(!fPath.isValid());
 }
 
-bool SkClipStack::Element::canBeIntersectedInPlace(int saveCount, SkCanvas::ClipOp op) const {
+bool SkClipStack::Element::canBeIntersectedInPlace(int saveCount, SkClipOp op) const {
     if (kEmpty_Type == fType &&
-        (SkCanvas::kDifference_Op == op || SkCanvas::kIntersect_Op == op)) {
+        (kDifference_SkClipOp == op || kIntersect_SkClipOp == op)) {
         return true;
     }
     // Only clips within the same save/restore frame (as captured by
     // the save count) can be merged
     return  fSaveCount == saveCount &&
-            SkCanvas::kIntersect_Op == op &&
-            (SkCanvas::kIntersect_Op == fOp || SkCanvas::kReplace_Op == fOp);
+            kIntersect_SkClipOp == op &&
+            (kIntersect_SkClipOp == fOp || kReplace_SkClipOp == fOp);
 }
 
 bool SkClipStack::Element::rectRectIntersectAllowed(const SkRect& newR, bool newAA) const {
@@ -399,9 +399,9 @@ void SkClipStack::Element::updateBoundAndGenID(const Element* prior) {
             fFiniteBound = this->getRect();
             fFiniteBoundType = kNormal_BoundsType;
 
-            if (SkCanvas::kReplace_Op == fOp ||
-                (SkCanvas::kIntersect_Op == fOp && nullptr == prior) ||
-                (SkCanvas::kIntersect_Op == fOp && prior->fIsIntersectionOfRects &&
+            if (kReplace_SkClipOp == fOp ||
+                (kIntersect_SkClipOp == fOp && nullptr == prior) ||
+                (kIntersect_SkClipOp == fOp && prior->fIsIntersectionOfRects &&
                     prior->rectRectIntersectAllowed(this->getRect(), fDoAA))) {
                 fIsIntersectionOfRects = true;
             }
@@ -460,28 +460,28 @@ void SkClipStack::Element::updateBoundAndGenID(const Element* prior) {
 
     // Now integrate with clip with the prior clips
     switch (fOp) {
-        case SkCanvas::kDifference_Op:
+        case kDifference_SkClipOp:
             this->combineBoundsDiff(combination, prevFinite);
             break;
-        case SkCanvas::kXOR_Op:
+        case kXOR_SkClipOp:
             this->combineBoundsXOR(combination, prevFinite);
             break;
-        case SkCanvas::kUnion_Op:
+        case kUnion_SkClipOp:
             this->combineBoundsUnion(combination, prevFinite);
             break;
-        case SkCanvas::kIntersect_Op:
+        case kIntersect_SkClipOp:
             this->combineBoundsIntersection(combination, prevFinite);
             break;
-        case SkCanvas::kReverseDifference_Op:
+        case kReverseDifference_SkClipOp:
             this->combineBoundsRevDiff(combination, prevFinite);
             break;
-        case SkCanvas::kReplace_Op:
+        case kReplace_SkClipOp:
             // Replace just ignores everything prior
             // The current clip's bound information is already filled in
             // so nothing to do
             break;
         default:
-            SkDebugf("SkCanvas::ClipOp error\n");
+            SkDebugf("SkClipOp error\n");
             SkASSERT(0);
             break;
     }
@@ -608,7 +608,7 @@ bool SkClipStack::internalQuickContains(const SkRect& rect) const {
     Iter iter(*this, Iter::kTop_IterStart);
     const Element* element = iter.prev();
     while (element != nullptr) {
-        if (SkCanvas::kIntersect_Op != element->getOp() && SkCanvas::kReplace_Op != element->getOp())
+        if (kIntersect_SkClipOp != element->getOp() && kReplace_SkClipOp != element->getOp())
             return false;
         if (element->isInverseFilled()) {
             // Part of 'rect' could be trimmed off by the inverse-filled clip element
@@ -620,7 +620,7 @@ bool SkClipStack::internalQuickContains(const SkRect& rect) const {
                 return false;
             }
         }
-        if (SkCanvas::kReplace_Op == element->getOp()) {
+        if (kReplace_SkClipOp == element->getOp()) {
             break;
         }
         element = iter.prev();
@@ -633,7 +633,7 @@ bool SkClipStack::internalQuickContains(const SkRRect& rrect) const {
     Iter iter(*this, Iter::kTop_IterStart);
     const Element* element = iter.prev();
     while (element != nullptr) {
-        if (SkCanvas::kIntersect_Op != element->getOp() && SkCanvas::kReplace_Op != element->getOp())
+        if (kIntersect_SkClipOp != element->getOp() && kReplace_SkClipOp != element->getOp())
             return false;
         if (element->isInverseFilled()) {
             // Part of 'rrect' could be trimmed off by the inverse-filled clip element
@@ -645,7 +645,7 @@ bool SkClipStack::internalQuickContains(const SkRRect& rrect) const {
                 return false;
             }
         }
-        if (SkCanvas::kReplace_Op == element->getOp()) {
+        if (kReplace_SkClipOp == element->getOp()) {
             break;
         }
         element = iter.prev();
@@ -666,8 +666,8 @@ bool SkClipStack::asPath(SkPath *path) const {
             element->asPath(&operand);
         }
 
-        SkCanvas::ClipOp elementOp = element->getOp();
-        if (elementOp == SkCanvas::kReplace_Op) {
+        SkClipOp elementOp = element->getOp();
+        if (elementOp == kReplace_SkClipOp) {
             *path = operand;
         } else {
             Op(*path, operand, (SkPathOp)elementOp, path);
@@ -718,7 +718,7 @@ void SkClipStack::pushElement(const Element& element) {
                     }
                     break;
             }
-        } else if (SkCanvas::kReplace_Op == element.getOp()) {
+        } else if (kReplace_SkClipOp == element.getOp()) {
             this->restoreTo(fSaveCount - 1);
             prior = (Element*) fDeque.back();
         }
@@ -727,7 +727,7 @@ void SkClipStack::pushElement(const Element& element) {
     newElement->updateBoundAndGenID(prior);
 }
 
-void SkClipStack::clipRRect(const SkRRect& rrect, const SkMatrix& matrix, SkCanvas::ClipOp op,
+void SkClipStack::clipRRect(const SkRRect& rrect, const SkMatrix& matrix, SkClipOp op,
                             bool doAA) {
     SkRRect transformedRRect;
     if (rrect.transform(matrix, &transformedRRect)) {
@@ -741,7 +741,7 @@ void SkClipStack::clipRRect(const SkRRect& rrect, const SkMatrix& matrix, SkCanv
     this->clipPath(path, matrix, op, doAA);
 }
 
-void SkClipStack::clipRect(const SkRect& rect, const SkMatrix& matrix, SkCanvas::ClipOp op,
+void SkClipStack::clipRect(const SkRect& rect, const SkMatrix& matrix, SkClipOp op,
                            bool doAA) {
     if (matrix.rectStaysRect()) {
         SkRect devRect;
@@ -756,7 +756,7 @@ void SkClipStack::clipRect(const SkRect& rect, const SkMatrix& matrix, SkCanvas:
     this->clipPath(path, matrix, op, doAA);
 }
 
-void SkClipStack::clipPath(const SkPath& path, const SkMatrix& matrix, SkCanvas::ClipOp op,
+void SkClipStack::clipPath(const SkPath& path, const SkMatrix& matrix, SkClipOp op,
                            bool doAA) {
     SkPath devPath;
     path.transform(matrix, &devPath);
@@ -768,7 +768,7 @@ void SkClipStack::clipPath(const SkPath& path, const SkMatrix& matrix, SkCanvas:
 void SkClipStack::clipEmpty() {
     Element* element = (Element*) fDeque.back();
 
-    if (element && element->canBeIntersectedInPlace(fSaveCount, SkCanvas::kIntersect_Op)) {
+    if (element && element->canBeIntersectedInPlace(fSaveCount, kIntersect_SkClipOp)) {
         element->setEmpty();
     }
     new (fDeque.push_back()) Element(fSaveCount);
@@ -794,7 +794,7 @@ const SkClipStack::Element* SkClipStack::Iter::prev() {
     return (const SkClipStack::Element*)fIter.prev();
 }
 
-const SkClipStack::Element* SkClipStack::Iter::skipToTopmost(SkCanvas::ClipOp op) {
+const SkClipStack::Element* SkClipStack::Iter::skipToTopmost(SkClipOp op) {
 
     if (nullptr == fStack) {
         return nullptr;
@@ -879,13 +879,13 @@ bool SkClipStack::isRRect(const SkRect& bounds, SkRRect* rrect, bool* aa) const
         back->getType() != SkClipStack::Element::kRRect_Type) {
         return false;
     }
-    if (back->getOp() == SkCanvas::kReplace_Op) {
+    if (back->getOp() == kReplace_SkClipOp) {
         *rrect = back->asRRect();
         *aa = back->isAA();
         return true;
     }
 
-    if (back->getOp() == SkCanvas::kIntersect_Op) {
+    if (back->getOp() == kIntersect_SkClipOp) {
         SkRect backBounds;
         if (!backBounds.intersect(bounds, back->asRRect().rect())) {
             return false;
@@ -894,12 +894,12 @@ bool SkClipStack::isRRect(const SkRect& bounds, SkRRect* rrect, bool* aa) const
             SkDeque::Iter iter(fDeque, SkDeque::Iter::kBack_IterStart);
             SkAssertResult(static_cast<const Element*>(iter.prev()) == back);
             while (const Element* prior = (const Element*)iter.prev()) {
-                if ((prior->getOp() != SkCanvas::kIntersect_Op &&
-                     prior->getOp() != SkCanvas::kReplace_Op) ||
+                if ((prior->getOp() != kIntersect_SkClipOp &&
+                     prior->getOp() != kReplace_SkClipOp) ||
                     !prior->contains(backBounds)) {
                     return false;
                 }
-                if (prior->getOp() == SkCanvas::kReplace_Op) {
+                if (prior->getOp() == kReplace_SkClipOp) {
                     break;
                 }
             }
@@ -951,12 +951,12 @@ void SkClipStack::Element::dump() const {
         "reverse-difference",
         "replace",
     };
-    static_assert(0 == SkCanvas::kDifference_Op, "op_str");
-    static_assert(1 == SkCanvas::kIntersect_Op, "op_str");
-    static_assert(2 == SkCanvas::kUnion_Op, "op_str");
-    static_assert(3 == SkCanvas::kXOR_Op, "op_str");
-    static_assert(4 == SkCanvas::kReverseDifference_Op, "op_str");
-    static_assert(5 == SkCanvas::kReplace_Op, "op_str");
+    static_assert(0 == kDifference_SkClipOp, "op_str");
+    static_assert(1 == kIntersect_SkClipOp, "op_str");
+    static_assert(2 == kUnion_SkClipOp, "op_str");
+    static_assert(3 == kXOR_SkClipOp, "op_str");
+    static_assert(4 == kReverseDifference_SkClipOp, "op_str");
+    static_assert(5 == kReplace_SkClipOp, "op_str");
     static_assert(SK_ARRAY_COUNT(kOpStrings) == SkRegion::kOpCnt, "op_str");
 
     SkDebugf("Type: %s, Op: %s, AA: %s, Save Count: %d\n", kTypeStrings[fType],
index 3f6e54e4afb7ddfafa1ffecdfef210f764e11dbe..2548a818e78b1da084854e62d156e8605ce9cbb6 100644 (file)
@@ -149,34 +149,34 @@ namespace {
 
     struct ClipPath final : Op {
         static const auto kType = Type::ClipPath;
-        ClipPath(const SkPath& path, SkCanvas::ClipOp op, bool aa) : path(path), op(op), aa(aa) {}
-        SkPath           path;
-        SkCanvas::ClipOp op;
-        bool             aa;
+        ClipPath(const SkPath& path, SkClipOp op, bool aa) : path(path), op(op), aa(aa) {}
+        SkPath   path;
+        SkClipOp op;
+        bool     aa;
         void draw(SkCanvas* c, const SkMatrix&) { c->clipPath(path, op, aa); }
         void makeThreadsafe() { make_threadsafe(&path, nullptr); }
     };
     struct ClipRect final : Op {
         static const auto kType = Type::ClipRect;
-        ClipRect(const SkRect& rect, SkCanvas::ClipOp op, bool aa) : rect(rect), op(op), aa(aa) {}
-        SkRect           rect;
-        SkCanvas::ClipOp op;
-        bool             aa;
+        ClipRect(const SkRect& rect, SkClipOp op, bool aa) : rect(rect), op(op), aa(aa) {}
+        SkRect   rect;
+        SkClipOp op;
+        bool     aa;
         void draw(SkCanvas* c, const SkMatrix&) { c->clipRect(rect, op, aa); }
     };
     struct ClipRRect final : Op {
         static const auto kType = Type::ClipRRect;
-        ClipRRect(const SkRRect& rrect, SkCanvas::ClipOp op, bool aa) : rrect(rrect), op(op), aa(aa) {}
-        SkRRect          rrect;
-        SkCanvas::ClipOp op;
-        bool             aa;
+        ClipRRect(const SkRRect& rrect, SkClipOp op, bool aa) : rrect(rrect), op(op), aa(aa) {}
+        SkRRect  rrect;
+        SkClipOp op;
+        bool     aa;
         void draw(SkCanvas* c, const SkMatrix&) { c->clipRRect(rrect, op, aa); }
     };
     struct ClipRegion final : Op {
         static const auto kType = Type::ClipRegion;
-        ClipRegion(const SkRegion& region, SkCanvas::ClipOp op) : region(region), op(op) {}
-        SkRegion         region;
-        SkCanvas::ClipOp op;
+        ClipRegion(const SkRegion& region, SkClipOp op) : region(region), op(op) {}
+        SkRegion region;
+        SkClipOp op;
         void draw(SkCanvas* c, const SkMatrix&) { c->clipRegion(region, op); }
     };
 
@@ -599,16 +599,16 @@ void SkLiteDL::setMatrix(const SkMatrix& matrix)   { this->push<SetMatrix>(0, ma
 void SkLiteDL::translate(SkScalar dx, SkScalar dy) { this->push<Translate>(0, dx, dy); }
 void SkLiteDL::translateZ(SkScalar dz) { this->push<TranslateZ>(0, dz); }
 
-void SkLiteDL::clipPath(const SkPath& path, SkCanvas::ClipOp op, bool aa) {
+void SkLiteDL::clipPath(const SkPath& path, SkClipOp op, bool aa) {
     this->push<ClipPath>(0, path, op, aa);
 }
-void SkLiteDL::clipRect(const SkRect& rect, SkCanvas::ClipOp op, bool aa) {
+void SkLiteDL::clipRect(const SkRect& rect, SkClipOp op, bool aa) {
     this->push<ClipRect>(0, rect, op, aa);
 }
-void SkLiteDL::clipRRect(const SkRRect& rrect, SkCanvas::ClipOp op, bool aa) {
+void SkLiteDL::clipRRect(const SkRRect& rrect, SkClipOp op, bool aa) {
     this->push<ClipRRect>(0, rrect, op, aa);
 }
-void SkLiteDL::clipRegion(const SkRegion& region, SkCanvas::ClipOp op) {
+void SkLiteDL::clipRegion(const SkRegion& region, SkClipOp op) {
     this->push<ClipRegion>(0, region, op);
 }
 
index 43988c053b4fa5a9460486a2e79f76eb39905eea..330131f41ec61433bfde22662ea0f833b903ea81 100644 (file)
@@ -43,10 +43,10 @@ public:
     void translate(SkScalar, SkScalar);
     void translateZ(SkScalar);
 
-    void clipPath  (const   SkPath&, SkCanvas::ClipOp, bool aa);
-    void clipRect  (const   SkRect&, SkCanvas::ClipOp, bool aa);
-    void clipRRect (const  SkRRect&, SkCanvas::ClipOp, bool aa);
-    void clipRegion(const SkRegion&, SkCanvas::ClipOp);
+    void clipPath  (const   SkPath&, SkClipOp, bool aa);
+    void clipRect  (const   SkRect&, SkClipOp, bool aa);
+    void clipRRect (const  SkRRect&, SkClipOp, bool aa);
+    void clipRegion(const SkRegion&, SkClipOp);
 
     void drawPaint (const SkPaint&);
     void drawPath  (const SkPath&, const SkPaint&);
index b26547a4620f27cb20eaafe1277558d8319d3c97..9f7ae39e050c1a7a67ae0b7e6954b0fb16238a9c 100644 (file)
@@ -40,19 +40,19 @@ void SkLiteRecorder::didConcat   (const SkMatrix& matrix)   { fDL->   concat(mat
 void SkLiteRecorder::didSetMatrix(const SkMatrix& matrix)   { fDL->setMatrix(matrix); }
 void SkLiteRecorder::didTranslate(SkScalar dx, SkScalar dy) { fDL->translate(dx, dy); }
 
-void SkLiteRecorder::onClipRect(const SkRect& rect, ClipOp op, ClipEdgeStyle style) {
+void SkLiteRecorder::onClipRect(const SkRect& rect, SkClipOp op, ClipEdgeStyle style) {
     fDL->clipRect(rect, op, style==kSoft_ClipEdgeStyle);
     this->INHERITED::onClipRect(rect, op, style);
 }
-void SkLiteRecorder::onClipRRect(const SkRRect& rrect, ClipOp op, ClipEdgeStyle style) {
+void SkLiteRecorder::onClipRRect(const SkRRect& rrect, SkClipOp op, ClipEdgeStyle style) {
     fDL->clipRRect(rrect, op, style==kSoft_ClipEdgeStyle);
     this->INHERITED::onClipRRect(rrect, op, style);
 }
-void SkLiteRecorder::onClipPath(const SkPath& path, ClipOp op, ClipEdgeStyle style) {
+void SkLiteRecorder::onClipPath(const SkPath& path, SkClipOp op, ClipEdgeStyle style) {
     fDL->clipPath(path, op, style==kSoft_ClipEdgeStyle);
     this->INHERITED::onClipPath(path, op, style);
 }
-void SkLiteRecorder::onClipRegion(const SkRegion& region, ClipOp op) {
+void SkLiteRecorder::onClipRegion(const SkRegion& region, SkClipOp op) {
     fDL->clipRegion(region, op);
     this->INHERITED::onClipRegion(region, op);
 }
index 4ffd132862e1d4cc7f13abe139f9412024f14b1b..ad8f26435f129746f1841a667e363b5b2fdc76fd 100644 (file)
@@ -31,10 +31,10 @@ public:
     void didSetMatrix(const SkMatrix&) override;
     void didTranslate(SkScalar, SkScalar) override;
 
-    void onClipRect  (const   SkRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipRRect (const  SkRRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipPath  (const   SkPath&, ClipOp, ClipEdgeStyle) override;
-    void onClipRegion(const SkRegion&, ClipOp) override;
+    void onClipRect  (const   SkRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRRect (const  SkRRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipPath  (const   SkPath&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRegion(const SkRegion&, SkClipOp) override;
 
     void onDrawPaint (const SkPaint&) override;
     void onDrawPath  (const SkPath&, const SkPaint&) override;
index a7a4d94496fa8e6c49026e173aa3e598c83eaf73..62c27e15a1a27cc8ee252f7f0e390f9645888fcb 100644 (file)
@@ -38,7 +38,7 @@ void SkPictureGpuAnalyzer::analyzePicture(const SkPicture* picture) {
     fNumSlowPaths += picture->numSlowPaths();
 }
 
-void SkPictureGpuAnalyzer::analyzeClipPath(const SkPath& path, SkCanvas::ClipOp op, bool doAntiAlias) {
+void SkPictureGpuAnalyzer::analyzeClipPath(const SkPath& path, SkClipOp op, bool doAntiAlias) {
     const SkRecords::ClipPath clipOp = {
         SkIRect::MakeEmpty(), // Willie don't care.
         path,
index beb2dd8338a894001b4a0fa4377216b3cd158666..d5263ca80b0c3594459a00e4f9b40b95b427e18b 100644 (file)
@@ -128,13 +128,13 @@ enum SaveLayerRecFlatFlags {
 // clipparams are packed in 5 bits
 //  doAA:1 | clipOp:4
 
-static inline uint32_t ClipParams_pack(SkCanvas::ClipOp op, bool doAA) {
+static inline uint32_t ClipParams_pack(SkClipOp op, bool doAA) {
     unsigned doAABit = doAA ? 1 : 0;
     return (doAABit << 4) | op;
 }
 
-static inline SkCanvas::ClipOp ClipParams_unpackRegionOp(uint32_t packed) {
-    return (SkCanvas::ClipOp)(packed & 0xF);
+static inline SkClipOp ClipParams_unpackRegionOp(uint32_t packed) {
+    return (SkClipOp)(packed & 0xF);
 }
 
 static inline bool ClipParams_unpackDoAA(uint32_t packed) {
index 0b3dd0e8fd91d59180ae4c0f7326719fbe2750e9..85e5c03cad1b7fce2f6b6c9330f99db5452a29db 100644 (file)
@@ -136,7 +136,7 @@ void SkPicturePlayback::handleOp(SkReadBuffer* reader,
         case CLIP_PATH: {
             const SkPath& path = fPictureData->getPath(reader); 
             uint32_t packed = reader->readInt(); 
-            SkCanvas::ClipOp clipOp = ClipParams_unpackRegionOp(packed);
+            SkClipOp clipOp = ClipParams_unpackRegionOp(packed);
             bool doAA = ClipParams_unpackDoAA(packed);
             size_t offsetToRestore = reader->readInt();
             BREAK_ON_READ_ERROR(reader);
@@ -151,7 +151,7 @@ void SkPicturePlayback::handleOp(SkReadBuffer* reader,
             SkRegion region;
             reader->readRegion(&region);
             uint32_t packed = reader->readInt();
-            SkCanvas::ClipOp clipOp = ClipParams_unpackRegionOp(packed);
+            SkClipOp clipOp = ClipParams_unpackRegionOp(packed);
             size_t offsetToRestore = reader->readInt();
             BREAK_ON_READ_ERROR(reader);
 
@@ -165,7 +165,7 @@ void SkPicturePlayback::handleOp(SkReadBuffer* reader,
             SkRect rect;
             reader->readRect(&rect);
             uint32_t packed = reader->readInt();
-            SkCanvas::ClipOp clipOp = ClipParams_unpackRegionOp(packed);
+            SkClipOp clipOp = ClipParams_unpackRegionOp(packed);
             bool doAA = ClipParams_unpackDoAA(packed);
             size_t offsetToRestore = reader->readInt();
             BREAK_ON_READ_ERROR(reader);
@@ -180,7 +180,7 @@ void SkPicturePlayback::handleOp(SkReadBuffer* reader,
             SkRRect rrect;
             reader->readRRect(&rrect);
             uint32_t packed = reader->readInt();
-            SkCanvas::ClipOp clipOp = ClipParams_unpackRegionOp(packed);
+            SkClipOp clipOp = ClipParams_unpackRegionOp(packed);
             bool doAA = ClipParams_unpackDoAA(packed);
             size_t offsetToRestore = reader->readInt();
             BREAK_ON_READ_ERROR(reader);
index 086eb8dacb0cedfc892d55fbfce894f47f5c2dcf..a0ac76d7a6737c56c604a07943df1c171f1b097c 100644 (file)
@@ -230,18 +230,18 @@ void SkPictureRecord::didTranslateZ(SkScalar z) {
 #endif
 }
 
-static bool clipOpExpands(SkCanvas::ClipOp op) {
+static bool clipOpExpands(SkClipOp op) {
     switch (op) {
-        case SkCanvas::kUnion_Op:
-        case SkCanvas::kXOR_Op:
-        case SkCanvas::kReverseDifference_Op:
-        case SkCanvas::kReplace_Op:
+        case kUnion_SkClipOp:
+        case kXOR_SkClipOp:
+        case kReverseDifference_SkClipOp:
+        case kReplace_SkClipOp:
             return true;
-        case SkCanvas::kIntersect_Op:
-        case SkCanvas::kDifference_Op:
+        case kIntersect_SkClipOp:
+        case kDifference_SkClipOp:
             return false;
         default:
-            SkDEBUGFAIL("unknown region op");
+            SkDEBUGFAIL("unknown clipop");
             return false;
     }
 }
@@ -279,7 +279,7 @@ void SkPictureRecord::endRecording() {
     this->restoreToCount(fInitialSaveCount);
 }
 
-size_t SkPictureRecord::recordRestoreOffsetPlaceholder(ClipOp op) {
+size_t SkPictureRecord::recordRestoreOffsetPlaceholder(SkClipOp op) {
     if (fRestoreOffsetStack.isEmpty()) {
         return -1;
     }
@@ -309,12 +309,12 @@ size_t SkPictureRecord::recordRestoreOffsetPlaceholder(ClipOp op) {
     return offset;
 }
 
-void SkPictureRecord::onClipRect(const SkRect& rect, SkCanvas::ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkPictureRecord::onClipRect(const SkRect& rect, SkClipOp op, ClipEdgeStyle edgeStyle) {
     this->recordClipRect(rect, op, kSoft_ClipEdgeStyle == edgeStyle);
     this->INHERITED::onClipRect(rect, op, edgeStyle);
 }
 
-size_t SkPictureRecord::recordClipRect(const SkRect& rect, SkCanvas::ClipOp op, bool doAA) {
+size_t SkPictureRecord::recordClipRect(const SkRect& rect, SkClipOp op, bool doAA) {
     // id + rect + clip params
     size_t size = 1 * kUInt32Size + sizeof(rect) + 1 * kUInt32Size;
     // recordRestoreOffsetPlaceholder doesn't always write an offset
@@ -331,12 +331,12 @@ size_t SkPictureRecord::recordClipRect(const SkRect& rect, SkCanvas::ClipOp op,
     return offset;
 }
 
-void SkPictureRecord::onClipRRect(const SkRRect& rrect, SkCanvas::ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkPictureRecord::onClipRRect(const SkRRect& rrect, SkClipOp op, ClipEdgeStyle edgeStyle) {
     this->recordClipRRect(rrect, op, kSoft_ClipEdgeStyle == edgeStyle);
     this->INHERITED::onClipRRect(rrect, op, edgeStyle);
 }
 
-size_t SkPictureRecord::recordClipRRect(const SkRRect& rrect, SkCanvas::ClipOp op, bool doAA) {
+size_t SkPictureRecord::recordClipRRect(const SkRRect& rrect, SkClipOp op, bool doAA) {
     // op + rrect + clip params
     size_t size = 1 * kUInt32Size + SkRRect::kSizeInMemory + 1 * kUInt32Size;
     // recordRestoreOffsetPlaceholder doesn't always write an offset
@@ -352,13 +352,13 @@ size_t SkPictureRecord::recordClipRRect(const SkRRect& rrect, SkCanvas::ClipOp o
     return offset;
 }
 
-void SkPictureRecord::onClipPath(const SkPath& path, SkCanvas::ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkPictureRecord::onClipPath(const SkPath& path, SkClipOp op, ClipEdgeStyle edgeStyle) {
     int pathID = this->addPathToHeap(path);
     this->recordClipPath(pathID, op, kSoft_ClipEdgeStyle == edgeStyle);
     this->INHERITED::onClipPath(path, op, edgeStyle);
 }
 
-size_t SkPictureRecord::recordClipPath(int pathID, SkCanvas::ClipOp op, bool doAA) {
+size_t SkPictureRecord::recordClipPath(int pathID, SkClipOp op, bool doAA) {
     // op + path index + clip params
     size_t size = 3 * kUInt32Size;
     // recordRestoreOffsetPlaceholder doesn't always write an offset
@@ -374,12 +374,12 @@ size_t SkPictureRecord::recordClipPath(int pathID, SkCanvas::ClipOp op, bool doA
     return offset;
 }
 
-void SkPictureRecord::onClipRegion(const SkRegion& region, ClipOp op) {
+void SkPictureRecord::onClipRegion(const SkRegion& region, SkClipOp op) {
     this->recordClipRegion(region, op);
     this->INHERITED::onClipRegion(region, op);
 }
 
-size_t SkPictureRecord::recordClipRegion(const SkRegion& region, ClipOp op) {
+size_t SkPictureRecord::recordClipRegion(const SkRegion& region, SkClipOp op) {
     // op + clip params + region
     size_t size = 2 * kUInt32Size + region.writeToMemory(nullptr);
     // recordRestoreOffsetPlaceholder doesn't always write an offset
index ca858a64eba17d62405db175ac7c84aa4c028628..9339d12ba542f4a23d6a6c31c1c3f5f21a421b11 100644 (file)
@@ -76,7 +76,7 @@ protected:
 
 private:
     void handleOptimization(int opt);
-    size_t recordRestoreOffsetPlaceholder(SkCanvas::ClipOp);
+    size_t recordRestoreOffsetPlaceholder(SkClipOp);
     void fillRestoreOffsetPlaceholdersForCurrentStackLevel(uint32_t restoreOffset);
 
     SkTDArray<int32_t> fRestoreOffsetStack;
@@ -204,10 +204,10 @@ protected:
                         const uint16_t indices[], int indexCount,
                         const SkPaint&) override;
 
-    void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipRRect(const SkRRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipPath(const SkPath&, ClipOp, ClipEdgeStyle) override;
-    void onClipRegion(const SkRegion&, ClipOp) override;
+    void onClipRect(const SkRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRRect(const SkRRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipPath(const SkPath&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRegion(const SkRegion&, SkClipOp) override;
 
     void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) override;
 
@@ -230,10 +230,10 @@ protected:
     void recordConcat(const SkMatrix& matrix);
     void recordTranslate(const SkMatrix& matrix);
     void recordScale(const SkMatrix& matrix);
-    size_t recordClipRect(const SkRect& rect, SkCanvas::ClipOp op, bool doAA);
-    size_t recordClipRRect(const SkRRect& rrect, SkCanvas::ClipOp op, bool doAA);
-    size_t recordClipPath(int pathID, SkCanvas::ClipOp op, bool doAA);
-    size_t recordClipRegion(const SkRegion& region, SkCanvas::ClipOp op);
+    size_t recordClipRect(const SkRect& rect, SkClipOp op, bool doAA);
+    size_t recordClipRRect(const SkRRect& rrect, SkClipOp op, bool doAA);
+    size_t recordClipPath(int pathID, SkClipOp op, bool doAA);
+    size_t recordClipRegion(const SkRegion& region, SkClipOp op);
     void recordSave();
     void recordSaveLayer(const SaveLayerRec&);
     void recordRestore(bool fillInSkips = true);
index 4c56d99f45ee04d6667a30952739c95f8aa03094..f4c6b50f0897e501cb4021c131c1f2c2f0d3bfdf 100644 (file)
@@ -404,25 +404,25 @@ void SkRecorder::didTranslateZ(SkScalar z) {
 #endif
 }
 
-void SkRecorder::onClipRect(const SkRect& rect, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkRecorder::onClipRect(const SkRect& rect, SkClipOp op, ClipEdgeStyle edgeStyle) {
     INHERITED(onClipRect, rect, op, edgeStyle);
     SkRecords::ClipOpAndAA opAA(op, kSoft_ClipEdgeStyle == edgeStyle);
     APPEND(ClipRect, this->devBounds(), rect, opAA);
 }
 
-void SkRecorder::onClipRRect(const SkRRect& rrect, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkRecorder::onClipRRect(const SkRRect& rrect, SkClipOp op, ClipEdgeStyle edgeStyle) {
     INHERITED(onClipRRect, rrect, op, edgeStyle);
     SkRecords::ClipOpAndAA opAA(op, kSoft_ClipEdgeStyle == edgeStyle);
     APPEND(ClipRRect, this->devBounds(), rrect, opAA);
 }
 
-void SkRecorder::onClipPath(const SkPath& path, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkRecorder::onClipPath(const SkPath& path, SkClipOp op, ClipEdgeStyle edgeStyle) {
     INHERITED(onClipPath, path, op, edgeStyle);
     SkRecords::ClipOpAndAA opAA(op, kSoft_ClipEdgeStyle == edgeStyle);
     APPEND(ClipPath, this->devBounds(), path, opAA);
 }
 
-void SkRecorder::onClipRegion(const SkRegion& deviceRgn, ClipOp op) {
+void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkClipOp op) {
     INHERITED(onClipRegion, deviceRgn, op);
     APPEND(ClipRegion, this->devBounds(), deviceRgn, op);
 }
index c93ee63430b37abb8fbda0ab1e11b794d8a6b398..c8100761dd2486a78fb00eaf33e81d855ce06676 100644 (file)
@@ -132,10 +132,10 @@ public:
     void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[],
                      int count, SkBlendMode, const SkRect* cull, const SkPaint*) override;
 
-    void onClipRect(const SkRect& rect, ClipOp, ClipEdgeStyle) override;
-    void onClipRRect(const SkRRect& rrect, ClipOp, ClipEdgeStyle) override;
-    void onClipPath(const SkPath& path, ClipOp, ClipEdgeStyle) override;
-    void onClipRegion(const SkRegion& deviceRgn, ClipOp) override;
+    void onClipRect(const SkRect& rect, SkClipOp, ClipEdgeStyle) override;
+    void onClipRRect(const SkRRect& rrect, SkClipOp, ClipEdgeStyle) override;
+    void onClipPath(const SkPath& path, SkClipOp, ClipEdgeStyle) override;
+    void onClipRegion(const SkRegion& deviceRgn, SkClipOp) override;
 
     void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) override;
 
index 0987266bbc95890567467abd22ccf750d2ab685a..82d5156a2871cc84846d38530b96c3762c2cfe30 100644 (file)
@@ -195,7 +195,7 @@ void SkXfermodeImageFilter_Base::drawForeground(SkCanvas* canvas, SkSpecialImage
     }
 
     SkAutoCanvasRestore acr(canvas, true);
-    canvas->clipRect(SkRect::Make(fgBounds), SkCanvas::kDifference_Op);
+    canvas->clipRect(SkRect::Make(fgBounds), kDifference_SkClipOp);
     paint.setColor(0);
     canvas->drawPaint(paint);
 }
index 548f5b7edc954beb538e8e78f6a7978c06387ac9..13e602418dc7c11449ec05e3e5166168627cd037 100644 (file)
@@ -167,10 +167,10 @@ bool GrClipStackClip::UseSWOnlyPath(GrContext* context,
     for (ElementList::Iter iter(reducedClip.elements()); iter.get(); iter.next()) {
         const Element* element = iter.get();
 
-        SkCanvas::ClipOp op = element->getOp();
+        SkClipOp op = element->getOp();
         bool invert = element->isInverseFilled();
         bool needsStencil = invert ||
-                            SkCanvas::kIntersect_Op == op || SkCanvas::kReverseDifference_Op == op;
+                            kIntersect_SkClipOp == op || kReverseDifference_SkClipOp == op;
 
         if (PathNeedsSWRenderer(context, hasUserStencilSettings,
                                 renderTargetContext, translate, element, nullptr, needsStencil)) {
@@ -191,7 +191,7 @@ static bool get_analytic_clip_processor(const ElementList& elements,
     SkSTArray<kMaxAnalyticElements, sk_sp<GrFragmentProcessor>> fps;
     ElementList::Iter iter(elements);
     while (iter.get()) {
-        SkCanvas::ClipOp op = iter.get()->getOp();
+        SkClipOp op = iter.get()->getOp();
         bool invert;
         bool skip = false;
         switch (op) {
@@ -449,14 +449,14 @@ sk_sp<GrTexture> GrClipStackClip::CreateSoftwareClipMask(GrTextureProvider* texP
 
     for (ElementList::Iter iter(reducedClip.elements()); iter.get(); iter.next()) {
         const Element* element = iter.get();
-        SkCanvas::ClipOp op = element->getOp();
+        SkClipOp op = element->getOp();
 
-        if (SkCanvas::kIntersect_Op == op || SkCanvas::kReverseDifference_Op == op) {
+        if (kIntersect_SkClipOp == op || kReverseDifference_SkClipOp == op) {
             // Intersect and reverse difference require modifying pixels outside of the geometry
             // that is being "drawn". In both cases we erase all the pixels outside of the geometry
             // but leave the pixels inside the geometry alone. For reverse difference we invert all
             // the pixels before clearing the ones outside the geometry.
-            if (SkCanvas::kReverseDifference_Op == op) {
+            if (kReverseDifference_SkClipOp == op) {
                 SkRect temp = SkRect::Make(reducedClip.ibounds());
                 // invert the entire scene
                 helper.drawRect(temp, SkRegion::kXOR_Op, false, 0xFF);
index a82048b2f98d026ccd0363a12b862acdad96800d..c5d764d3b76e39a066b721e14cd145ffe0eab957 100644 (file)
@@ -75,7 +75,7 @@ GrReducedClip::GrReducedClip(const SkClipStack& stack, const SkRect& queryBounds
         fHasIBounds = true;
 
         // Implement the clip with an AA rect element.
-        fElements.addToHead(stackBounds, SkCanvas::kReplace_Op, true/*doAA*/);
+        fElements.addToHead(stackBounds, kReplace_SkClipOp, true/*doAA*/);
         fElementsGenID = stack.getTopmostGenID();
         fRequiresAA = true;
 
@@ -147,7 +147,7 @@ void GrReducedClip::walkStack(const SkClipStack& stack, const SkRect& queryBound
         bool isFlip = false; // does this op just flip the in/out state of every point in the bounds
 
         switch (element->getOp()) {
-            case SkCanvas::kDifference_Op:
+            case kDifference_SkClipOp:
                 // check if the shape subtracted either contains the entire bounds (and makes
                 // the clip empty) or is outside the bounds and therefore can be skipped.
                 if (element->isInverseFilled()) {
@@ -173,7 +173,7 @@ void GrReducedClip::walkStack(const SkClipStack& stack, const SkRect& queryBound
                     emsmallens = true;
                 }
                 break;
-            case SkCanvas::kIntersect_Op:
+            case kIntersect_SkClipOp:
                 // check if the shape intersected contains the entire bounds and therefore can
                 // be skipped or it is outside the entire bounds and therefore makes the clip
                 // empty.
@@ -206,7 +206,7 @@ void GrReducedClip::walkStack(const SkClipStack& stack, const SkRect& queryBound
                     emsmallens = true;
                 }
                 break;
-            case SkCanvas::kUnion_Op:
+            case kUnion_SkClipOp:
                 // If the union-ed shape contains the entire bounds then after this element
                 // the bounds is entirely inside the clip. If the union-ed shape is outside the
                 // bounds then this op can be skipped.
@@ -229,7 +229,7 @@ void GrReducedClip::walkStack(const SkClipStack& stack, const SkRect& queryBound
                     embiggens = true;
                 }
                 break;
-            case SkCanvas::kXOR_Op:
+            case kXOR_SkClipOp:
                 // If the bounds is entirely inside the shape being xor-ed then the effect is
                 // to flip the inside/outside state of every point in the bounds. We may be
                 // able to take advantage of this in the forward pass. If the xor-ed shape
@@ -251,7 +251,7 @@ void GrReducedClip::walkStack(const SkClipStack& stack, const SkRect& queryBound
                     emsmallens = embiggens = true;
                 }
                 break;
-            case SkCanvas::kReverseDifference_Op:
+            case kReverseDifference_SkClipOp:
                 // When the bounds is entirely within the rev-diff shape then this behaves like xor
                 // and reverses every point inside the bounds. If the shape is completely outside
                 // the bounds then we know after this element is applied that the bounds will be
@@ -276,7 +276,7 @@ void GrReducedClip::walkStack(const SkClipStack& stack, const SkRect& queryBound
                 }
                 break;
 
-            case SkCanvas::kReplace_Op:
+            case kReplace_SkClipOp:
                 // Replace will always terminate our walk. We will either begin the forward walk
                 // at the replace op or detect here than the shape is either completely inside
                 // or completely outside the bounds. In this latter case it can be skipped by
@@ -326,9 +326,9 @@ void GrReducedClip::walkStack(const SkClipStack& stack, const SkRect& queryBound
 
             // if it is a flip, change it to a bounds-filling rect
             if (isFlip) {
-                SkASSERT(SkCanvas::kXOR_Op == element->getOp() ||
-                         SkCanvas::kReverseDifference_Op == element->getOp());
-                fElements.addToHead(SkRect::Make(fIBounds), SkCanvas::kReverseDifference_Op, false);
+                SkASSERT(kXOR_SkClipOp == element->getOp() ||
+                         kReverseDifference_SkClipOp == element->getOp());
+                fElements.addToHead(SkRect::Make(fIBounds), kReverseDifference_SkClipOp, false);
             } else {
                 Element* newElement = fElements.addToHead(*element);
                 if (newElement->isAA()) {
@@ -337,11 +337,11 @@ void GrReducedClip::walkStack(const SkClipStack& stack, const SkRect& queryBound
                 // Intersecting an inverse shape is the same as differencing the non-inverse shape.
                 // Replacing with an inverse shape is the same as setting initialState=kAllIn and
                 // differencing the non-inverse shape.
-                bool isReplace = SkCanvas::kReplace_Op == newElement->getOp();
+                bool isReplace = kReplace_SkClipOp == newElement->getOp();
                 if (newElement->isInverseFilled() &&
-                    (SkCanvas::kIntersect_Op == newElement->getOp() || isReplace)) {
+                    (kIntersect_SkClipOp == newElement->getOp() || isReplace)) {
                     newElement->invertShapeFillType();
-                    newElement->setOp(SkCanvas::kDifference_Op);
+                    newElement->setOp(kDifference_SkClipOp);
                     if (isReplace) {
                         SkASSERT(InitialTriState::kAllOut == initialTriState);
                         initialTriState = InitialTriState::kAllIn;
@@ -360,36 +360,36 @@ void GrReducedClip::walkStack(const SkClipStack& stack, const SkRect& queryBound
         while (element) {
             bool skippable = false;
             switch (element->getOp()) {
-                case SkCanvas::kDifference_Op:
+                case kDifference_SkClipOp:
                     // subtracting from the empty set yields the empty set.
                     skippable = InitialTriState::kAllOut == initialTriState;
                     break;
-                case SkCanvas::kIntersect_Op:
+                case kIntersect_SkClipOp:
                     // intersecting with the empty set yields the empty set
                     if (InitialTriState::kAllOut == initialTriState) {
                         skippable = true;
                     } else {
                         // We can clear to zero and then simply draw the clip element.
                         initialTriState = InitialTriState::kAllOut;
-                        element->setOp(SkCanvas::kReplace_Op);
+                        element->setOp(kReplace_SkClipOp);
                     }
                     break;
-                case SkCanvas::kUnion_Op:
+                case kUnion_SkClipOp:
                     if (InitialTriState::kAllIn == initialTriState) {
                         // unioning the infinite plane with anything is a no-op.
                         skippable = true;
                     } else {
                         // unioning the empty set with a shape is the shape.
-                        element->setOp(SkCanvas::kReplace_Op);
+                        element->setOp(kReplace_SkClipOp);
                     }
                     break;
-                case SkCanvas::kXOR_Op:
+                case kXOR_SkClipOp:
                     if (InitialTriState::kAllOut == initialTriState) {
                         // xor could be changed to diff in the kAllIn case, not sure it's a win.
-                        element->setOp(SkCanvas::kReplace_Op);
+                        element->setOp(kReplace_SkClipOp);
                     }
                     break;
-                case SkCanvas::kReverseDifference_Op:
+                case kReverseDifference_SkClipOp:
                     if (InitialTriState::kAllIn == initialTriState) {
                         // subtracting the whole plane will yield the empty set.
                         skippable = true;
@@ -402,11 +402,11 @@ void GrReducedClip::walkStack(const SkClipStack& stack, const SkRect& queryBound
                         if (skippable) {
                             initialTriState = InitialTriState::kAllIn;
                         } else {
-                            element->setOp(SkCanvas::kReplace_Op);
+                            element->setOp(kReplace_SkClipOp);
                         }
                     }
                     break;
-                case SkCanvas::kReplace_Op:
+                case kReplace_SkClipOp:
                     skippable = false; // we would have skipped it in the backwards walk if we
                                        // could've.
                     break;
@@ -431,12 +431,12 @@ void GrReducedClip::walkStack(const SkClipStack& stack, const SkRect& queryBound
     fInitialState = static_cast<GrReducedClip::InitialState>(initialTriState);
 }
 
-static bool element_is_pure_subtract(SkCanvas::ClipOp op) {
+static bool element_is_pure_subtract(SkClipOp op) {
     SkASSERT(op >= 0);
-    return op <= SkCanvas::kIntersect_Op;
+    return op <= kIntersect_SkClipOp;
 
-    GR_STATIC_ASSERT(0 == SkCanvas::kDifference_Op);
-    GR_STATIC_ASSERT(1 == SkCanvas::kIntersect_Op);
+    GR_STATIC_ASSERT(0 == kDifference_SkClipOp);
+    GR_STATIC_ASSERT(1 == kIntersect_SkClipOp);
 }
 
 void GrReducedClip::addInteriorWindowRectangles(int maxWindowRectangles) {
@@ -446,7 +446,7 @@ void GrReducedClip::addInteriorWindowRectangles(int maxWindowRectangles) {
     ElementList::Iter iter(fElements, ElementList::Iter::kTail_IterStart);
     for (; iter.get() && element_is_pure_subtract(iter.get()->getOp()); iter.prev()) {
         const Element* element = iter.get();
-        if (SkCanvas::kDifference_Op != element->getOp()) {
+        if (kDifference_SkClipOp != element->getOp()) {
             continue;
         }
 
index c7e39259ce5d3a9ac8c55a2900f0f704b8118d31..d946f48197d55bc091f6ef967d725978060eeecd 100644 (file)
@@ -19,15 +19,15 @@ SkPDFCanvas::~SkPDFCanvas() {}
  *  we intercept all clip calls to ensure that the clip stays BW (i.e. never antialiased), since
  *  an antialiased clip won't build a SkRegion (it builds SkAAClip).
  */
-void SkPDFCanvas::onClipRect(const SkRect& rect, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkPDFCanvas::onClipRect(const SkRect& rect, SkClipOp op, ClipEdgeStyle edgeStyle) {
     this->INHERITED::onClipRect(rect, op, kHard_ClipEdgeStyle);
 }
 
-void SkPDFCanvas::onClipRRect(const SkRRect& rrect, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkPDFCanvas::onClipRRect(const SkRRect& rrect, SkClipOp op, ClipEdgeStyle edgeStyle) {
     this->INHERITED::onClipRRect(rrect, op, kHard_ClipEdgeStyle);
 }
 
-void SkPDFCanvas::onClipPath(const SkPath& path, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkPDFCanvas::onClipPath(const SkPath& path, SkClipOp op, ClipEdgeStyle edgeStyle) {
     this->INHERITED::onClipPath(path, op, kHard_ClipEdgeStyle);
 }
 
index ead13c34a555eabb7fad92afe3b3e4be8e3017a1..7c4d26f714e9ee483bdf9e895c79578a7d31a824 100644 (file)
@@ -17,9 +17,9 @@ public:
     ~SkPDFCanvas();
 
 protected:
-    void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipRRect(const SkRRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipPath(const SkPath&, ClipOp, ClipEdgeStyle) override;
+    void onClipRect(const SkRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRRect(const SkRRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipPath(const SkPath&, SkClipOp, ClipEdgeStyle) override;
 
     void onDrawBitmapNine(const SkBitmap&, const SkIRect&, const SkRect&,
                           const SkPaint*) override;
index 9a70f68c31dfcf5744b5b201fe736942d349ec8c..7d7196bfe823f93aaefce4e1111ad5bd5cb788c2 100644 (file)
@@ -198,9 +198,9 @@ static_assert(SkRegion::kXOR_Op == (int)kXOR_SkPathOp, "region_pathop_mismatch")
 static_assert(SkRegion::kReverseDifference_Op == (int)kReverseDifference_SkPathOp,
               "region_pathop_mismatch");
 
-static SkPathOp region_op_to_pathops_op(SkCanvas::ClipOp op) {
+static SkPathOp region_op_to_pathops_op(SkClipOp op) {
     SkASSERT(op >= 0);
-    SkASSERT(op <= SkCanvas::kReverseDifference_Op);
+    SkASSERT(op <= kReverseDifference_SkClipOp);
     return (SkPathOp)op;
 }
 
@@ -231,7 +231,7 @@ static bool get_clip_stack_path(const SkMatrix& transform,
         }
         entryPath.transform(transform);
 
-        if (SkCanvas::kReplace_Op == clipEntry->getOp()) {
+        if (kReplace_SkClipOp == clipEntry->getOp()) {
             *outClipPath = entryPath;
         } else {
             SkPathOp op = region_op_to_pathops_op(clipEntry->getOp());
@@ -1762,7 +1762,7 @@ SkPDFDevice::ContentEntry* SkPDFDevice::setUpContentEntry(const SkClipStack* cli
             synthesizedClipStack = fExistingClipStack;
             SkPath clipPath;
             clipRegion.getBoundaryPath(&clipPath);
-            synthesizedClipStack.clipPath(clipPath, SkMatrix::I(), SkCanvas::kReplace_Op, false);
+            synthesizedClipStack.clipPath(clipPath, SkMatrix::I(), kReplace_SkClipOp, false);
             clipStack = &synthesizedClipStack;
         }
     }
index 1614bbd6b8873a236545580cec056b02a32c7d8e..33b58a41652c0eda6f6871f4e1daa449d6ed3ae9 100644 (file)
@@ -309,21 +309,21 @@ void SkPipeCanvas::didSetMatrix(const SkMatrix& matrix) {
     this->INHERITED::didSetMatrix(matrix);
 }
 
-void SkPipeCanvas::onClipRect(const SkRect& rect, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkPipeCanvas::onClipRect(const SkRect& rect, SkClipOp op, ClipEdgeStyle edgeStyle) {
     fStream->write32(pack_verb(SkPipeVerb::kClipRect, ((unsigned)op << 1) | edgeStyle));
     fStream->write(&rect, 4 * sizeof(SkScalar));
 
     this->INHERITED::onClipRect(rect, op, edgeStyle);
 }
 
-void SkPipeCanvas::onClipRRect(const SkRRect& rrect, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkPipeCanvas::onClipRRect(const SkRRect& rrect, SkClipOp op, ClipEdgeStyle edgeStyle) {
     fStream->write32(pack_verb(SkPipeVerb::kClipRRect, ((unsigned)op << 1) | edgeStyle));
     write_rrect(fStream, rrect);
 
     this->INHERITED::onClipRRect(rrect, op, edgeStyle);
 }
 
-void SkPipeCanvas::onClipPath(const SkPath& path, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkPipeCanvas::onClipPath(const SkPath& path, SkClipOp op, ClipEdgeStyle edgeStyle) {
     SkPipeWriter writer(this);
     writer.write32(pack_verb(SkPipeVerb::kClipPath, ((unsigned)op << 1) | edgeStyle));
     writer.writePath(path);
@@ -331,7 +331,7 @@ void SkPipeCanvas::onClipPath(const SkPath& path, ClipOp op, ClipEdgeStyle edgeS
     this->INHERITED::onClipPath(path, op, edgeStyle);
 }
 
-void SkPipeCanvas::onClipRegion(const SkRegion& deviceRgn, ClipOp op) {
+void SkPipeCanvas::onClipRegion(const SkRegion& deviceRgn, SkClipOp op) {
     SkPipeWriter writer(this);
     writer.write32(pack_verb(SkPipeVerb::kClipRegion, (unsigned)op << 1));
     writer.writeRegion(deviceRgn);
index e7b99bdd9397ad52ef464e994a2d8e7f78fb5c21..a506da4ece2e28b227cf679ac015ecc7b5a7d6ac 100644 (file)
@@ -142,10 +142,10 @@ protected:
                               const uint16_t indices[], int indexCount,
                               const SkPaint&) override;
 
-    void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipRRect(const SkRRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipPath(const SkPath&, ClipOp, ClipEdgeStyle) override;
-    void onClipRegion(const SkRegion&, ClipOp) override;
+    void onClipRect(const SkRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRRect(const SkRRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipPath(const SkPath&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRegion(const SkRegion&, SkClipOp) override;
 
     void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) override;
     void onDrawAnnotation(const SkRect&, const char[], SkData*) override;
index 2039bf2b3a0859359b1dada1e5237d6053bbef75..6310b15baefe72975f1fb90e1e29c1938ca2a83c 100644 (file)
@@ -271,21 +271,21 @@ static void concat_handler(SkPipeReader& reader, uint32_t packedVerb, SkCanvas*
 
 static void clipRect_handler(SkPipeReader& reader, uint32_t packedVerb, SkCanvas* canvas) {
     SkASSERT(SkPipeVerb::kClipRect == unpack_verb(packedVerb));
-    SkCanvas::ClipOp op = (SkCanvas::ClipOp)(unpack_verb_extra(packedVerb) >> 1);
+    SkClipOp op = (SkClipOp)(unpack_verb_extra(packedVerb) >> 1);
     bool isAA = unpack_verb_extra(packedVerb) & 1;
     canvas->clipRect(*skip<SkRect>(reader), op, isAA);
 }
 
 static void clipRRect_handler(SkPipeReader& reader, uint32_t packedVerb, SkCanvas* canvas) {
     SkASSERT(SkPipeVerb::kClipRRect == unpack_verb(packedVerb));
-    SkCanvas::ClipOp op = (SkCanvas::ClipOp)(unpack_verb_extra(packedVerb) >> 1);
+    SkClipOp op = (SkClipOp)(unpack_verb_extra(packedVerb) >> 1);
     bool isAA = unpack_verb_extra(packedVerb) & 1;
     canvas->clipRRect(read_rrect(reader), op, isAA);
 }
 
 static void clipPath_handler(SkPipeReader& reader, uint32_t packedVerb, SkCanvas* canvas) {
     SkASSERT(SkPipeVerb::kClipPath == unpack_verb(packedVerb));
-    SkCanvas::ClipOp op = (SkCanvas::ClipOp)(unpack_verb_extra(packedVerb) >> 1);
+    SkClipOp op = (SkClipOp)(unpack_verb_extra(packedVerb) >> 1);
     bool isAA = unpack_verb_extra(packedVerb) & 1;
     SkPath path;
     reader.readPath(&path);
@@ -294,7 +294,7 @@ static void clipPath_handler(SkPipeReader& reader, uint32_t packedVerb, SkCanvas
 
 static void clipRegion_handler(SkPipeReader& reader, uint32_t packedVerb, SkCanvas* canvas) {
     SkASSERT(SkPipeVerb::kClipRegion == unpack_verb(packedVerb));
-    SkCanvas::ClipOp op = (SkCanvas::ClipOp)(unpack_verb_extra(packedVerb) >> 1);
+    SkClipOp op = (SkClipOp)(unpack_verb_extra(packedVerb) >> 1);
     SkRegion region;
     reader.readRegion(&region);
     canvas->clipRegion(region, op);
index b9f1424e6ee1801b7777f3246e8d97d13cf6e1b2..b8f8938a179bc3ca3152ed5426193da362adb043 100644 (file)
@@ -731,7 +731,7 @@ void SkSVGDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bm, const S
     SkClipStack adjustedClipStack;
     if (srcOrNull && *srcOrNull != SkRect::Make(bm.bounds())) {
         adjustedClipStack = *draw.fClipStack;
-        adjustedClipStack.clipRect(dst, *draw.fMatrix, SkCanvas::kIntersect_Op,
+        adjustedClipStack.clipRect(dst, *draw.fMatrix, kIntersect_SkClipOp,
                                    paint.isAntiAlias());
         adjustedDraw.fClipStack = &adjustedClipStack;
     }
index 8e4bd375403f4304246ceb918b034ea34fb37fc9..48cc2588a79425a2c726310f4477a6f9128e8c2a 100644 (file)
@@ -77,22 +77,22 @@ void SkCanvasStack::didSetMatrix(const SkMatrix& matrix) {
     this->SkCanvas::didSetMatrix(matrix);
 }
 
-void SkCanvasStack::onClipRect(const SkRect& r, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkCanvasStack::onClipRect(const SkRect& r, SkClipOp op, ClipEdgeStyle edgeStyle) {
     this->INHERITED::onClipRect(r, op, edgeStyle);
     this->clipToZOrderedBounds();
 }
 
-void SkCanvasStack::onClipRRect(const SkRRect& rr, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkCanvasStack::onClipRRect(const SkRRect& rr, SkClipOp op, ClipEdgeStyle edgeStyle) {
     this->INHERITED::onClipRRect(rr, op, edgeStyle);
     this->clipToZOrderedBounds();
 }
 
-void SkCanvasStack::onClipPath(const SkPath& p, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkCanvasStack::onClipPath(const SkPath& p, SkClipOp op, ClipEdgeStyle edgeStyle) {
     this->INHERITED::onClipPath(p, op, edgeStyle);
     this->clipToZOrderedBounds();
 }
 
-void SkCanvasStack::onClipRegion(const SkRegion& deviceRgn, ClipOp op) {
+void SkCanvasStack::onClipRegion(const SkRegion& deviceRgn, SkClipOp op) {
     SkASSERT(fList.count() == fCanvasData.count());
     for (int i = 0; i < fList.count(); ++i) {
         SkRegion tempRegion;
index 0e6e4b6381d6cfa62edd504b3fb8cfafa5f66b7c..73a3386c0f2fd803507ed9df4ffc40b8e0f0c269 100644 (file)
@@ -37,10 +37,10 @@ public:
 protected:
     void didSetMatrix(const SkMatrix&) override;
 
-    void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipRRect(const SkRRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipPath(const SkPath&, ClipOp, ClipEdgeStyle) override;
-    void onClipRegion(const SkRegion&, ClipOp) override;
+    void onClipRect(const SkRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRRect(const SkRRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipPath(const SkPath&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRegion(const SkRegion&, SkClipOp) override;
 
 private:
     void clipToZOrderedBounds();
index d31eaa632ca3e1606909983b90494b23976bae14..19917273c72ceec30c917ffe2236d9428adeea4b 100644 (file)
@@ -135,15 +135,15 @@ public:
     bool failed() { return fFailed; }
 
     // ClipVisitor
-    void clipRect(const SkRect& rect, SkCanvas::ClipOp op, bool antialias) override {
+    void clipRect(const SkRect& rect, SkClipOp op, bool antialias) override {
         fFailed |= antialias;
     }
 
-    void clipRRect(const SkRRect& rrect, SkCanvas::ClipOp op, bool antialias) override {
+    void clipRRect(const SkRRect& rrect, SkClipOp op, bool antialias) override {
         fFailed |= antialias;
     }
 
-    void clipPath(const SkPath&, SkCanvas::ClipOp, bool antialias) override {
+    void clipPath(const SkPath&, SkClipOp, bool antialias) override {
         fFailed |= antialias;
     }
 
@@ -275,7 +275,7 @@ static void setup_canvas_from_MC_state(const SkMCState& state, SkCanvas* canvas)
     }
 
     canvas->setMatrix(matrix);
-    canvas->clipRegion(clip, SkCanvas::kReplace_Op);
+    canvas->clipRegion(clip, kReplace_SkClipOp);
 }
 
 static std::unique_ptr<SkCanvas>
index aad8199864d55948de9e4d47b22149f0c9941411..601f9c9a7a569fdae364fdf414afa9e480b40935 100644 (file)
@@ -111,7 +111,7 @@ void SkDeferredCanvas::emit(const Rec& rec) {
         case kClipRect_Type:
             fCanvas->clipRect(rec.fData.fBounds);
             this->INHERITED::onClipRect(rec.fData.fBounds,
-                                        kIntersect_Op, kHard_ClipEdgeStyle);
+                                        kIntersect_SkClipOp, kHard_ClipEdgeStyle);
             break;
         case kTrans_Type:
         case kScaleTrans_Type: {
@@ -284,8 +284,8 @@ void SkDeferredCanvas::didSetMatrix(const SkMatrix& matrix) {
     this->INHERITED::didSetMatrix(matrix);
 }
 
-void SkDeferredCanvas::onClipRect(const SkRect& rect, ClipOp op, ClipEdgeStyle edgeStyle) {
-    if (kIntersect_Op == op) {
+void SkDeferredCanvas::onClipRect(const SkRect& rect, SkClipOp op, ClipEdgeStyle edgeStyle) {
+    if (kIntersect_SkClipOp == op) {
         this->push_cliprect(rect);
     } else {
         this->flush_all();
@@ -294,19 +294,19 @@ void SkDeferredCanvas::onClipRect(const SkRect& rect, ClipOp op, ClipEdgeStyle e
     }
 }
 
-void SkDeferredCanvas::onClipRRect(const SkRRect& rrect, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkDeferredCanvas::onClipRRect(const SkRRect& rrect, SkClipOp op, ClipEdgeStyle edgeStyle) {
     this->flush_all();
     fCanvas->clipRRect(rrect, op, kSoft_ClipEdgeStyle == edgeStyle);
     this->INHERITED::onClipRRect(rrect, op, edgeStyle);
 }
 
-void SkDeferredCanvas::onClipPath(const SkPath& path, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkDeferredCanvas::onClipPath(const SkPath& path, SkClipOp op, ClipEdgeStyle edgeStyle) {
     this->flush_all();
     fCanvas->clipPath(path, op, kSoft_ClipEdgeStyle == edgeStyle);
     this->INHERITED::onClipPath(path, op, edgeStyle);
 }
 
-void SkDeferredCanvas::onClipRegion(const SkRegion& deviceRgn, ClipOp op) {
+void SkDeferredCanvas::onClipRegion(const SkRegion& deviceRgn, SkClipOp op) {
     this->flush_all();
     fCanvas->clipRegion(deviceRgn, op);
     this->INHERITED::onClipRegion(deviceRgn, op);
index 2549540943dfb77569b8b184e9bdaeda8fa5bc08..af48b20872eb38df70223f02d82d323a627d8bd6 100644 (file)
@@ -94,10 +94,10 @@ protected:
                      const SkRect rects[], const SkColor colors[],
                      int count, SkBlendMode, const SkRect* cull, const SkPaint* paint) override;
 
-    void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipRRect(const SkRRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipPath(const SkPath&, ClipOp, ClipEdgeStyle) override;
-    void onClipRegion(const SkRegion&, ClipOp) override;
+    void onClipRect(const SkRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRRect(const SkRRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipPath(const SkPath&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRegion(const SkRegion&, SkClipOp) override;
 
     void onDrawDrawable(SkDrawable*, const SkMatrix*) override;
     void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) override;
index 9542c9e0ae32d4bc4a9753bb038a002958c21160..658da8185edd6ee3455054417bd8007da0a876c1 100644 (file)
@@ -104,7 +104,7 @@ static void toString(const SkPath& path, SkString* str) {
     }
 }
 
-static const char* toString(SkCanvas::ClipOp op) {
+static const char* toString(SkClipOp op) {
     static const char* gOpNames[] = {
         "DIFF", "SECT", "UNION", "XOR", "RDIFF", "REPLACE"
     };
@@ -257,7 +257,7 @@ const char* SkDumpCanvas::EdgeStyleToAAString(ClipEdgeStyle edgeStyle) {
     return kSoft_ClipEdgeStyle == edgeStyle ? "AA" : "BW";
 }
 
-void SkDumpCanvas::onClipRect(const SkRect& rect, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkDumpCanvas::onClipRect(const SkRect& rect, SkClipOp op, ClipEdgeStyle edgeStyle) {
     SkString str;
     toString(rect, &str);
     this->dump(kClip_Verb, nullptr, "clipRect(%s %s %s)", str.c_str(), toString(op),
@@ -265,7 +265,7 @@ void SkDumpCanvas::onClipRect(const SkRect& rect, ClipOp op, ClipEdgeStyle edgeS
     this->INHERITED::onClipRect(rect, op, edgeStyle);
 }
 
-void SkDumpCanvas::onClipRRect(const SkRRect& rrect, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkDumpCanvas::onClipRRect(const SkRRect& rrect, SkClipOp op, ClipEdgeStyle edgeStyle) {
     SkString str;
     toString(rrect, &str);
     this->dump(kClip_Verb, nullptr, "clipRRect(%s %s %s)", str.c_str(), toString(op),
@@ -273,7 +273,7 @@ void SkDumpCanvas::onClipRRect(const SkRRect& rrect, ClipOp op, ClipEdgeStyle ed
     this->INHERITED::onClipRRect(rrect, op, edgeStyle);
 }
 
-void SkDumpCanvas::onClipPath(const SkPath& path, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkDumpCanvas::onClipPath(const SkPath& path, SkClipOp op, ClipEdgeStyle edgeStyle) {
     SkString str;
     toString(path, &str);
     this->dump(kClip_Verb, nullptr, "clipPath(%s %s %s)", str.c_str(), toString(op),
@@ -281,11 +281,10 @@ void SkDumpCanvas::onClipPath(const SkPath& path, ClipOp op, ClipEdgeStyle edgeS
     this->INHERITED::onClipPath(path, op, edgeStyle);
 }
 
-void SkDumpCanvas::onClipRegion(const SkRegion& deviceRgn, ClipOp op) {
+void SkDumpCanvas::onClipRegion(const SkRegion& deviceRgn, SkClipOp op) {
     SkString str;
     toString(deviceRgn, &str);
-    this->dump(kClip_Verb, nullptr, "clipRegion(%s %s)", str.c_str(),
-               toString(op));
+    this->dump(kClip_Verb, nullptr, "clipRegion(%s %s)", str.c_str(), toString(op));
     this->INHERITED::onClipRegion(deviceRgn, op);
 }
 
index 3949df5b308e29a0875548ef499495ce47f92b96..70f701f54764b2621e69b40aa97a30132171ab6e 100644 (file)
@@ -135,28 +135,28 @@ void SkLuaCanvas::didSetMatrix(const SkMatrix& matrix) {
     this->INHERITED::didSetMatrix(matrix);
 }
 
-void SkLuaCanvas::onClipRect(const SkRect& r, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkLuaCanvas::onClipRect(const SkRect& r, SkClipOp op, ClipEdgeStyle edgeStyle) {
     AUTO_LUA("clipRect");
     lua.pushRect(r, "rect");
     lua.pushBool(kSoft_ClipEdgeStyle == edgeStyle, "aa");
     this->INHERITED::onClipRect(r, op, edgeStyle);
 }
 
-void SkLuaCanvas::onClipRRect(const SkRRect& rrect, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkLuaCanvas::onClipRRect(const SkRRect& rrect, SkClipOp op, ClipEdgeStyle edgeStyle) {
     AUTO_LUA("clipRRect");
     lua.pushRRect(rrect, "rrect");
     lua.pushBool(kSoft_ClipEdgeStyle == edgeStyle, "aa");
     this->INHERITED::onClipRRect(rrect, op, edgeStyle);
 }
 
-void SkLuaCanvas::onClipPath(const SkPath& path, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkLuaCanvas::onClipPath(const SkPath& path, SkClipOp op, ClipEdgeStyle edgeStyle) {
     AUTO_LUA("clipPath");
     lua.pushPath(path, "path");
     lua.pushBool(kSoft_ClipEdgeStyle == edgeStyle, "aa");
     this->INHERITED::onClipPath(path, op, edgeStyle);
 }
 
-void SkLuaCanvas::onClipRegion(const SkRegion& deviceRgn, ClipOp op) {
+void SkLuaCanvas::onClipRegion(const SkRegion& deviceRgn, SkClipOp op) {
     AUTO_LUA("clipRegion");
     this->INHERITED::onClipRegion(deviceRgn, op);
 }
index 3e814d4944800fbb550daacd0a9a2510f9b4cf98..4f51d85f4fd16316091f88bf3498bad3f821d80f 100644 (file)
@@ -96,7 +96,7 @@ void SkNWayCanvas::didSetMatrix(const SkMatrix& matrix) {
     this->INHERITED::didSetMatrix(matrix);
 }
 
-void SkNWayCanvas::onClipRect(const SkRect& rect, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkNWayCanvas::onClipRect(const SkRect& rect, SkClipOp op, ClipEdgeStyle edgeStyle) {
     Iter iter(fList);
     while (iter.next()) {
         iter->clipRect(rect, op, kSoft_ClipEdgeStyle == edgeStyle);
@@ -104,7 +104,7 @@ void SkNWayCanvas::onClipRect(const SkRect& rect, ClipOp op, ClipEdgeStyle edgeS
     this->INHERITED::onClipRect(rect, op, edgeStyle);
 }
 
-void SkNWayCanvas::onClipRRect(const SkRRect& rrect, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkNWayCanvas::onClipRRect(const SkRRect& rrect, SkClipOp op, ClipEdgeStyle edgeStyle) {
     Iter iter(fList);
     while (iter.next()) {
         iter->clipRRect(rrect, op, kSoft_ClipEdgeStyle == edgeStyle);
@@ -112,7 +112,7 @@ void SkNWayCanvas::onClipRRect(const SkRRect& rrect, ClipOp op, ClipEdgeStyle ed
     this->INHERITED::onClipRRect(rrect, op, edgeStyle);
 }
 
-void SkNWayCanvas::onClipPath(const SkPath& path, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkNWayCanvas::onClipPath(const SkPath& path, SkClipOp op, ClipEdgeStyle edgeStyle) {
     Iter iter(fList);
     while (iter.next()) {
         iter->clipPath(path, op, kSoft_ClipEdgeStyle == edgeStyle);
@@ -120,7 +120,7 @@ void SkNWayCanvas::onClipPath(const SkPath& path, ClipOp op, ClipEdgeStyle edgeS
     this->INHERITED::onClipPath(path, op, edgeStyle);
 }
 
-void SkNWayCanvas::onClipRegion(const SkRegion& deviceRgn, ClipOp op) {
+void SkNWayCanvas::onClipRegion(const SkRegion& deviceRgn, SkClipOp op) {
     Iter iter(fList);
     while (iter.next()) {
         iter->clipRegion(deviceRgn, op);
index 98b5d231be55931af172b002467f27e4f5d4e0cf..1547d2f8e09d65c4fc5e3d6751588e9283aaad29 100644 (file)
@@ -44,7 +44,7 @@ void complex_clips_draw(SkCanvas* canvas, int32_t left, int32_t top,
     canvas->drawColor(SK_ColorBLUE);
     canvas->restore();
 
-    canvas->clipRegion(localRegion, (SkCanvas::ClipOp) clipOp);
+    canvas->clipRegion(localRegion, (SkClipOp) clipOp);
     canvas->drawColor(SK_ColorBLUE);
 }
 
index 2c7c5905ef87bacfb69da6ffa052fe6377d5be71..a35fc080d2fbd1a6f820a619a0be73b17d463040 100644 (file)
@@ -299,7 +299,7 @@ DEF_TEST(CanvasState_test_soft_clips, reporter) {
     SkRRect roundRect;
     roundRect.setOval(SkRect::MakeWH(5, 5));
 
-    canvas.clipRRect(roundRect, SkCanvas::kIntersect_Op, true);
+    canvas.clipRRect(roundRect, kIntersect_SkClipOp, true);
 
     SkCanvasState* state = SkCanvasStateUtils::CaptureCanvasState(&canvas);
     REPORTER_ASSERT(reporter, !state);
index f460ab6e3bf4cfd730abc9d5b562cb7669958435..bb34cb657c7a7c23bdd5b5bae265c33a0bbf09a7 100644 (file)
@@ -173,13 +173,13 @@ class Canvas2CanvasClipVisitor : public SkCanvas::ClipVisitor {
 public:
     Canvas2CanvasClipVisitor(SkCanvas* target) : fTarget(target) {}
 
-    void clipRect(const SkRect& r, SkCanvas::ClipOp op, bool aa) override {
+    void clipRect(const SkRect& r, SkClipOp op, bool aa) override {
         fTarget->clipRect(r, op, aa);
     }
-    void clipRRect(const SkRRect& r, SkCanvas::ClipOp op, bool aa) override {
+    void clipRRect(const SkRRect& r, SkClipOp op, bool aa) override {
         fTarget->clipRRect(r, op, aa);
     }
-    void clipPath(const SkPath& p, SkCanvas::ClipOp op, bool aa) override {
+    void clipPath(const SkPath& p, SkClipOp op, bool aa) override {
         fTarget->clipPath(p, op, aa);
     }
 
@@ -299,7 +299,7 @@ SIMPLE_TEST_STEP(Concat, concat(d.fMatrix));
 SIMPLE_TEST_STEP(SetMatrix, setMatrix(d.fMatrix));
 SIMPLE_TEST_STEP(ClipRect, clipRect(d.fRect));
 SIMPLE_TEST_STEP(ClipPath, clipPath(d.fPath));
-SIMPLE_TEST_STEP(ClipRegion, clipRegion(d.fRegion, SkCanvas::kReplace_Op));
+SIMPLE_TEST_STEP(ClipRegion, clipRegion(d.fRegion, kReplace_SkClipOp));
 SIMPLE_TEST_STEP(Clear, clear(d.fColor));
 
 ///////////////////////////////////////////////////////////////////////////////
index fd3e191ee686255cf846212e422c25eb588275d5..e8aae389941aaa85cb88072b02b53216bfc18e25 100644 (file)
@@ -26,7 +26,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrClipBounds, reporter, ctxInfo) {
     // create a clip stack that will (trivially) reduce to a single rect that
     // is larger than the screen
     SkClipStack stack;
-    stack.clipRect(clipRect, SkMatrix::I(), SkCanvas::kReplace_Op, false);
+    stack.clipRect(clipRect, SkMatrix::I(), kReplace_SkClipOp, false);
 
     bool isIntersectionOfRects = true;
     SkRect devStackBounds;
index 247acb06584da240ca272270dbe603257dd960af..bb5cc4ad9e4400e570d8e49717fec1faaf132ad0 100644 (file)
@@ -33,21 +33,21 @@ static void test_assign_and_comparison(skiatest::Reporter* reporter) {
     p.lineTo(7, 8);
     p.lineTo(5, 9);
     p.close();
-    s.clipPath(p, SkMatrix::I(), SkCanvas::kIntersect_Op, doAA);
+    s.clipPath(p, SkMatrix::I(), kIntersect_SkClipOp, doAA);
 
     s.save();
     REPORTER_ASSERT(reporter, 2 == s.getSaveCount());
 
     SkRect r = SkRect::MakeLTRB(1, 2, 3, 4);
-    s.clipRect(r, SkMatrix::I(), SkCanvas::kIntersect_Op, doAA);
+    s.clipRect(r, SkMatrix::I(), kIntersect_SkClipOp, doAA);
     r = SkRect::MakeLTRB(10, 11, 12, 13);
-    s.clipRect(r, SkMatrix::I(), SkCanvas::kIntersect_Op, doAA);
+    s.clipRect(r, SkMatrix::I(), kIntersect_SkClipOp, doAA);
 
     s.save();
     REPORTER_ASSERT(reporter, 3 == s.getSaveCount());
 
     r = SkRect::MakeLTRB(14, 15, 16, 17);
-    s.clipRect(r, SkMatrix::I(), SkCanvas::kUnion_Op, doAA);
+    s.clipRect(r, SkMatrix::I(), kUnion_SkClipOp, doAA);
 
     // Test that assignment works.
     SkClipStack copy = s;
@@ -62,7 +62,7 @@ static void test_assign_and_comparison(skiatest::Reporter* reporter) {
     s.save();
     REPORTER_ASSERT(reporter, 3 == s.getSaveCount());
     r = SkRect::MakeLTRB(14, 15, 16, 17);
-    s.clipRect(r, SkMatrix::I(), SkCanvas::kUnion_Op, doAA);
+    s.clipRect(r, SkMatrix::I(), kUnion_SkClipOp, doAA);
     REPORTER_ASSERT(reporter, s == copy);
 
     // Test that a different op on one level triggers not equal.
@@ -71,7 +71,7 @@ static void test_assign_and_comparison(skiatest::Reporter* reporter) {
     s.save();
     REPORTER_ASSERT(reporter, 3 == s.getSaveCount());
     r = SkRect::MakeLTRB(14, 15, 16, 17);
-    s.clipRect(r, SkMatrix::I(), SkCanvas::kIntersect_Op, doAA);
+    s.clipRect(r, SkMatrix::I(), kIntersect_SkClipOp, doAA);
     REPORTER_ASSERT(reporter, s != copy);
 
     // Test that version constructed with rect-path rather than a rect is still considered equal.
@@ -79,7 +79,7 @@ static void test_assign_and_comparison(skiatest::Reporter* reporter) {
     s.save();
     SkPath rp;
     rp.addRect(r);
-    s.clipPath(rp, SkMatrix::I(), SkCanvas::kUnion_Op, doAA);
+    s.clipPath(rp, SkMatrix::I(), kUnion_SkClipOp, doAA);
     REPORTER_ASSERT(reporter, s == copy);
 
     // Test that different rects triggers not equal.
@@ -89,7 +89,7 @@ static void test_assign_and_comparison(skiatest::Reporter* reporter) {
     REPORTER_ASSERT(reporter, 3 == s.getSaveCount());
 
     r = SkRect::MakeLTRB(24, 25, 26, 27);
-    s.clipRect(r, SkMatrix::I(), SkCanvas::kUnion_Op, doAA);
+    s.clipRect(r, SkMatrix::I(), kUnion_SkClipOp, doAA);
     REPORTER_ASSERT(reporter, s != copy);
 
     // Sanity check
@@ -112,7 +112,7 @@ static void test_assign_and_comparison(skiatest::Reporter* reporter) {
     REPORTER_ASSERT(reporter, 1 == s.getSaveCount());
 
     p.addRect(r);
-    s.clipPath(p, SkMatrix::I(), SkCanvas::kIntersect_Op, doAA);
+    s.clipPath(p, SkMatrix::I(), kIntersect_SkClipOp, doAA);
     REPORTER_ASSERT(reporter, s != copy);
 }
 
@@ -140,7 +140,7 @@ static void test_iterators(skiatest::Reporter* reporter) {
 
     for (size_t i = 0; i < SK_ARRAY_COUNT(gRects); i++) {
         // the union op will prevent these from being fused together
-        stack.clipRect(gRects[i], SkMatrix::I(), SkCanvas::kUnion_Op, false);
+        stack.clipRect(gRects[i], SkMatrix::I(), kUnion_SkClipOp, false);
     }
 
     assert_count(reporter, stack, 4);
@@ -181,7 +181,7 @@ static void test_iterators(skiatest::Reporter* reporter) {
 
         SkClipStack::Iter iter(stack, SkClipStack::Iter::kBottom_IterStart);
 
-        element = iter.skipToTopmost(SkCanvas::kUnion_Op);
+        element = iter.skipToTopmost(kUnion_SkClipOp);
         REPORTER_ASSERT(reporter, SkClipStack::Element::kRect_Type == element->getType());
         REPORTER_ASSERT(reporter, element->getRect() == gRects[3]);
     }
@@ -220,12 +220,12 @@ static void test_bounds(skiatest::Reporter* reporter, SkClipStack::Element::Type
         { 10, 10, 50, 50 },
     };
 
-    static const SkCanvas::ClipOp gOps[] = {
-        SkCanvas::kIntersect_Op,
-        SkCanvas::kDifference_Op,
-        SkCanvas::kUnion_Op,
-        SkCanvas::kXOR_Op,
-        SkCanvas::kReverseDifference_Op
+    static const SkClipOp gOps[] = {
+        kIntersect_SkClipOp,
+        kDifference_SkClipOp,
+        kUnion_SkClipOp,
+        kXOR_SkClipOp,
+        kReverseDifference_SkClipOp
     };
 
     SkRect rectA, rectB;
@@ -265,15 +265,15 @@ static void test_bounds(skiatest::Reporter* reporter, SkClipStack::Element::Type
                     SkDEBUGFAIL("Don't call this with kEmpty.");
                     break;
                 case SkClipStack::Element::kRect_Type:
-                    stack.clipRect(rectA, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+                    stack.clipRect(rectA, SkMatrix::I(), kIntersect_SkClipOp, false);
                     stack.clipRect(rectB, SkMatrix::I(), gOps[op], false);
                     break;
                 case SkClipStack::Element::kRRect_Type:
-                    stack.clipRRect(rrectA, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+                    stack.clipRRect(rrectA, SkMatrix::I(), kIntersect_SkClipOp, false);
                     stack.clipRRect(rrectB, SkMatrix::I(), gOps[op], false);
                     break;
                 case SkClipStack::Element::kPath_Type:
-                    stack.clipPath(pathA, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+                    stack.clipPath(pathA, SkMatrix::I(), kIntersect_SkClipOp, false);
                     stack.clipPath(pathB, SkMatrix::I(), gOps[op], false);
                     break;
             }
@@ -286,7 +286,7 @@ static void test_bounds(skiatest::Reporter* reporter, SkClipStack::Element::Type
 
             if (SkClipStack::Element::kRect_Type == primType) {
                 REPORTER_ASSERT(reporter, isIntersectionOfRects ==
-                        (gOps[op] == SkCanvas::kIntersect_Op));
+                        (gOps[op] == kIntersect_SkClipOp));
             } else {
                 REPORTER_ASSERT(reporter, !isIntersectionOfRects);
             }
@@ -334,8 +334,8 @@ static void test_isWideOpen(skiatest::Reporter* reporter) {
         clipB.addRoundRect(rectB, SkIntToScalar(5), SkIntToScalar(5));
         clipB.setFillType(SkPath::kInverseEvenOdd_FillType);
 
-        stack.clipPath(clipA, SkMatrix::I(), SkCanvas::kReplace_Op, false);
-        stack.clipPath(clipB, SkMatrix::I(), SkCanvas::kUnion_Op, false);
+        stack.clipPath(clipA, SkMatrix::I(), kReplace_SkClipOp, false);
+        stack.clipPath(clipB, SkMatrix::I(), kUnion_SkClipOp, false);
 
         REPORTER_ASSERT(reporter, stack.isWideOpen());
         REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID());
@@ -345,7 +345,7 @@ static void test_isWideOpen(skiatest::Reporter* reporter) {
     {
         SkClipStack stack;
 
-        stack.clipRect(rectA, SkMatrix::I(), SkCanvas::kUnion_Op, false);
+        stack.clipRect(rectA, SkMatrix::I(), kUnion_SkClipOp, false);
 
         REPORTER_ASSERT(reporter, stack.isWideOpen());
         REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID());
@@ -358,7 +358,7 @@ static void test_isWideOpen(skiatest::Reporter* reporter) {
         SkRect emptyRect;
         emptyRect.setEmpty();
 
-        stack.clipRect(emptyRect, SkMatrix::I(), SkCanvas::kDifference_Op, false);
+        stack.clipRect(emptyRect, SkMatrix::I(), kDifference_SkClipOp, false);
 
         REPORTER_ASSERT(reporter, stack.isWideOpen());
         REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID());
@@ -370,7 +370,7 @@ static void test_isWideOpen(skiatest::Reporter* reporter) {
 
         stack.save();
 
-        stack.clipRect(rectA, SkMatrix::I(), SkCanvas::kReplace_Op, false);
+        stack.clipRect(rectA, SkMatrix::I(), kReplace_SkClipOp, false);
 
         REPORTER_ASSERT(reporter, !stack.isWideOpen());
         REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID != stack.getTopmostGenID());
@@ -404,7 +404,7 @@ static void test_rect_inverse_fill(skiatest::Reporter* reporter) {
     path.addRect(rect);
     path.toggleInverseFillType();
     SkClipStack stack;
-    stack.clipPath(path, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+    stack.clipPath(path, SkMatrix::I(), kIntersect_SkClipOp, false);
 
     SkRect bounds;
     SkClipStack::BoundsType boundsType;
@@ -426,9 +426,9 @@ static void test_rect_replace(skiatest::Reporter* reporter) {
     {
         SkClipStack stack;
         REPORTER_ASSERT(reporter, 0 == count(stack));
-        stack.clipRect(rect, SkMatrix::I(), SkCanvas::kReplace_Op, false);
+        stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false);
         REPORTER_ASSERT(reporter, 1 == count(stack));
-        stack.clipRect(rect, SkMatrix::I(), SkCanvas::kReplace_Op, false);
+        stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false);
         REPORTER_ASSERT(reporter, 1 == count(stack));
     }
 
@@ -437,9 +437,9 @@ static void test_rect_replace(skiatest::Reporter* reporter) {
     {
         SkClipStack stack;
         REPORTER_ASSERT(reporter, 0 == count(stack));
-        stack.clipRect(rect, SkMatrix::I(), SkCanvas::kReplace_Op, true);
+        stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, true);
         REPORTER_ASSERT(reporter, 1 == count(stack));
-        stack.clipRect(rect, SkMatrix::I(), SkCanvas::kReplace_Op, true);
+        stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, true);
         REPORTER_ASSERT(reporter, 1 == count(stack));
     }
 
@@ -448,23 +448,23 @@ static void test_rect_replace(skiatest::Reporter* reporter) {
     {
         SkClipStack stack;
         REPORTER_ASSERT(reporter, 0 == count(stack));
-        stack.clipRect(rect, SkMatrix::I(), SkCanvas::kReplace_Op, false);
+        stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false);
         REPORTER_ASSERT(reporter, 1 == count(stack));
-        stack.clipRect(rect, SkMatrix::I(), SkCanvas::kReplace_Op, true);
+        stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, true);
         REPORTER_ASSERT(reporter, 1 == count(stack));
-        stack.clipRect(rect, SkMatrix::I(), SkCanvas::kReplace_Op, false);
+        stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false);
         REPORTER_ASSERT(reporter, 1 == count(stack));
     }
 
     // Make sure replace clip rects don't collapse too much.
     {
         SkClipStack stack;
-        stack.clipRect(rect, SkMatrix::I(), SkCanvas::kReplace_Op, false);
-        stack.clipRect(rect2, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false);
+        stack.clipRect(rect2, SkMatrix::I(), kIntersect_SkClipOp, false);
         REPORTER_ASSERT(reporter, 1 == count(stack));
 
         stack.save();
-        stack.clipRect(rect, SkMatrix::I(), SkCanvas::kReplace_Op, false);
+        stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false);
         REPORTER_ASSERT(reporter, 2 == count(stack));
         stack.getBounds(&bound, &type, &isIntersectionOfRects);
         REPORTER_ASSERT(reporter, bound == rect);
@@ -472,16 +472,16 @@ static void test_rect_replace(skiatest::Reporter* reporter) {
         REPORTER_ASSERT(reporter, 1 == count(stack));
 
         stack.save();
-        stack.clipRect(rect, SkMatrix::I(), SkCanvas::kReplace_Op, false);
-        stack.clipRect(rect, SkMatrix::I(), SkCanvas::kReplace_Op, false);
+        stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false);
+        stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false);
         REPORTER_ASSERT(reporter, 2 == count(stack));
         stack.restore();
         REPORTER_ASSERT(reporter, 1 == count(stack));
 
         stack.save();
-        stack.clipRect(rect, SkMatrix::I(), SkCanvas::kReplace_Op, false);
-        stack.clipRect(rect2, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
-        stack.clipRect(rect, SkMatrix::I(), SkCanvas::kReplace_Op, false);
+        stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false);
+        stack.clipRect(rect2, SkMatrix::I(), kIntersect_SkClipOp, false);
+        stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false);
         REPORTER_ASSERT(reporter, 2 == count(stack));
         stack.restore();
         REPORTER_ASSERT(reporter, 1 == count(stack));
@@ -498,18 +498,18 @@ static void test_path_replace(skiatest::Reporter* reporter) {
     {
         SkClipStack stack;
         REPORTER_ASSERT(reporter, 0 == count(stack));
-        stack.clipPath(path, SkMatrix::I(), SkCanvas::kReplace_Op, false);
+        stack.clipPath(path, SkMatrix::I(), kReplace_SkClipOp, false);
         REPORTER_ASSERT(reporter, 1 == count(stack));
-        stack.clipPath(path, SkMatrix::I(), SkCanvas::kReplace_Op, false);
+        stack.clipPath(path, SkMatrix::I(), kReplace_SkClipOp, false);
         REPORTER_ASSERT(reporter, 1 == count(stack));
     }
 
     // Replacing rect with path.
     {
         SkClipStack stack;
-        stack.clipRect(rect, SkMatrix::I(), SkCanvas::kReplace_Op, true);
+        stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, true);
         REPORTER_ASSERT(reporter, 1 == count(stack));
-        stack.clipPath(path, SkMatrix::I(), SkCanvas::kReplace_Op, true);
+        stack.clipPath(path, SkMatrix::I(), kReplace_SkClipOp, true);
         REPORTER_ASSERT(reporter, 1 == count(stack));
     }
 }
@@ -532,9 +532,9 @@ static void test_rect_merging(skiatest::Reporter* reporter) {
     {
         SkClipStack stack;
 
-        stack.clipRect(overlapLeft, SkMatrix::I(), SkCanvas::kReplace_Op, false);
+        stack.clipRect(overlapLeft, SkMatrix::I(), kReplace_SkClipOp, false);
 
-        stack.clipRect(overlapRight, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipRect(overlapRight, SkMatrix::I(), kIntersect_SkClipOp, false);
 
         REPORTER_ASSERT(reporter, 1 == count(stack));
 
@@ -547,9 +547,9 @@ static void test_rect_merging(skiatest::Reporter* reporter) {
     {
         SkClipStack stack;
 
-        stack.clipRect(overlapLeft, SkMatrix::I(), SkCanvas::kReplace_Op, true);
+        stack.clipRect(overlapLeft, SkMatrix::I(), kReplace_SkClipOp, true);
 
-        stack.clipRect(overlapRight, SkMatrix::I(), SkCanvas::kIntersect_Op, true);
+        stack.clipRect(overlapRight, SkMatrix::I(), kIntersect_SkClipOp, true);
 
         REPORTER_ASSERT(reporter, 1 == count(stack));
 
@@ -562,9 +562,9 @@ static void test_rect_merging(skiatest::Reporter* reporter) {
     {
         SkClipStack stack;
 
-        stack.clipRect(overlapLeft, SkMatrix::I(), SkCanvas::kReplace_Op, true);
+        stack.clipRect(overlapLeft, SkMatrix::I(), kReplace_SkClipOp, true);
 
-        stack.clipRect(overlapRight, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipRect(overlapRight, SkMatrix::I(), kIntersect_SkClipOp, false);
 
         REPORTER_ASSERT(reporter, 2 == count(stack));
 
@@ -577,9 +577,9 @@ static void test_rect_merging(skiatest::Reporter* reporter) {
     {
         SkClipStack stack;
 
-        stack.clipRect(nestedParent, SkMatrix::I(), SkCanvas::kReplace_Op, true);
+        stack.clipRect(nestedParent, SkMatrix::I(), kReplace_SkClipOp, true);
 
-        stack.clipRect(nestedChild, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipRect(nestedChild, SkMatrix::I(), kIntersect_SkClipOp, false);
 
         REPORTER_ASSERT(reporter, 1 == count(stack));
 
@@ -592,9 +592,9 @@ static void test_rect_merging(skiatest::Reporter* reporter) {
     {
         SkClipStack stack;
 
-        stack.clipRect(nestedParent, SkMatrix::I(), SkCanvas::kReplace_Op, false);
+        stack.clipRect(nestedParent, SkMatrix::I(), kReplace_SkClipOp, false);
 
-        stack.clipRect(nestedChild, SkMatrix::I(), SkCanvas::kIntersect_Op, true);
+        stack.clipRect(nestedChild, SkMatrix::I(), kIntersect_SkClipOp, true);
 
         REPORTER_ASSERT(reporter, 1 == count(stack));
 
@@ -607,9 +607,9 @@ static void test_rect_merging(skiatest::Reporter* reporter) {
     {
         SkClipStack stack;
 
-        stack.clipRect(nestedChild, SkMatrix::I(), SkCanvas::kReplace_Op, false);
+        stack.clipRect(nestedChild, SkMatrix::I(), kReplace_SkClipOp, false);
 
-        stack.clipRect(nestedParent, SkMatrix::I(), SkCanvas::kIntersect_Op, true);
+        stack.clipRect(nestedParent, SkMatrix::I(), kIntersect_SkClipOp, true);
 
         REPORTER_ASSERT(reporter, 2 == count(stack));
 
@@ -637,32 +637,32 @@ static void test_quickContains(skiatest::Reporter* reporter) {
 
     {
         SkClipStack stack;
-        stack.clipRect(outsideRect, SkMatrix::I(), SkCanvas::kDifference_Op, false);
-        // return false because quickContains currently does not care for kDifference_Op
+        stack.clipRect(outsideRect, SkMatrix::I(), kDifference_SkClipOp, false);
+        // return false because quickContains currently does not care for kDifference_SkClipOp
         REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
     }
 
     // Replace Op tests
     {
         SkClipStack stack;
-        stack.clipRect(outsideRect, SkMatrix::I(), SkCanvas::kReplace_Op, false);
+        stack.clipRect(outsideRect, SkMatrix::I(), kReplace_SkClipOp, false);
         REPORTER_ASSERT(reporter, true == stack.quickContains(testRect));
     }
 
     {
         SkClipStack stack;
-        stack.clipRect(insideRect, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipRect(insideRect, SkMatrix::I(), kIntersect_SkClipOp, false);
         stack.save(); // To prevent in-place substitution by replace OP
-        stack.clipRect(outsideRect, SkMatrix::I(), SkCanvas::kReplace_Op, false);
+        stack.clipRect(outsideRect, SkMatrix::I(), kReplace_SkClipOp, false);
         REPORTER_ASSERT(reporter, true == stack.quickContains(testRect));
         stack.restore();
     }
 
     {
         SkClipStack stack;
-        stack.clipRect(outsideRect, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipRect(outsideRect, SkMatrix::I(), kIntersect_SkClipOp, false);
         stack.save(); // To prevent in-place substitution by replace OP
-        stack.clipRect(insideRect, SkMatrix::I(), SkCanvas::kReplace_Op, false);
+        stack.clipRect(insideRect, SkMatrix::I(), kReplace_SkClipOp, false);
         REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
         stack.restore();
     }
@@ -670,59 +670,59 @@ static void test_quickContains(skiatest::Reporter* reporter) {
     // Verify proper traversal of multi-element clip
     {
         SkClipStack stack;
-        stack.clipRect(insideRect, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipRect(insideRect, SkMatrix::I(), kIntersect_SkClipOp, false);
         // Use a path for second clip to prevent in-place intersection
-        stack.clipPath(outsideCircle, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipPath(outsideCircle, SkMatrix::I(), kIntersect_SkClipOp, false);
         REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
     }
 
     // Intersect Op tests with rectangles
     {
         SkClipStack stack;
-        stack.clipRect(outsideRect, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipRect(outsideRect, SkMatrix::I(), kIntersect_SkClipOp, false);
         REPORTER_ASSERT(reporter, true == stack.quickContains(testRect));
     }
 
     {
         SkClipStack stack;
-        stack.clipRect(insideRect, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipRect(insideRect, SkMatrix::I(), kIntersect_SkClipOp, false);
         REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
     }
 
     {
         SkClipStack stack;
-        stack.clipRect(intersectingRect, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipRect(intersectingRect, SkMatrix::I(), kIntersect_SkClipOp, false);
         REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
     }
 
     {
         SkClipStack stack;
-        stack.clipRect(nonIntersectingRect, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipRect(nonIntersectingRect, SkMatrix::I(), kIntersect_SkClipOp, false);
         REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
     }
 
     // Intersect Op tests with circle paths
     {
         SkClipStack stack;
-        stack.clipPath(outsideCircle, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipPath(outsideCircle, SkMatrix::I(), kIntersect_SkClipOp, false);
         REPORTER_ASSERT(reporter, true == stack.quickContains(testRect));
     }
 
     {
         SkClipStack stack;
-        stack.clipPath(insideCircle, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipPath(insideCircle, SkMatrix::I(), kIntersect_SkClipOp, false);
         REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
     }
 
     {
         SkClipStack stack;
-        stack.clipPath(intersectingCircle, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipPath(intersectingCircle, SkMatrix::I(), kIntersect_SkClipOp, false);
         REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
     }
 
     {
         SkClipStack stack;
-        stack.clipPath(nonIntersectingCircle, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipPath(nonIntersectingCircle, SkMatrix::I(), kIntersect_SkClipOp, false);
         REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
     }
 
@@ -732,7 +732,7 @@ static void test_quickContains(skiatest::Reporter* reporter) {
         SkPath path;
         path.addRect(outsideRect);
         path.toggleInverseFillType();
-        stack.clipPath(path, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipPath(path, SkMatrix::I(), kIntersect_SkClipOp, false);
         REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
     }
 
@@ -741,7 +741,7 @@ static void test_quickContains(skiatest::Reporter* reporter) {
         SkPath path;
         path.addRect(insideRect);
         path.toggleInverseFillType();
-        stack.clipPath(path, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipPath(path, SkMatrix::I(), kIntersect_SkClipOp, false);
         REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
     }
 
@@ -750,7 +750,7 @@ static void test_quickContains(skiatest::Reporter* reporter) {
         SkPath path;
         path.addRect(intersectingRect);
         path.toggleInverseFillType();
-        stack.clipPath(path, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipPath(path, SkMatrix::I(), kIntersect_SkClipOp, false);
         REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
     }
 
@@ -759,7 +759,7 @@ static void test_quickContains(skiatest::Reporter* reporter) {
         SkPath path;
         path.addRect(nonIntersectingRect);
         path.toggleInverseFillType();
-        stack.clipPath(path, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipPath(path, SkMatrix::I(), kIntersect_SkClipOp, false);
         REPORTER_ASSERT(reporter, true == stack.quickContains(testRect));
     }
 
@@ -768,7 +768,7 @@ static void test_quickContains(skiatest::Reporter* reporter) {
         SkClipStack stack;
         SkPath path = outsideCircle;
         path.toggleInverseFillType();
-        stack.clipPath(path, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipPath(path, SkMatrix::I(), kIntersect_SkClipOp, false);
         REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
     }
 
@@ -776,7 +776,7 @@ static void test_quickContains(skiatest::Reporter* reporter) {
         SkClipStack stack;
         SkPath path = insideCircle;
         path.toggleInverseFillType();
-        stack.clipPath(path, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipPath(path, SkMatrix::I(), kIntersect_SkClipOp, false);
         REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
     }
 
@@ -784,7 +784,7 @@ static void test_quickContains(skiatest::Reporter* reporter) {
         SkClipStack stack;
         SkPath path = intersectingCircle;
         path.toggleInverseFillType();
-        stack.clipPath(path, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipPath(path, SkMatrix::I(), kIntersect_SkClipOp, false);
         REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
     }
 
@@ -792,7 +792,7 @@ static void test_quickContains(skiatest::Reporter* reporter) {
         SkClipStack stack;
         SkPath path = nonIntersectingCircle;
         path.toggleInverseFillType();
-        stack.clipPath(path, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+        stack.clipPath(path, SkMatrix::I(), kIntersect_SkClipOp, false);
         REPORTER_ASSERT(reporter, true == stack.quickContains(testRect));
     }
 }
@@ -820,12 +820,12 @@ static void set_region_to_stack(const SkClipStack& stack, const SkIRect& bounds,
 
 static void test_invfill_diff_bug(skiatest::Reporter* reporter) {
     SkClipStack stack;
-    stack.clipRect({10, 10, 20, 20}, SkMatrix::I(), SkCanvas::kIntersect_Op, false);
+    stack.clipRect({10, 10, 20, 20}, SkMatrix::I(), kIntersect_SkClipOp, false);
 
     SkPath path;
     path.addRect({30, 10, 40, 20});
     path.setFillType(SkPath::kInverseWinding_FillType);
-    stack.clipPath(path, SkMatrix::I(), SkCanvas::kDifference_Op, false);
+    stack.clipPath(path, SkMatrix::I(), kDifference_SkClipOp, false);
 
     REPORTER_ASSERT(reporter, SkClipStack::kEmptyGenID == stack.getTopmostGenID());
 
@@ -851,11 +851,11 @@ static void test_invfill_diff_bug(skiatest::Reporter* reporter) {
 // reduced stack.
 typedef void (*AddElementFunc) (const SkRect& rect,
                                 bool invert,
-                                SkCanvas::ClipOp op,
+                                SkClipOp op,
                                 SkClipStack* stack,
                                 bool doAA);
 
-static void add_round_rect(const SkRect& rect, bool invert, SkCanvas::ClipOp op, SkClipStack* stack,
+static void add_round_rect(const SkRect& rect, bool invert, SkClipOp op, SkClipStack* stack,
                            bool doAA) {
     SkScalar rx = rect.width() / 10;
     SkScalar ry = rect.height() / 20;
@@ -871,7 +871,7 @@ static void add_round_rect(const SkRect& rect, bool invert, SkCanvas::ClipOp op,
     }
 };
 
-static void add_rect(const SkRect& rect, bool invert, SkCanvas::ClipOp op, SkClipStack* stack,
+static void add_rect(const SkRect& rect, bool invert, SkClipOp op, SkClipStack* stack,
                      bool doAA) {
     if (invert) {
         SkPath path;
@@ -883,7 +883,7 @@ static void add_rect(const SkRect& rect, bool invert, SkCanvas::ClipOp op, SkCli
     }
 };
 
-static void add_oval(const SkRect& rect, bool invert, SkCanvas::ClipOp op, SkClipStack* stack,
+static void add_oval(const SkRect& rect, bool invert, SkClipOp op, SkClipStack* stack,
                      bool doAA) {
     SkPath path;
     path.addOval(rect);
@@ -929,13 +929,13 @@ static void test_reduced_clip_stack(skiatest::Reporter* reporter) {
     static const SkScalar kMinElemSizeFrac = SK_Scalar1 / 5;
     static const SkScalar kMaxElemSizeFrac = SK_Scalar1;
 
-    static const SkCanvas::ClipOp kOps[] = {
-        SkCanvas::kDifference_Op,
-        SkCanvas::kIntersect_Op,
-        SkCanvas::kUnion_Op,
-        SkCanvas::kXOR_Op,
-        SkCanvas::kReverseDifference_Op,
-        SkCanvas::kReplace_Op,
+    static const SkClipOp kOps[] = {
+        kDifference_SkClipOp,
+        kIntersect_SkClipOp,
+        kUnion_SkClipOp,
+        kXOR_SkClipOp,
+        kReverseDifference_SkClipOp,
+        kReplace_SkClipOp,
     };
 
     // Replace operations short-circuit the optimizer. We want to make sure that we test this code
@@ -965,8 +965,8 @@ static void test_reduced_clip_stack(skiatest::Reporter* reporter) {
         int numElems = r.nextRangeU(kMinElemsPerTest, kMaxElemsPerTest);
         bool doAA = r.nextBiasedBool(kFractionAntialiased);
         for (int e = 0; e < numElems; ++e) {
-            SkCanvas::ClipOp op = kOps[r.nextULessThan(SK_ARRAY_COUNT(kOps))];
-            if (op == SkCanvas::kReplace_Op) {
+            SkClipOp op = kOps[r.nextULessThan(SK_ARRAY_COUNT(kOps))];
+            if (op == kReplace_SkClipOp) {
                 if (r.nextU() % kReplaceDiv) {
                     --e;
                     continue;
@@ -1051,8 +1051,8 @@ static void test_reduced_clip_stack(skiatest::Reporter* reporter) {
         SkIRect ibounds = reduced->hasIBounds() ? reduced->ibounds() : kIBounds;
 
         // GrReducedClipStack assumes that the final result is clipped to the returned bounds
-        reducedStack.clipDevRect(ibounds, SkCanvas::kIntersect_Op);
-        stack.clipDevRect(ibounds, SkCanvas::kIntersect_Op);
+        reducedStack.clipDevRect(ibounds, kIntersect_SkClipOp);
+        stack.clipDevRect(ibounds, kIntersect_SkClipOp);
 
         // convert both the original stack and reduced stack to SkRegions and see if they're equal
         SkRegion region;
@@ -1076,10 +1076,10 @@ static void test_reduced_clip_stack(skiatest::Reporter* reporter) {
 static void test_reduced_clip_stack_genid(skiatest::Reporter* reporter) {
     {
         SkClipStack stack;
-        stack.clipRect(SkRect::MakeXYWH(0, 0, 100, 100), SkMatrix::I(), SkCanvas::kReplace_Op,
+        stack.clipRect(SkRect::MakeXYWH(0, 0, 100, 100), SkMatrix::I(), kReplace_SkClipOp,
                        true);
         stack.clipRect(SkRect::MakeXYWH(0, 0, SkScalar(50.3), SkScalar(50.3)), SkMatrix::I(),
-                       SkCanvas::kReplace_Op, true);
+                       kReplace_SkClipOp, true);
         SkRect bounds = SkRect::MakeXYWH(0, 0, 100, 100);
 
         SkAlignedSTStorage<1, GrReducedClip> storage;
@@ -1101,16 +1101,16 @@ static void test_reduced_clip_stack_genid(skiatest::Reporter* reporter) {
         //  C  D
 
         stack.clipRect(SkRect::MakeXYWH(0, 0, SkScalar(25.3), SkScalar(25.3)), SkMatrix::I(),
-                       SkCanvas::kReplace_Op, true);
+                       kReplace_SkClipOp, true);
         int32_t genIDA = stack.getTopmostGenID();
         stack.clipRect(SkRect::MakeXYWH(50, 0, SkScalar(25.3), SkScalar(25.3)), SkMatrix::I(),
-                       SkCanvas::kUnion_Op, true);
+                       kUnion_SkClipOp, true);
         int32_t genIDB = stack.getTopmostGenID();
         stack.clipRect(SkRect::MakeXYWH(0, 50, SkScalar(25.3), SkScalar(25.3)), SkMatrix::I(),
-                       SkCanvas::kUnion_Op, true);
+                       kUnion_SkClipOp, true);
         int32_t genIDC = stack.getTopmostGenID();
         stack.clipRect(SkRect::MakeXYWH(50, 50, SkScalar(25.3), SkScalar(25.3)), SkMatrix::I(),
-                       SkCanvas::kUnion_Op, true);
+                       kUnion_SkClipOp, true);
         int32_t genIDD = stack.getTopmostGenID();
 
 
@@ -1189,8 +1189,8 @@ static void test_reduced_clip_stack_genid(skiatest::Reporter* reporter) {
 
 static void test_reduced_clip_stack_no_aa_crash(skiatest::Reporter* reporter) {
     SkClipStack stack;
-    stack.clipDevRect(SkIRect::MakeXYWH(0, 0, 100, 100), SkCanvas::kReplace_Op);
-    stack.clipDevRect(SkIRect::MakeXYWH(0, 0, 50, 50), SkCanvas::kReplace_Op);
+    stack.clipDevRect(SkIRect::MakeXYWH(0, 0, 100, 100), kReplace_SkClipOp);
+    stack.clipDevRect(SkIRect::MakeXYWH(0, 0, 50, 50), kReplace_SkClipOp);
     SkRect bounds = SkRect::MakeXYWH(0, 0, 100, 100);
 
     // At the time, this would crash.
@@ -1290,7 +1290,7 @@ static void test_reduced_clip_stack_aa(skiatest::Reporter* reporter) {
         // Pixel-aligned rect (iior=true).
         name.printf("Pixel-aligned rect test, iter %i", i);
         SkClipStack stack;
-        stack.clipRect(alignedRect, SkMatrix::I(), SkCanvas::kIntersect_Op, true);
+        stack.clipRect(alignedRect, SkMatrix::I(), kIntersect_SkClipOp, true);
         test_aa_query(reporter, name, stack, m, {IL, IT, IR, IB}, ClipMethod::kIgnoreClip);
         test_aa_query(reporter, name, stack, m, {IL, IT-1, IR, IT}, ClipMethod::kSkipDraw);
         test_aa_query(reporter, name, stack, m, {IL, IT-2, IR, IB}, ClipMethod::kScissor);
@@ -1298,7 +1298,7 @@ static void test_reduced_clip_stack_aa(skiatest::Reporter* reporter) {
         // Rect (iior=true).
         name.printf("Rect test, iter %i", i);
         stack.reset();
-        stack.clipRect(rect, SkMatrix::I(), SkCanvas::kIntersect_Op, true);
+        stack.clipRect(rect, SkMatrix::I(), kIntersect_SkClipOp, true);
         test_aa_query(reporter, name, stack, m, {L, T,  R, B}, ClipMethod::kIgnoreClip);
         test_aa_query(reporter, name, stack, m, {L-.1f, T, L, B}, ClipMethod::kSkipDraw);
         test_aa_query(reporter, name, stack, m, {L-.1f, T, L+.1f, B}, ClipMethod::kAAElements, 1);
@@ -1306,7 +1306,7 @@ static void test_reduced_clip_stack_aa(skiatest::Reporter* reporter) {
         // Difference rect (iior=false, inside-out bounds).
         name.printf("Difference rect test, iter %i", i);
         stack.reset();
-        stack.clipRect(rect, SkMatrix::I(), SkCanvas::kDifference_Op, true);
+        stack.clipRect(rect, SkMatrix::I(), kDifference_SkClipOp, true);
         test_aa_query(reporter, name, stack, m, {L, T, R, B}, ClipMethod::kSkipDraw);
         test_aa_query(reporter, name, stack, m, {L, T-.1f, R, T}, ClipMethod::kIgnoreClip);
         test_aa_query(reporter, name, stack, m, {L, T-.1f, R, T+.1f}, ClipMethod::kAAElements, 1);
@@ -1314,8 +1314,8 @@ static void test_reduced_clip_stack_aa(skiatest::Reporter* reporter) {
         // Complex clip (iior=false, normal bounds).
         name.printf("Complex clip test, iter %i", i);
         stack.reset();
-        stack.clipRect(rect, SkMatrix::I(), SkCanvas::kIntersect_Op, true);
-        stack.clipRect(innerRect, SkMatrix::I(), SkCanvas::kXOR_Op, true);
+        stack.clipRect(rect, SkMatrix::I(), kIntersect_SkClipOp, true);
+        stack.clipRect(innerRect, SkMatrix::I(), kXOR_SkClipOp, true);
         test_aa_query(reporter, name, stack, m, {l, t, r, b}, ClipMethod::kSkipDraw);
         test_aa_query(reporter, name, stack, m, {r-.1f, t, R, b}, ClipMethod::kAAElements, 1);
         test_aa_query(reporter, name, stack, m, {r-.1f, t, R+.1f, b}, ClipMethod::kAAElements, 2);
@@ -1326,8 +1326,8 @@ static void test_reduced_clip_stack_aa(skiatest::Reporter* reporter) {
         // Complex clip where outer rect is pixel aligned (iior=false, normal bounds).
         name.printf("Aligned Complex clip test, iter %i", i);
         stack.reset();
-        stack.clipRect(alignedRect, SkMatrix::I(), SkCanvas::kIntersect_Op, true);
-        stack.clipRect(innerRect, SkMatrix::I(), SkCanvas::kXOR_Op, true);
+        stack.clipRect(alignedRect, SkMatrix::I(), kIntersect_SkClipOp, true);
+        stack.clipRect(innerRect, SkMatrix::I(), kXOR_SkClipOp, true);
         test_aa_query(reporter, name, stack, m, {l, t, r, b}, ClipMethod::kSkipDraw);
         test_aa_query(reporter, name, stack, m, {l, b-.1f, r, IB}, ClipMethod::kAAElements, 1);
         test_aa_query(reporter, name, stack, m, {l, b-.1f, r, IB+.1f}, ClipMethod::kAAElements, 1);
@@ -1368,7 +1368,7 @@ DEF_TEST(ClipStack, reporter) {
         { 0, 0, 75, 75 }
     };
     for (size_t i = 0; i < SK_ARRAY_COUNT(gRects); i++) {
-        stack.clipDevRect(gRects[i], SkCanvas::kIntersect_Op);
+        stack.clipDevRect(gRects[i], kIntersect_SkClipOp);
     }
 
     // all of the above rects should have been intersected, leaving only 1 rect
@@ -1379,7 +1379,7 @@ DEF_TEST(ClipStack, reporter) {
 
     REPORTER_ASSERT(reporter, element);
     REPORTER_ASSERT(reporter, SkClipStack::Element::kRect_Type == element->getType());
-    REPORTER_ASSERT(reporter, SkCanvas::kIntersect_Op == element->getOp());
+    REPORTER_ASSERT(reporter, kIntersect_SkClipOp == element->getOp());
     REPORTER_ASSERT(reporter, element->getRect() == answer);
     // now check that we only had one in our iterator
     REPORTER_ASSERT(reporter, !iter.next());
index fc426857e1db21171408d94c54b323c3ff15d5ea..f13e6b331028044f5a7aa536d679afddf18bfb11 100644 (file)
@@ -52,7 +52,7 @@ static bool test_bounds_by_rasterizing(const SkPath& path, const SkRect& bounds)
     SkMatrix matrix;
     matrix.setRectToRect(bounds, clip, SkMatrix::kFill_ScaleToFit);
     clip.outset(SkIntToScalar(kTol), SkIntToScalar(kTol));
-    surface->getCanvas()->clipRect(clip, SkCanvas::kDifference_Op);
+    surface->getCanvas()->clipRect(clip, kDifference_SkClipOp);
     surface->getCanvas()->concat(matrix);
     SkPaint whitePaint;
     whitePaint.setColor(SK_ColorWHITE);
index 8fdf92a8e89b7fdad3bad92ef690e4742eb2fb52..d47165eaf2c4952c2446c8b580ccfce67c7218da 100644 (file)
@@ -287,7 +287,7 @@ static void test_gpu_veto(skiatest::Reporter* reporter) {
         for (int i = 0; i < 50; ++i) {
             canvas->clipPath(convexClip);
             canvas->clipPath(concaveClip);
-            canvas->clipPath(convexClip, SkCanvas::kIntersect_Op, true);
+            canvas->clipPath(convexClip, kIntersect_SkClipOp, true);
             canvas->drawRect(SkRect::MakeWH(100, 100), SkPaint());
         }
     }
@@ -299,7 +299,7 @@ static void test_gpu_veto(skiatest::Reporter* reporter) {
     {
         const SkPath concaveClip = make_concave_path();
         for (int i = 0; i < 50; ++i) {
-            canvas->clipPath(concaveClip, SkCanvas::kIntersect_Op, true);
+            canvas->clipPath(concaveClip, kIntersect_SkClipOp, true);
             canvas->drawRect(SkRect::MakeWH(100, 100), SkPaint());
         }
     }
@@ -398,7 +398,7 @@ static void create_imbalance(SkCanvas* canvas) {
     SkRect clipRect = SkRect::MakeWH(2, 2);
     SkRect drawRect = SkRect::MakeWH(10, 10);
     canvas->save();
-        canvas->clipRect(clipRect, SkCanvas::kReplace_Op);
+        canvas->clipRect(clipRect, kReplace_SkClipOp);
         canvas->translate(1.0f, 1.0f);
         SkPaint p;
         p.setColor(SK_ColorGREEN);
@@ -664,7 +664,7 @@ static void test_clip_bound_opt(skiatest::Reporter* reporter) {
     {
         SkCanvas* canvas = recorder.beginRecording(10, 10);
         canvas->clipPath(path);
-        canvas->clipPath(invPath, SkCanvas::kUnion_Op);
+        canvas->clipPath(invPath, kUnion_SkClipOp);
         bool nonEmpty = canvas->getClipDeviceBounds(&clipBounds);
         REPORTER_ASSERT(reporter, true == nonEmpty);
         REPORTER_ASSERT(reporter, 0 == clipBounds.fLeft);
@@ -674,7 +674,7 @@ static void test_clip_bound_opt(skiatest::Reporter* reporter) {
     }
     {
         SkCanvas* canvas = recorder.beginRecording(10, 10);
-        canvas->clipPath(path, SkCanvas::kDifference_Op);
+        canvas->clipPath(path, kDifference_SkClipOp);
         bool nonEmpty = canvas->getClipDeviceBounds(&clipBounds);
         REPORTER_ASSERT(reporter, true == nonEmpty);
         REPORTER_ASSERT(reporter, 0 == clipBounds.fLeft);
@@ -684,7 +684,7 @@ static void test_clip_bound_opt(skiatest::Reporter* reporter) {
     }
     {
         SkCanvas* canvas = recorder.beginRecording(10, 10);
-        canvas->clipPath(path, SkCanvas::kReverseDifference_Op);
+        canvas->clipPath(path, kReverseDifference_SkClipOp);
         bool nonEmpty = canvas->getClipDeviceBounds(&clipBounds);
         // True clip is actually empty in this case, but the best
         // determination we can make using only bounds as input is that the
@@ -697,8 +697,8 @@ static void test_clip_bound_opt(skiatest::Reporter* reporter) {
     }
     {
         SkCanvas* canvas = recorder.beginRecording(10, 10);
-        canvas->clipPath(path, SkCanvas::kIntersect_Op);
-        canvas->clipPath(path2, SkCanvas::kXOR_Op);
+        canvas->clipPath(path, kIntersect_SkClipOp);
+        canvas->clipPath(path2, kXOR_SkClipOp);
         bool nonEmpty = canvas->getClipDeviceBounds(&clipBounds);
         REPORTER_ASSERT(reporter, true == nonEmpty);
         REPORTER_ASSERT(reporter, 6 == clipBounds.fLeft);
@@ -746,22 +746,22 @@ public:
         , fClipCount(0){
     }
 
-    void onClipRect(const SkRect& r, ClipOp op, ClipEdgeStyle edgeStyle) override {
+    void onClipRect(const SkRect& r, SkClipOp op, ClipEdgeStyle edgeStyle) override {
         fClipCount += 1;
         this->INHERITED::onClipRect(r, op, edgeStyle);
     }
 
-    void onClipRRect(const SkRRect& rrect, ClipOp op, ClipEdgeStyle edgeStyle)override {
+    void onClipRRect(const SkRRect& rrect, SkClipOp op, ClipEdgeStyle edgeStyle)override {
         fClipCount += 1;
         this->INHERITED::onClipRRect(rrect, op, edgeStyle);
     }
 
-    void onClipPath(const SkPath& path, ClipOp op, ClipEdgeStyle edgeStyle) override {
+    void onClipPath(const SkPath& path, SkClipOp op, ClipEdgeStyle edgeStyle) override {
         fClipCount += 1;
         this->INHERITED::onClipPath(path, op, edgeStyle);
     }
 
-    void onClipRegion(const SkRegion& deviceRgn, ClipOp op) override {
+    void onClipRegion(const SkRegion& deviceRgn, SkClipOp op) override {
         fClipCount += 1;
         this->INHERITED::onClipRegion(deviceRgn, op);
     }
@@ -778,9 +778,9 @@ static void test_clip_expansion(skiatest::Reporter* reporter) {
     SkPictureRecorder recorder;
     SkCanvas* canvas = recorder.beginRecording(10, 10);
 
-    canvas->clipRect(SkRect::MakeEmpty(), SkCanvas::kReplace_Op);
+    canvas->clipRect(SkRect::MakeEmpty(), kReplace_SkClipOp);
     // The following expanding clip should not be skipped.
-    canvas->clipRect(SkRect::MakeXYWH(4, 4, 3, 3), SkCanvas::kUnion_Op);
+    canvas->clipRect(SkRect::MakeXYWH(4, 4, 3, 3), kUnion_SkClipOp);
     // Draw something so the optimizer doesn't just fold the world.
     SkPaint p;
     p.setColor(SK_ColorBLUE);
@@ -1134,14 +1134,14 @@ DEF_TEST(PictureGpuAnalyzer, r) {
     const SkPath convexClip = make_convex_path();
     const SkPath concaveClip = make_concave_path();
     for (int i = 0; i < 50; ++i) {
-        analyzer.analyzeClipPath(convexClip, SkCanvas::kIntersect_Op, false);
-        analyzer.analyzeClipPath(convexClip, SkCanvas::kIntersect_Op, true);
-        analyzer.analyzeClipPath(concaveClip, SkCanvas::kIntersect_Op, false);
+        analyzer.analyzeClipPath(convexClip, kIntersect_SkClipOp, false);
+        analyzer.analyzeClipPath(convexClip, kIntersect_SkClipOp, true);
+        analyzer.analyzeClipPath(concaveClip, kIntersect_SkClipOp, false);
     }
     REPORTER_ASSERT(r, analyzer.suitableForGpuRasterization());
 
     for (int i = 0; i < 50; ++i) {
-        analyzer.analyzeClipPath(concaveClip, SkCanvas::kIntersect_Op, true);
+        analyzer.analyzeClipPath(concaveClip, kIntersect_SkClipOp, true);
     }
     REPORTER_ASSERT(r, !analyzer.suitableForGpuRasterization());
 }
index 1550c6d8dd8c8066624190649d5008a87fccae54..71cd8f5fc9bda0b9d6d5214b3228657dfd72cfcb 100644 (file)
@@ -111,7 +111,7 @@ static SkBitmap make_src_bitmap() {
 static void fill_src_canvas(SkCanvas* canvas) {
     canvas->save();
     canvas->setMatrix(SkMatrix::I());
-    canvas->clipRect(DEV_RECT_S, SkCanvas::kReplace_Op);
+    canvas->clipRect(DEV_RECT_S, kReplace_SkClipOp);
     SkPaint paint;
     paint.setBlendMode(SkBlendMode::kSrc);
     canvas->drawBitmap(make_src_bitmap(), 0, 0, &paint);
index f3fccc85422a1f6d47fa819aa8a00852cd143294..96046ccc8abe0441c02af084c45d6985a3813efb 100644 (file)
@@ -13,7 +13,7 @@ DEF_TEST(SkLiteDL_basics, r) {
     sk_sp<SkLiteDL> p { SkLiteDL::New({2,2,3,3}) };
 
     p->save();
-        p->clipRect(SkRect{2,3,4,5}, SkCanvas::kIntersect_Op, true);
+        p->clipRect(SkRect{2,3,4,5}, kIntersect_SkClipOp, true);
         p->drawRect(SkRect{0,0,9,9}, SkPaint{});
     p->restore();
 }
@@ -27,7 +27,7 @@ DEF_TEST(SkLiteRecorder, r) {
     rec.reset(p.get());
 
     c->save();
-        c->clipRect(SkRect{2,3,4,5}, SkCanvas::kIntersect_Op, true);
+        c->clipRect(SkRect{2,3,4,5}, kIntersect_SkClipOp, true);
         c->drawRect(SkRect{0,0,9,9}, SkPaint{});
     c->restore();
 }
index 7916040dbc2a943f22066b2cb9785cda2b67bf9f..2937e0ef004bd666914751f6263bcd2cc1d05740 100644 (file)
@@ -120,7 +120,7 @@ static void fill_canvas(SkCanvas* canvas) {
     }
     canvas->save();
     canvas->setMatrix(SkMatrix::I());
-    canvas->clipRect(DEV_RECT_S, SkCanvas::kReplace_Op);
+    canvas->clipRect(DEV_RECT_S, kReplace_SkClipOp);
     SkPaint paint;
     paint.setBlendMode(SkBlendMode::kSrc);
     canvas->drawBitmap(bmp, 0, 0, &paint);
index eaf72c3c35a4b9d9981e1c992be3a8d34312887f..b02ab59ee8642c35c92757689eb216fc51e18594 100644 (file)
@@ -105,7 +105,7 @@ SkDebugCanvas::SkDebugCanvas(int width, int height)
     SkASSERT(!large.roundOut().isEmpty());
 #endif
     // call the base class' version to avoid adding a draw command
-    this->INHERITED::onClipRect(large, kReplace_Op, kHard_ClipEdgeStyle);
+    this->INHERITED::onClipRect(large, kReplace_SkClipOp, kHard_ClipEdgeStyle);
 }
 
 SkDebugCanvas::~SkDebugCanvas() {
@@ -153,21 +153,21 @@ class SkDebugClipVisitor : public SkCanvas::ClipVisitor {
 public:
     SkDebugClipVisitor(SkCanvas* canvas) : fCanvas(canvas) {}
 
-    void clipRect(const SkRect& r, SkCanvas::ClipOp, bool doAA) override {
+    void clipRect(const SkRect& r, SkClipOp, bool doAA) override {
         SkPaint p;
         p.setColor(SK_ColorRED);
         p.setStyle(SkPaint::kStroke_Style);
         p.setAntiAlias(doAA);
         fCanvas->drawRect(r, p);
     }
-    void clipRRect(const SkRRect& rr, SkCanvas::ClipOp, bool doAA) override {
+    void clipRRect(const SkRRect& rr, SkClipOp, bool doAA) override {
         SkPaint p;
         p.setColor(SK_ColorGREEN);
         p.setStyle(SkPaint::kStroke_Style);
         p.setAntiAlias(doAA);
         fCanvas->drawRRect(rr, p);
     }
-    void clipPath(const SkPath& path, SkCanvas::ClipOp, bool doAA) override {
+    void clipPath(const SkPath& path, SkClipOp, bool doAA) override {
         SkPaint p;
         p.setColor(SK_ColorBLUE);
         p.setStyle(SkPaint::kStroke_Style);
@@ -220,7 +220,7 @@ void SkDebugCanvas::drawTo(SkCanvas* canvas, int index, int m) {
     canvas->clear(SK_ColorWHITE);
     canvas->resetMatrix();
     if (!windowRect.isEmpty()) {
-        canvas->clipRect(windowRect, SkCanvas::kReplace_Op);
+        canvas->clipRect(windowRect, kReplace_SkClipOp);
     }
     this->applyUserTransform(canvas);
 
@@ -280,7 +280,7 @@ void SkDebugCanvas::drawTo(SkCanvas* canvas, int index, int m) {
         canvas->save();
         #define LARGE_COORD 1000000000
         canvas->clipRect(SkRect::MakeLTRB(-LARGE_COORD, -LARGE_COORD, LARGE_COORD, LARGE_COORD),
-                       SkCanvas::kReverseDifference_Op);
+                       kReverseDifference_SkClipOp);
         SkPaint clipPaint;
         clipPaint.setColor(fClipVizColor);
         canvas->drawPaint(clipPaint);
@@ -295,7 +295,7 @@ void SkDebugCanvas::drawTo(SkCanvas* canvas, int index, int m) {
         if (!windowRect.isEmpty()) {
             SkRect r = windowRect;
             r.outset(SK_Scalar1, SK_Scalar1);
-            canvas->clipRect(r, SkCanvas::kReplace_Op);
+            canvas->clipRect(r, kReplace_SkClipOp);
         }
         // visualize existing clips
         SkDebugClipVisitor visitor(canvas);
@@ -316,9 +316,9 @@ void SkDebugCanvas::drawTo(SkCanvas* canvas, int index, int m) {
             if (type != SkClipStack::Element::kEmpty_Type) {
                element->asPath(&operand);
             }
-            SkCanvas::ClipOp elementOp = element->getOp();
+            SkClipOp elementOp = element->getOp();
             this->addClipStackData(devPath, operand, elementOp);
-            if (elementOp == SkCanvas::kReplace_Op) {
+            if (elementOp == kReplace_SkClipOp) {
                 devPath = operand;
             } else {
                 Op(devPath, operand, (SkPathOp) elementOp, &devPath);
@@ -515,19 +515,19 @@ void SkDebugCanvas::overrideTexFiltering(bool overrideTexFiltering, SkFilterQual
     fFilterQuality = quality;
 }
 
-void SkDebugCanvas::onClipPath(const SkPath& path, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkDebugCanvas::onClipPath(const SkPath& path, SkClipOp op, ClipEdgeStyle edgeStyle) {
     this->addDrawCommand(new SkClipPathCommand(path, op, kSoft_ClipEdgeStyle == edgeStyle));
 }
 
-void SkDebugCanvas::onClipRect(const SkRect& rect, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkDebugCanvas::onClipRect(const SkRect& rect, SkClipOp op, ClipEdgeStyle edgeStyle) {
     this->addDrawCommand(new SkClipRectCommand(rect, op, kSoft_ClipEdgeStyle == edgeStyle));
 }
 
-void SkDebugCanvas::onClipRRect(const SkRRect& rrect, ClipOp op, ClipEdgeStyle edgeStyle) {
+void SkDebugCanvas::onClipRRect(const SkRRect& rrect, SkClipOp op, ClipEdgeStyle edgeStyle) {
     this->addDrawCommand(new SkClipRRectCommand(rrect, op, kSoft_ClipEdgeStyle == edgeStyle));
 }
 
-void SkDebugCanvas::onClipRegion(const SkRegion& region, ClipOp op) {
+void SkDebugCanvas::onClipRegion(const SkRegion& region, SkClipOp op) {
     this->addDrawCommand(new SkClipRegionCommand(region, op));
 }
 
@@ -800,8 +800,8 @@ void SkDebugCanvas::addPathData(const SkPath& path, const char* pathName) {
 }
 
 void SkDebugCanvas::addClipStackData(const SkPath& devPath, const SkPath& operand,
-                                     SkCanvas::ClipOp elementOp) {
-    if (elementOp == SkCanvas::kReplace_Op) {
+                                     SkClipOp elementOp) {
+    if (elementOp == kReplace_SkClipOp) {
         if (!lastClipStackData(devPath)) {
             fSaveDevPath = operand;
         }
index 6e7086e6ce2e4881bf38752daf15f1fed5b352fc..b9ef693a0b61389c48f70f44fbe05e80cac83b33 100644 (file)
@@ -248,10 +248,10 @@ protected:
                          const SkPaint*, SrcRectConstraint) override;
     void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
                           const SkPaint*) override;
-    void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipRRect(const SkRRect&, ClipOp, ClipEdgeStyle) override;
-    void onClipPath(const SkPath&, ClipOp, ClipEdgeStyle) override;
-    void onClipRegion(const SkRegion& region, ClipOp) override;
+    void onClipRect(const SkRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRRect(const SkRRect&, SkClipOp, ClipEdgeStyle) override;
+    void onClipPath(const SkPath&, SkClipOp, ClipEdgeStyle) override;
+    void onClipRegion(const SkRegion& region, SkClipOp) override;
 
     void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) override;
 
@@ -308,7 +308,7 @@ private:
 
     void resetClipStackData() { fClipStackData.reset(); fCalledAddStackData = false; }
 
-    void addClipStackData(const SkPath& devPath, const SkPath& operand, ClipOp elementOp);
+    void addClipStackData(const SkPath& devPath, const SkPath& operand, SkClipOp elementOp);
     void addPathData(const SkPath& path, const char* pathName);
     bool lastClipStackData(const SkPath& devPath);
     void outputConicPoints(const SkPoint* pts, SkScalar weight);
index c8eaf98851bf84d0694a3afba353a311a27551d7..6cec6eb6b128cd9ccd133db79953ce18955a94eb 100644 (file)
@@ -584,19 +584,19 @@ Json::Value SkDrawCommand::MakeJsonRegion(const SkRegion& region) {
     return Json::Value("<unimplemented>");
 }
 
-static Json::Value make_json_regionop(SkCanvas::ClipOp op) {
+static Json::Value make_json_regionop(SkClipOp op) {
     switch (op) {
-        case SkCanvas::kDifference_Op:
+        case kDifference_SkClipOp:
             return Json::Value(SKDEBUGCANVAS_REGIONOP_DIFFERENCE);
-        case SkCanvas::kIntersect_Op:
+        case kIntersect_SkClipOp:
             return Json::Value(SKDEBUGCANVAS_REGIONOP_INTERSECT);
-        case SkCanvas::kUnion_Op:
+        case kUnion_SkClipOp:
             return Json::Value(SKDEBUGCANVAS_REGIONOP_UNION);
-        case SkCanvas::kXOR_Op:
+        case kXOR_SkClipOp:
             return Json::Value(SKDEBUGCANVAS_REGIONOP_XOR);
-        case SkCanvas::kReverseDifference_Op:
+        case kReverseDifference_SkClipOp:
             return Json::Value(SKDEBUGCANVAS_REGIONOP_REVERSE_DIFFERENCE);
-        case SkCanvas::kReplace_Op:
+        case kReplace_SkClipOp:
             return Json::Value(SKDEBUGCANVAS_REGIONOP_REPLACE);
         default:
             SkASSERT(false);
@@ -1592,28 +1592,28 @@ static void extract_json_path(Json::Value& path, SkPath* result) {
     }
 }
 
-SkCanvas::ClipOp get_json_clipop(Json::Value& jsonOp) {
+SkClipOp get_json_clipop(Json::Value& jsonOp) {
     const char* op = jsonOp.asCString();
     if (!strcmp(op, SKDEBUGCANVAS_REGIONOP_DIFFERENCE)) {
-        return SkCanvas::kDifference_Op;
+        return kDifference_SkClipOp;
     }
     else if (!strcmp(op, SKDEBUGCANVAS_REGIONOP_INTERSECT)) {
-        return SkCanvas::kIntersect_Op;
+        return kIntersect_SkClipOp;
     }
     else if (!strcmp(op, SKDEBUGCANVAS_REGIONOP_UNION)) {
-        return SkCanvas::kUnion_Op;
+        return kUnion_SkClipOp;
     }
     else if (!strcmp(op, SKDEBUGCANVAS_REGIONOP_XOR)) {
-        return SkCanvas::kXOR_Op;
+        return kXOR_SkClipOp;
     }
     else if (!strcmp(op, SKDEBUGCANVAS_REGIONOP_REVERSE_DIFFERENCE)) {
-        return SkCanvas::kReverseDifference_Op;
+        return kReverseDifference_SkClipOp;
     }
     else if (!strcmp(op, SKDEBUGCANVAS_REGIONOP_REPLACE)) {
-        return SkCanvas::kReplace_Op;
+        return kReplace_SkClipOp;
     }
     SkASSERT(false);
-    return SkCanvas::kIntersect_Op;
+    return kIntersect_SkClipOp;
 }
 
 SkClearCommand::SkClearCommand(SkColor color) : INHERITED(kDrawClear_OpType) {
@@ -1636,7 +1636,7 @@ Json::Value SkClearCommand::toJSON(UrlDataManager& urlDataManager) const {
     return new SkClearCommand(get_json_color(color));
 }
 
-SkClipPathCommand::SkClipPathCommand(const SkPath& path, SkCanvas::ClipOp op, bool doAA)
+SkClipPathCommand::SkClipPathCommand(const SkPath& path, SkClipOp op, bool doAA)
     : INHERITED(kClipPath_OpType) {
     fPath = path;
     fOp = op;
@@ -1672,7 +1672,7 @@ SkClipPathCommand* SkClipPathCommand::fromJSON(Json::Value& command,
                                  command[SKDEBUGCANVAS_ATTRIBUTE_ANTIALIAS].asBool());
 }
 
-SkClipRegionCommand::SkClipRegionCommand(const SkRegion& region, SkCanvas::ClipOp op)
+SkClipRegionCommand::SkClipRegionCommand(const SkRegion& region, SkClipOp op)
     : INHERITED(kClipRegion_OpType) {
     fRegion = region;
     fOp = op;
@@ -1698,7 +1698,7 @@ SkClipRegionCommand* SkClipRegionCommand::fromJSON(Json::Value& command,
     return nullptr;
 }
 
-SkClipRectCommand::SkClipRectCommand(const SkRect& rect, SkCanvas::ClipOp op, bool doAA)
+SkClipRectCommand::SkClipRectCommand(const SkRect& rect, SkClipOp op, bool doAA)
     : INHERITED(kClipRect_OpType) {
     fRect = rect;
     fOp = op;
@@ -1733,7 +1733,7 @@ SkClipRectCommand* SkClipRectCommand::fromJSON(Json::Value& command,
                                  command[SKDEBUGCANVAS_ATTRIBUTE_ANTIALIAS].asBool());
 }
 
-SkClipRRectCommand::SkClipRRectCommand(const SkRRect& rrect, SkCanvas::ClipOp op, bool doAA)
+SkClipRRectCommand::SkClipRRectCommand(const SkRRect& rrect, SkClipOp op, bool doAA)
     : INHERITED(kClipRRect_OpType) {
     fRRect = rrect;
     fOp = op;
index 144c6c560e9dded5220d64dbcc2b4151a4f5b569..880c2aa0860ecc20431be79989b28476e5b4abd5 100644 (file)
@@ -173,69 +173,69 @@ private:
 
 class SkClipPathCommand : public SkDrawCommand {
 public:
-    SkClipPathCommand(const SkPath& path, SkCanvas::ClipOp op, bool doAA);
+    SkClipPathCommand(const SkPath& path, SkClipOp op, bool doAA);
     void execute(SkCanvas* canvas) const override;
     bool render(SkCanvas* canvas) const override;
     Json::Value toJSON(UrlDataManager& urlDataManager) const override;
     static SkClipPathCommand* fromJSON(Json::Value& command, UrlDataManager& urlDataManager);
 
 private:
-    SkPath           fPath;
-    SkCanvas::ClipOp fOp;
-    bool             fDoAA;
+    SkPath   fPath;
+    SkClipOp fOp;
+    bool     fDoAA;
 
     typedef SkDrawCommand INHERITED;
 };
 
 class SkClipRegionCommand : public SkDrawCommand {
 public:
-    SkClipRegionCommand(const SkRegion& region, SkCanvas::ClipOp op);
+    SkClipRegionCommand(const SkRegion& region, SkClipOp op);
     void execute(SkCanvas* canvas) const override;
     Json::Value toJSON(UrlDataManager& urlDataManager) const override;
     static SkClipRegionCommand* fromJSON(Json::Value& command, UrlDataManager& urlDataManager);
 
 private:
-    SkRegion         fRegion;
-    SkCanvas::ClipOp fOp;
+    SkRegion fRegion;
+    SkClipOp fOp;
 
     typedef SkDrawCommand INHERITED;
 };
 
 class SkClipRectCommand : public SkDrawCommand {
 public:
-    SkClipRectCommand(const SkRect& rect, SkCanvas::ClipOp op, bool doAA);
+    SkClipRectCommand(const SkRect& rect, SkClipOp op, bool doAA);
     void execute(SkCanvas* canvas) const override;
     Json::Value toJSON(UrlDataManager& urlDataManager) const override;
     static SkClipRectCommand* fromJSON(Json::Value& command, UrlDataManager& urlDataManager);
 
     const SkRect& rect() const { return fRect; }
-    SkCanvas::ClipOp op() const { return fOp; }
+    SkClipOp op() const { return fOp; }
     bool doAA() const { return fDoAA; }
 
 private:
-    SkRect           fRect;
-    SkCanvas::ClipOp fOp;
-    bool             fDoAA;
+    SkRect   fRect;
+    SkClipOp fOp;
+    bool     fDoAA;
 
     typedef SkDrawCommand INHERITED;
 };
 
 class SkClipRRectCommand : public SkDrawCommand {
 public:
-    SkClipRRectCommand(const SkRRect& rrect, SkCanvas::ClipOp op, bool doAA);
+    SkClipRRectCommand(const SkRRect& rrect, SkClipOp op, bool doAA);
     void execute(SkCanvas* canvas) const override;
     bool render(SkCanvas* canvas) const override;
     Json::Value toJSON(UrlDataManager& urlDataManager) const override;
     static SkClipRRectCommand* fromJSON(Json::Value& command, UrlDataManager& urlDataManager);
 
     const SkRRect& rrect() const { return fRRect; }
-    SkCanvas::ClipOp op() const { return fOp; }
+    SkClipOp op() const { return fOp; }
     bool doAA() const { return fDoAA; }
 
 private:
-    SkRRect          fRRect;
-    SkCanvas::ClipOp fOp;
-    bool             fDoAA;
+    SkRRect  fRRect;
+    SkClipOp fOp;
+    bool     fDoAA;
 
     typedef SkDrawCommand INHERITED;
 };
index 5f0e5f8aa9076f11f97491d49a9257b72a924160..8e3f2390c037d779339ad2d5fcac0a1bee32d4e5 100644 (file)
@@ -313,19 +313,19 @@ SkString* SkObjectParser::RRectToString(const SkRRect& rrect, const char* title)
     return mRRect;
 }
 
-SkString* SkObjectParser::ClipOpToString(SkCanvas::ClipOp op) {
+SkString* SkObjectParser::ClipOpToString(SkClipOp op) {
     SkString* mOp = new SkString("SkRegion::Op: ");
-    if (op == SkCanvas::kDifference_Op) {
+    if (op == kDifference_SkClipOp) {
         mOp->append("kDifference_Op");
-    } else if (op == SkCanvas::kIntersect_Op) {
+    } else if (op == kIntersect_SkClipOp) {
         mOp->append("kIntersect_Op");
-    } else if (op == SkCanvas::kUnion_Op) {
+    } else if (op == kUnion_SkClipOp) {
         mOp->append("kUnion_Op");
-    } else if (op == SkCanvas::kXOR_Op) {
+    } else if (op == kXOR_SkClipOp) {
         mOp->append("kXOR_Op");
-    } else if (op == SkCanvas::kReverseDifference_Op) {
+    } else if (op == kReverseDifference_SkClipOp) {
         mOp->append("kReverseDifference_Op");
-    } else if (op == SkCanvas::kReplace_Op) {
+    } else if (op == kReplace_SkClipOp) {
         mOp->append("kReplace_Op");
     } else {
         mOp->append("Unknown Type");
index 11baf12ec02b0f01a0592e8115bb8f593781d9e8..48051792cbcb183f1d5af99ac1dc23477a453ea0 100644 (file)
@@ -101,7 +101,7 @@ public:
         Returns a string representation of the SkRegion enum.
         @param op  SkRegion::op enum
      */
-    static SkString* ClipOpToString(SkCanvas::ClipOp op);
+    static SkString* ClipOpToString(SkClipOp op);
 
     /**
         Returns a string representation of the SkRegion.