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

Unified Diff: src/gpu/effects/GrDistanceFieldTextureEffect.cpp

Issue 772513002: create and thread batch tracker object (Closed) Base URL: https://skia.googlesource.com/skia.git@2_vertex_attr
Patch Set: rebase Created 6 years 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/gl/GrGLGeometryProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrDistanceFieldTextureEffect.cpp
diff --git a/src/gpu/effects/GrDistanceFieldTextureEffect.cpp b/src/gpu/effects/GrDistanceFieldTextureEffect.cpp
index 5e1bc9968ce1aecfa23b7f622b034bd0d8ed74a9..53f85907e42fe6bac2fa2b3e9db6279ddb147ede 100755
--- a/src/gpu/effects/GrDistanceFieldTextureEffect.cpp
+++ b/src/gpu/effects/GrDistanceFieldTextureEffect.cpp
@@ -23,7 +23,8 @@
class GrGLDistanceFieldTextureEffect : public GrGLGeometryProcessor {
public:
GrGLDistanceFieldTextureEffect(const GrBackendProcessorFactory& factory,
- const GrProcessor&)
+ const GrGeometryProcessor&,
+ const GrBatchTracker&)
: INHERITED (factory)
, fTextureSize(SkISize::Make(-1,-1))
#ifdef SK_GAMMA_APPLY_TO_A8
@@ -124,10 +125,11 @@ public:
}
virtual void setData(const GrGLProgramDataManager& pdman,
- const GrProcessor& effect) SK_OVERRIDE {
+ const GrGeometryProcessor& proc,
+ const GrBatchTracker&) SK_OVERRIDE {
SkASSERT(fTextureSizeUni.isValid());
- GrTexture* texture = effect.texture(0);
+ GrTexture* texture = proc.texture(0);
if (texture->width() != fTextureSize.width() ||
texture->height() != fTextureSize.height()) {
fTextureSize = SkISize::Make(texture->width(), texture->height());
@@ -137,7 +139,7 @@ public:
}
#ifdef SK_GAMMA_APPLY_TO_A8
const GrDistanceFieldTextureEffect& dfTexEffect =
- effect.cast<GrDistanceFieldTextureEffect>();
+ proc.cast<GrDistanceFieldTextureEffect>();
float luminance = dfTexEffect.getLuminance();
if (luminance != fLuminance) {
pdman.set1f(fLuminanceUni, luminance);
@@ -146,7 +148,9 @@ public:
#endif
}
- static inline void GenKey(const GrProcessor& processor, const GrGLCaps&,
+ static inline void GenKey(const GrGeometryProcessor& processor,
+ const GrBatchTracker&,
+ const GrGLCaps&,
GrProcessorKeyBuilder* b) {
const GrDistanceFieldTextureEffect& dfTexEffect =
processor.cast<GrDistanceFieldTextureEffect>();
@@ -255,7 +259,8 @@ GrGeometryProcessor* GrDistanceFieldTextureEffect::TestCreate(SkRandom* random,
class GrGLDistanceFieldNoGammaTextureEffect : public GrGLGeometryProcessor {
public:
GrGLDistanceFieldNoGammaTextureEffect(const GrBackendProcessorFactory& factory,
- const GrProcessor& effect)
+ const GrGeometryProcessor&,
+ const GrBatchTracker&)
: INHERITED(factory)
, fTextureSize(SkISize::Make(-1, -1)) {}
@@ -338,10 +343,11 @@ public:
}
virtual void setData(const GrGLProgramDataManager& pdman,
- const GrProcessor& effect) SK_OVERRIDE {
+ const GrGeometryProcessor& proc,
+ const GrBatchTracker&) SK_OVERRIDE {
SkASSERT(fTextureSizeUni.isValid());
- GrTexture* texture = effect.texture(0);
+ GrTexture* texture = proc.texture(0);
if (texture->width() != fTextureSize.width() ||
texture->height() != fTextureSize.height()) {
fTextureSize = SkISize::Make(texture->width(), texture->height());
@@ -351,10 +357,12 @@ public:
}
}
- static inline void GenKey(const GrProcessor& effect, const GrGLCaps&,
+ static inline void GenKey(const GrGeometryProcessor& proc,
+ const GrBatchTracker&,
+ const GrGLCaps&,
GrProcessorKeyBuilder* b) {
const GrDistanceFieldNoGammaTextureEffect& dfTexEffect =
- effect.cast<GrDistanceFieldNoGammaTextureEffect>();
+ proc.cast<GrDistanceFieldNoGammaTextureEffect>();
b->add32(dfTexEffect.getFlags());
}
@@ -430,7 +438,8 @@ GrGeometryProcessor* GrDistanceFieldNoGammaTextureEffect::TestCreate(SkRandom* r
class GrGLDistanceFieldLCDTextureEffect : public GrGLGeometryProcessor {
public:
GrGLDistanceFieldLCDTextureEffect(const GrBackendProcessorFactory& factory,
- const GrProcessor&)
+ const GrGeometryProcessor&,
+ const GrBatchTracker&)
: INHERITED (factory)
, fTextureSize(SkISize::Make(-1,-1))
, fTextColor(GrColor_ILLEGAL) {}
@@ -563,7 +572,8 @@ public:
}
virtual void setData(const GrGLProgramDataManager& pdman,
- const GrProcessor& processor) SK_OVERRIDE {
+ const GrGeometryProcessor& processor,
+ const GrBatchTracker&) SK_OVERRIDE {
SkASSERT(fTextureSizeUni.isValid());
SkASSERT(fTextColorUni.isValid());
@@ -594,7 +604,9 @@ public:
}
}
- static inline void GenKey(const GrProcessor& processor, const GrGLCaps&,
+ static inline void GenKey(const GrGeometryProcessor& processor,
+ const GrBatchTracker&,
+ const GrGLCaps&,
GrProcessorKeyBuilder* b) {
const GrDistanceFieldLCDTextureEffect& dfTexEffect =
processor.cast<GrDistanceFieldLCDTextureEffect>();
« no previous file with comments | « src/gpu/effects/GrDashingEffect.cpp ('k') | src/gpu/gl/GrGLGeometryProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698