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

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

Issue 1139723004: Preliminary attempt to remove batch tracker (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup5
Patch Set: tweaks Created 5 years, 7 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/GrDashingEffect.cpp ('k') | src/gpu/effects/GrDistanceFieldGeoProc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrDistanceFieldGeoProc.h
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.h b/src/gpu/effects/GrDistanceFieldGeoProc.h
index ec661cedb8848254b22bf2c23efc29fa2038a84c..42c397dd6cb601dc56cf5ab893faa24074dbf06a 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.h
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.h
@@ -49,15 +49,16 @@ public:
#ifdef SK_GAMMA_APPLY_TO_A8
static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix,
GrTexture* tex, const GrTextureParams& params,
- float lum, uint32_t flags) {
+ float lum, uint32_t flags, bool usesLocalCoords) {
return SkNEW_ARGS(GrDistanceFieldA8TextGeoProc, (color, viewMatrix, tex, params, lum,
- flags));
+ flags, usesLocalCoords));
}
#else
static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix,
GrTexture* tex, const GrTextureParams& params,
- uint32_t flags) {
- return SkNEW_ARGS(GrDistanceFieldA8TextGeoProc, (color, viewMatrix, tex, params, flags));
+ uint32_t flags, bool usesLocalCoords) {
+ return SkNEW_ARGS(GrDistanceFieldA8TextGeoProc, (color, viewMatrix, tex, params, flags,
+ usesLocalCoords));
}
#endif
@@ -69,7 +70,10 @@ public:
const Attribute* inColor() const { return fInColor; }
const Attribute* inTextureCoords() const { return fInTextureCoords; }
GrColor color() const { return fColor; }
+ bool colorIgnored() const { return GrColor_ILLEGAL == fColor; }
+ bool hasVertexColor() const { return SkToBool(fInColor); }
const SkMatrix& viewMatrix() const { return fViewMatrix; }
+ bool usesLocalCoords() const { return fUsesLocalCoords; }
#ifdef SK_GAMMA_APPLY_TO_A8
float getDistanceAdjust() const { return fDistanceAdjust; }
#endif
@@ -82,15 +86,13 @@ public:
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
const GrGLSLCaps&) const override;
- void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const override;
-
private:
GrDistanceFieldA8TextGeoProc(GrColor, const SkMatrix& viewMatrix,
GrTexture* texture, const GrTextureParams& params,
#ifdef SK_GAMMA_APPLY_TO_A8
float distanceAdjust,
#endif
- uint32_t flags);
+ uint32_t flags, bool usesLocalCoords);
GrColor fColor;
SkMatrix fViewMatrix;
@@ -102,6 +104,7 @@ private:
const Attribute* fInPosition;
const Attribute* fInColor;
const Attribute* fInTextureCoords;
+ bool fUsesLocalCoords;
GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
@@ -119,8 +122,9 @@ class GrDistanceFieldPathGeoProc : public GrGeometryProcessor {
public:
static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix, GrTexture* tex,
const GrTextureParams& params,
- uint32_t flags) {
- return SkNEW_ARGS(GrDistanceFieldPathGeoProc, (color, viewMatrix, tex, params, flags));
+ uint32_t flags, bool usesLocalCoords) {
+ return SkNEW_ARGS(GrDistanceFieldPathGeoProc, (color, viewMatrix, tex, params, flags,
+ usesLocalCoords));
}
virtual ~GrDistanceFieldPathGeoProc() {}
@@ -131,8 +135,11 @@ public:
const Attribute* inColor() const { return fInColor; }
const Attribute* inTextureCoords() const { return fInTextureCoords; }
GrColor color() const { return fColor; }
+ bool colorIgnored() const { return GrColor_ILLEGAL == fColor; }
+ bool hasVertexColor() const { return SkToBool(fInColor); }
const SkMatrix& viewMatrix() const { return fViewMatrix; }
uint32_t getFlags() const { return fFlags; }
+ bool usesLocalCoords() const { return fUsesLocalCoords; }
virtual void getGLProcessorKey(const GrBatchTracker& bt,
const GrGLSLCaps& caps,
@@ -141,11 +148,10 @@ public:
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
const GrGLSLCaps&) const override;
- void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const override;
-
private:
GrDistanceFieldPathGeoProc(GrColor, const SkMatrix& viewMatrix, GrTexture* texture,
- const GrTextureParams& params, uint32_t flags);
+ const GrTextureParams& params, uint32_t flags,
+ bool usesLocalCoords);
GrColor fColor;
SkMatrix fViewMatrix;
@@ -154,6 +160,7 @@ private:
const Attribute* fInPosition;
const Attribute* fInColor;
const Attribute* fInTextureCoords;
+ bool fUsesLocalCoords;
GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
@@ -185,9 +192,10 @@ public:
static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix,
GrTexture* tex, const GrTextureParams& params,
- DistanceAdjust distanceAdjust, uint32_t flags) {
+ DistanceAdjust distanceAdjust, uint32_t flags,
+ bool usesLocalCoords) {
return SkNEW_ARGS(GrDistanceFieldLCDTextGeoProc,
- (color, viewMatrix, tex, params, distanceAdjust, flags));
+ (color, viewMatrix, tex, params, distanceAdjust, flags, usesLocalCoords));
}
virtual ~GrDistanceFieldLCDTextGeoProc() {}
@@ -198,8 +206,10 @@ public:
const Attribute* inTextureCoords() const { return fInTextureCoords; }
DistanceAdjust getDistanceAdjust() const { return fDistanceAdjust; }
GrColor color() const { return fColor; }
+ bool colorIgnored() const { return GrColor_ILLEGAL == fColor; }
const SkMatrix& viewMatrix() const { return fViewMatrix; }
uint32_t getFlags() const { return fFlags; }
+ bool usesLocalCoords() const { return fUsesLocalCoords; }
virtual void getGLProcessorKey(const GrBatchTracker& bt,
const GrGLSLCaps& caps,
@@ -208,12 +218,11 @@ public:
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
const GrGLSLCaps&) const override;
- void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const override;
-
private:
GrDistanceFieldLCDTextGeoProc(GrColor, const SkMatrix& viewMatrix,
GrTexture* texture, const GrTextureParams& params,
- DistanceAdjust wa, uint32_t flags);
+ DistanceAdjust wa, uint32_t flags,
+ bool usesLocalCoords);
GrColor fColor;
SkMatrix fViewMatrix;
@@ -222,6 +231,7 @@ private:
uint32_t fFlags;
const Attribute* fInPosition;
const Attribute* fInTextureCoords;
+ bool fUsesLocalCoords;
GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
« no previous file with comments | « src/gpu/effects/GrDashingEffect.cpp ('k') | src/gpu/effects/GrDistanceFieldGeoProc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698