Minor refactoring to remove duplicate enum from Ganesh (_SetOp -> SkRegion::Op)
http://codereview.appspot.com/6116047/
git-svn-id: http://skia.googlecode.com/svn/trunk@3763 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/gpu/GrClip.h b/include/gpu/GrClip.h
index a23f99c..c94755d 100644
--- a/include/gpu/GrClip.h
+++ b/include/gpu/GrClip.h
@@ -60,14 +60,14 @@
return fList[i].fRect;
}
- GrSetOp getOp(int i) const { return fList[i].fOp; }
+ SkRegion::Op getOp(int i) const { return fList[i].fOp; }
bool getDoAA(int i) const { return fList[i].fDoAA; }
bool isRect() const {
if (1 == fList.count() && kRect_ClipType == fList[0].fType &&
- (kIntersect_SetOp == fList[0].fOp ||
- kReplace_SetOp == fList[0].fOp)) {
+ (SkRegion::kIntersect_Op == fList[0].fOp ||
+ SkRegion::kReplace_Op == fList[0].fOp)) {
// if we determined that the clip is a single rect
// we ought to have also used that rect as the bounds.
GrAssert(fConservativeBoundsValid);
@@ -111,12 +111,12 @@
private:
struct Element {
- GrClipType fType;
- GrRect fRect;
- GrPath fPath;
- GrPathFill fPathFill;
- GrSetOp fOp;
- bool fDoAA;
+ GrClipType fType;
+ GrRect fRect;
+ GrPath fPath;
+ GrPathFill fPathFill;
+ SkRegion::Op fOp;
+ bool fDoAA;
bool operator ==(const Element& e) const {
if (e.fType != fType || e.fOp != fOp || e.fDoAA != fDoAA) {
return false;
diff --git a/include/gpu/GrClipIterator.h b/include/gpu/GrClipIterator.h
index a540bb4..4f98c5c 100644
--- a/include/gpu/GrClipIterator.h
+++ b/include/gpu/GrClipIterator.h
@@ -13,6 +13,7 @@
#include "GrPath.h"
#include "GrRect.h"
+#include "SkRegion.h"
/**
* A clip is a list of paths and/or rects with set operations to combine them.
@@ -58,7 +59,7 @@
* Gets the operation used to apply the current item to previously iterated
* items. Iterators should not produce a Replace op.
*/
- virtual GrSetOp getOp() const = 0;
+ virtual SkRegion::Op getOp() const = 0;
/**
* Gets anti-aliasing setting desired for the current clip
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index 0ab7773..e3e5357 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -482,18 +482,6 @@
};
/**
- * Set Operations used to construct clips.
- */
-enum GrSetOp {
- kReplace_SetOp,
- kIntersect_SetOp,
- kUnion_SetOp,
- kXor_SetOp,
- kDifference_SetOp,
- kReverseDifference_SetOp,
-};
-
-/**
* Clips are composed from these objects.
*/
enum GrClipType {
diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h
index 6bc6549..5ad90f4 100644
--- a/include/gpu/SkGr.h
+++ b/include/gpu/SkGr.h
@@ -108,7 +108,7 @@
virtual void rewind() SK_OVERRIDE { this->reset(*fClipStack); }
virtual GrClipType getType() const SK_OVERRIDE;
- virtual GrSetOp getOp() const SK_OVERRIDE;
+ virtual SkRegion::Op getOp() const SK_OVERRIDE;
virtual bool getDoAA() const SK_OVERRIDE;