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

Unified Diff: src/gpu/effects/GrConvexPolyEffect.h

Issue 183893023: Unify edge type enums across GrEffect subclasses that clip rendering to a geometry. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: tot again Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/effects/GrBezierEffect.cpp ('k') | src/gpu/effects/GrConvexPolyEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrConvexPolyEffect.h
diff --git a/src/gpu/effects/GrConvexPolyEffect.h b/src/gpu/effects/GrConvexPolyEffect.h
index ab9d313c16d8cecdb3e9708eac4e0924a7062a7f..0e508c7c48772358a5d5a6a0f5ba2d2b1dd4a0e8 100644
--- a/src/gpu/effects/GrConvexPolyEffect.h
+++ b/src/gpu/effects/GrConvexPolyEffect.h
@@ -10,6 +10,7 @@
#include "GrDrawTargetCaps.h"
#include "GrEffect.h"
+#include "GrTypesPriv.h"
class GrGLConvexPolyEffect;
class SkPath;
@@ -21,17 +22,7 @@ class SkPath;
*/
class GrConvexPolyEffect : public GrEffect {
public:
- enum EdgeType {
- kFillNoAA_EdgeType,
- kFillAA_EdgeType,
- kInverseFillNoAA_EdgeType,
- kInverseFillAA_EdgeType,
-
- kLastEdgeType = kInverseFillAA_EdgeType,
- };
-
enum {
- kEdgeTypeCnt = kLastEdgeType + 1,
kMaxEdges = 8,
};
@@ -46,8 +37,8 @@ public:
* have to modify the effect/shaderbuilder interface to make it possible (e.g. give access
* to the view matrix or untransformed positions in the fragment shader).
*/
- static GrEffectRef* Create(EdgeType edgeType, int n, const SkScalar edges[]) {
- if (n <= 0 || n > kMaxEdges) {
+ static GrEffectRef* Create(GrEffectEdgeType edgeType, int n, const SkScalar edges[]) {
+ if (n <= 0 || n > kMaxEdges || kHairlineAA_GrEffectEdgeType == edgeType) {
return NULL;
}
return CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(GrConvexPolyEffect,
@@ -59,18 +50,18 @@ public:
* inverse filled, or has too many edges, this will return NULL. If offset is non-NULL, then
* the path is translated by the vector.
*/
- static GrEffectRef* Create(EdgeType, const SkPath&, const SkVector* offset= NULL);
+ static GrEffectRef* Create(GrEffectEdgeType, const SkPath&, const SkVector* offset = NULL);
/**
* Creates an effect that fills inside the rect with AA edges..
*/
- static GrEffectRef* Create(EdgeType, const SkRect&);
+ static GrEffectRef* Create(GrEffectEdgeType, const SkRect&);
virtual ~GrConvexPolyEffect();
static const char* Name() { return "ConvexPoly"; }
- EdgeType getEdgeType() const { return fEdgeType; }
+ GrEffectEdgeType getEdgeType() const { return fEdgeType; }
int getEdgeCount() const { return fEdgeCount; }
@@ -83,13 +74,13 @@ public:
virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE;
private:
- GrConvexPolyEffect(EdgeType edgeType, int n, const SkScalar edges[]);
+ GrConvexPolyEffect(GrEffectEdgeType edgeType, int n, const SkScalar edges[]);
virtual bool onIsEqual(const GrEffect& other) const SK_OVERRIDE;
- EdgeType fEdgeType;
- int fEdgeCount;
- SkScalar fEdges[3 * kMaxEdges];
+ GrEffectEdgeType fEdgeType;
+ int fEdgeCount;
+ SkScalar fEdges[3 * kMaxEdges];
GR_DECLARE_EFFECT_TEST;
« no previous file with comments | « src/gpu/effects/GrBezierEffect.cpp ('k') | src/gpu/effects/GrConvexPolyEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698