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

Unified Diff: src/core/SkXfermode.cpp

Issue 571163002: removing GrDrawEffect (Closed) Base URL: https://skia.googlesource.com/skia.git@gp3
Patch Set: rebase after revert Created 6 years, 3 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 | « include/gpu/GrTBackendEffectFactory.h ('k') | src/effects/SkAlphaThresholdFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkXfermode.cpp
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp
index 91aa84706bd00cf53b9aaadbaf25714bc3f27d18..db9d332e795c824d9de6abc4e7a6edf670cdef8d 100644
--- a/src/core/SkXfermode.cpp
+++ b/src/core/SkXfermode.cpp
@@ -818,18 +818,19 @@ public:
class GLEffect : public GrGLEffect {
public:
- GLEffect(const GrBackendEffectFactory& factory, const GrDrawEffect&)
+ GLEffect(const GrBackendEffectFactory& factory, const GrEffect&)
: GrGLEffect(factory) {
}
virtual void emitCode(GrGLProgramBuilder* builder,
- const GrDrawEffect& drawEffect,
+ const GrEffect& effect,
const GrEffectKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
const TextureSamplerArray& samplers) SK_OVERRIDE {
- SkXfermode::Mode mode = drawEffect.castEffect<XferEffect>().mode();
- const GrTexture* backgroundTex = drawEffect.castEffect<XferEffect>().backgroundAccess().getTexture();
+ SkXfermode::Mode mode = effect.cast<XferEffect>().mode();
+ const GrTexture* backgroundTex =
+ effect.cast<XferEffect>().backgroundAccess().getTexture();
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
const char* dstColor;
if (backgroundTex) {
@@ -970,12 +971,12 @@ public:
}
}
- static inline void GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&,
+ static inline void GenKey(const GrEffect& effect, const GrGLCaps&,
GrEffectKeyBuilder* b) {
// The background may come from the dst or from a texture.
- uint32_t key = drawEffect.effect()->numTextures();
+ uint32_t key = effect.numTextures();
SkASSERT(key <= 1);
- key |= drawEffect.castEffect<XferEffect>().mode() << 1;
+ key |= effect.cast<XferEffect>().mode() << 1;
b->add32(key);
}
@@ -1214,7 +1215,7 @@ private:
}
}
virtual bool onIsEqual(const GrEffect& other) const SK_OVERRIDE {
- const XferEffect& s = CastEffect<XferEffect>(other);
+ const XferEffect& s = other.cast<XferEffect>();
return fMode == s.fMode &&
fBackgroundAccess.getTexture() == s.fBackgroundAccess.getTexture();
}
« no previous file with comments | « include/gpu/GrTBackendEffectFactory.h ('k') | src/effects/SkAlphaThresholdFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698