aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkMatrixConvolutionImageFilter.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-29 19:51:22 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-29 19:51:22 +0000
commit2eaaefd7e6a58339b3f93333f1e9cc92252cc303 (patch)
treef65a31a9b3bc70909ceb311ebad684c2bf445868 /src/effects/SkMatrixConvolutionImageFilter.cpp
parent484ee2a5fe47c204d9dda6acba54f9789d1cf69f (diff)
Pass GrCustomStage to key-generation functions and emitCode().
R=robertphillips@google.com Review URL: https://codereview.appspot.com/6819046 git-svn-id: http://skia.googlecode.com/svn/branches/gpu_dev@6182 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects/SkMatrixConvolutionImageFilter.cpp')
-rw-r--r--src/effects/SkMatrixConvolutionImageFilter.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index ed0a00b548..f8d1c093b5 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -14,6 +14,7 @@
#if SK_SUPPORT_GPU
#include "gl/GrGLEffect.h"
+#include "GrTBackendEffectFactory.h"
#endif
SkMatrixConvolutionImageFilter::SkMatrixConvolutionImageFilter(const SkISize& kernelSize, const SkScalar* kernel, SkScalar gain, SkScalar bias, const SkIPoint& target, TileMode tileMode, bool convolveAlpha, SkImageFilter* input)
@@ -284,14 +285,14 @@ public:
GrGLMatrixConvolutionEffect(const GrBackendEffectFactory& factory,
const GrEffect& effect);
virtual void emitCode(GrGLShaderBuilder*,
- const GrEffect&,
+ const GrEffectStage&,
EffectKey,
const char* vertexCoords,
const char* outputColor,
const char* inputColor,
const TextureSamplerArray&) SK_OVERRIDE;
- static inline EffectKey GenKey(const GrEffect& s, const GrGLCaps& caps);
+ static inline EffectKey GenKey(const GrEffectStage&, const GrGLCaps&);
virtual void setData(const GrGLUniformManager&, const GrEffectStage&) SK_OVERRIDE;
@@ -348,7 +349,7 @@ static void appendTextureLookup(GrGLShaderBuilder* builder,
}
void GrGLMatrixConvolutionEffect::emitCode(GrGLShaderBuilder* builder,
- const GrEffect&,
+ const GrEffectStage&,
EffectKey,
const char* vertexCoords,
const char* outputColor,
@@ -417,9 +418,9 @@ int encodeXY(int x, int y) {
};
-GrGLEffect::EffectKey GrGLMatrixConvolutionEffect::GenKey(const GrEffect& s,
- const GrGLCaps& caps) {
- const GrMatrixConvolutionEffect& m = static_cast<const GrMatrixConvolutionEffect&>(s);
+GrGLEffect::EffectKey GrGLMatrixConvolutionEffect::GenKey(const GrEffectStage& s, const GrGLCaps&) {
+ const GrMatrixConvolutionEffect& m =
+ static_cast<const GrMatrixConvolutionEffect&>(*s.getEffect());
EffectKey key = encodeXY(m.kernelSize().width(), m.kernelSize().height());
key |= m.tileMode() << 7;
key |= m.convolveAlpha() ? 1 << 9 : 0;