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

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

Issue 571163002: removing GrDrawEffect (Closed) Base URL: https://skia.googlesource.com/skia.git@gp3
Patch Set: rebase 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
Index: src/gpu/effects/GrConfigConversionEffect.cpp
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index 84e60cd76cfdfc771686e2e9ee5ab22ff4286bf8..ea4818a9ca430990b2bdcb87d53fc25a3528ab84 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -16,15 +16,16 @@
class GrGLConfigConversionEffect : public GrGLEffect {
public:
GrGLConfigConversionEffect(const GrBackendEffectFactory& factory,
- const GrDrawEffect& drawEffect)
+ const GrEffect& effect)
: INHERITED (factory) {
- const GrConfigConversionEffect& effect = drawEffect.castEffect<GrConfigConversionEffect>();
- fSwapRedAndBlue = effect.swapsRedAndBlue();
- fPMConversion = effect.pmConversion();
+ const GrConfigConversionEffect& configConversionEffect =
+ GrEffect::CastEffect<GrConfigConversionEffect>(effect);
+ fSwapRedAndBlue = configConversionEffect.swapsRedAndBlue();
+ fPMConversion = configConversionEffect.pmConversion();
}
virtual void emitCode(GrGLProgramBuilder* builder,
- const GrDrawEffect&,
+ const GrEffect&,
const GrEffectKey& key,
const char* outputColor,
const char* inputColor,
@@ -84,9 +85,10 @@ public:
fsBuilder->codeAppend(modulate.c_str());
}
- static inline void GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&,
+ static inline void GenKey(const GrEffect& effect, const GrGLCaps&,
GrEffectKeyBuilder* b) {
- const GrConfigConversionEffect& conv = drawEffect.castEffect<GrConfigConversionEffect>();
+ const GrConfigConversionEffect& conv =
+ GrEffect::CastEffect<GrConfigConversionEffect>(effect);
uint32_t key = (conv.swapsRedAndBlue() ? 0 : 1) | (conv.pmConversion() << 1);
b->add32(key);
}
@@ -119,7 +121,7 @@ const GrBackendEffectFactory& GrConfigConversionEffect::getFactory() const {
}
bool GrConfigConversionEffect::onIsEqual(const GrEffect& s) const {
- const GrConfigConversionEffect& other = CastEffect<GrConfigConversionEffect>(s);
+ const GrConfigConversionEffect& other = GrEffect::CastEffect<GrConfigConversionEffect>(s);
return this->texture(0) == s.texture(0) &&
other.fSwapRedAndBlue == fSwapRedAndBlue &&
other.fPMConversion == fPMConversion;

Powered by Google App Engine
This is Rietveld 408576698