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

Unified Diff: src/effects/SkPerlinNoiseShader.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/effects/SkMorphologyImageFilter.cpp ('k') | src/effects/SkTableColorFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkPerlinNoiseShader.cpp
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp
index e4811627b2da19f4bef53d38b46ac332333f62f4..f0b9f67712ccf237d117fd90b88463f00bcf5af5 100644
--- a/src/effects/SkPerlinNoiseShader.cpp
+++ b/src/effects/SkPerlinNoiseShader.cpp
@@ -499,7 +499,7 @@ public:
virtual void emitCode(GrGLShaderBuilder*,
const GrDrawEffect&,
- EffectKey,
+ const GrEffectKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -507,7 +507,7 @@ public:
virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVERRIDE;
- static inline EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&);
+ static inline void GenKey(const GrDrawEffect&, const GrGLCaps&, GrEffectKeyBuilder* b);
private:
@@ -647,7 +647,7 @@ GrGLPerlinNoise::GrGLPerlinNoise(const GrBackendEffectFactory& factory, const Gr
void GrGLPerlinNoise::emitCode(GrGLShaderBuilder* builder,
const GrDrawEffect&,
- EffectKey key,
+ const GrEffectKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
@@ -900,10 +900,10 @@ void GrGLPerlinNoise::emitCode(GrGLShaderBuilder* builder,
outputColor, outputColor, outputColor, outputColor);
}
-GrGLEffect::EffectKey GrGLPerlinNoise::GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&) {
+void GrGLPerlinNoise::GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&, GrEffectKeyBuilder* b) {
const GrPerlinNoiseEffect& turbulence = drawEffect.castEffect<GrPerlinNoiseEffect>();
- EffectKey key = turbulence.numOctaves();
+ uint32_t key = turbulence.numOctaves();
key = key << 3; // Make room for next 3 bits
@@ -923,7 +923,7 @@ GrGLEffect::EffectKey GrGLPerlinNoise::GenKey(const GrDrawEffect& drawEffect, co
key |= 0x4; // Flip the 3rd bit if tile stitching is on
}
- return key;
+ b->add32(key);
}
void GrGLPerlinNoise::setData(const GrGLUniformManager& uman, const GrDrawEffect& drawEffect) {
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/effects/SkTableColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698