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

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

Issue 385713005: Allow GrGLEffects to produce variable length keys. (Closed) Base URL: https://skia.googlesource.com/skia.git@key
Patch Set: rebase Created 6 years, 5 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/GrOvalEffect.cpp ('k') | src/gpu/effects/GrSimpleTextureEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrRRectEffect.cpp
diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp
index efad436888d5a686bb0a9bff01076888d55e9eb0..277f6df1a7df39b49440b1451b4edb9ad169214c 100644
--- a/src/gpu/effects/GrRRectEffect.cpp
+++ b/src/gpu/effects/GrRRectEffect.cpp
@@ -136,13 +136,13 @@ public:
virtual void emitCode(GrGLShaderBuilder* builder,
const GrDrawEffect& drawEffect,
- EffectKey key,
+ const GrEffectKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
const TextureSamplerArray&) SK_OVERRIDE;
- static inline EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&);
+ static inline void GenKey(const GrDrawEffect&, const GrGLCaps&, GrEffectKeyBuilder*);
virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVERRIDE;
@@ -161,7 +161,7 @@ GLCircularRRectEffect::GLCircularRRectEffect(const GrBackendEffectFactory& facto
void GLCircularRRectEffect::emitCode(GrGLShaderBuilder* builder,
const GrDrawEffect& drawEffect,
- EffectKey key,
+ const GrEffectKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -291,11 +291,11 @@ void GLCircularRRectEffect::emitCode(GrGLShaderBuilder* builder,
(GrGLSLExpr4(inputColor) * GrGLSLExpr1("alpha")).c_str());
}
-GrGLEffect::EffectKey GLCircularRRectEffect::GenKey(const GrDrawEffect& drawEffect,
- const GrGLCaps&) {
+void GLCircularRRectEffect::GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&,
+ GrEffectKeyBuilder* b) {
const CircularRRectEffect& crre = drawEffect.castEffect<CircularRRectEffect>();
GR_STATIC_ASSERT(kGrEffectEdgeTypeCnt <= 8);
- return (crre.getCircularCornerFlags() << 3) | crre.getEdgeType();
+ b->add32((crre.getCircularCornerFlags() << 3) | crre.getEdgeType());
}
void GLCircularRRectEffect::setData(const GrGLUniformManager& uman,
@@ -488,13 +488,13 @@ public:
virtual void emitCode(GrGLShaderBuilder* builder,
const GrDrawEffect& drawEffect,
- EffectKey key,
+ const GrEffectKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
const TextureSamplerArray&) SK_OVERRIDE;
- static inline EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&);
+ static inline void GenKey(const GrDrawEffect&, const GrGLCaps&, GrEffectKeyBuilder*);
virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVERRIDE;
@@ -513,7 +513,7 @@ GLEllipticalRRectEffect::GLEllipticalRRectEffect(const GrBackendEffectFactory& f
void GLEllipticalRRectEffect::emitCode(GrGLShaderBuilder* builder,
const GrDrawEffect& drawEffect,
- EffectKey key,
+ const GrEffectKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -586,11 +586,11 @@ void GLEllipticalRRectEffect::emitCode(GrGLShaderBuilder* builder,
(GrGLSLExpr4(inputColor) * GrGLSLExpr1("alpha")).c_str());
}
-GrGLEffect::EffectKey GLEllipticalRRectEffect::GenKey(const GrDrawEffect& drawEffect,
- const GrGLCaps&) {
+void GLEllipticalRRectEffect::GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&,
+ GrEffectKeyBuilder* b) {
const EllipticalRRectEffect& erre = drawEffect.castEffect<EllipticalRRectEffect>();
GR_STATIC_ASSERT(kLast_GrEffectEdgeType < (1 << 3));
- return erre.getRRect().getType() | erre.getEdgeType() << 3;
+ b->add32(erre.getRRect().getType() | erre.getEdgeType() << 3);
}
void GLEllipticalRRectEffect::setData(const GrGLUniformManager& uman,
« no previous file with comments | « src/gpu/effects/GrOvalEffect.cpp ('k') | src/gpu/effects/GrSimpleTextureEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698