aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrConvolutionEffect.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-21 20:57:59 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-21 20:57:59 +0000
commit289efe014ad7628de7cf2c5177a42cacd1e335ad (patch)
tree739008c94137e69e153d4d7cda5a52ecff943db5 /src/gpu/effects/GrConvolutionEffect.cpp
parent469d0dd944833444a363591be1ee6a76bdecf96d (diff)
Tunnel name requests through factory, forcing custom effect and custom prog stage to use same impl
Review URL: http://codereview.appspot.com/6220061/ git-svn-id: http://skia.googlecode.com/svn/trunk@4019 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/effects/GrConvolutionEffect.cpp')
-rw-r--r--src/gpu/effects/GrConvolutionEffect.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp
index 563d1a4051..29d1573061 100644
--- a/src/gpu/effects/GrConvolutionEffect.cpp
+++ b/src/gpu/effects/GrConvolutionEffect.cpp
@@ -17,8 +17,8 @@ class GrGLConvolutionEffect : public GrGLProgramStage {
public:
- GrGLConvolutionEffect(const GrCustomStage* stage);
- virtual const char* name() const SK_OVERRIDE;
+ GrGLConvolutionEffect(const GrProgramStageFactory& factory,
+ const GrCustomStage* stage);
virtual void setupVSUnis(VarArray* vsUnis, int stage) SK_OVERRIDE;
virtual void setupFSUnis(VarArray* fsUnis, int stage) SK_OVERRIDE;
virtual void emitVS(GrStringBuilder* code,
@@ -49,18 +49,17 @@ private:
typedef GrGLProgramStage INHERITED;
};
-GrGLConvolutionEffect::GrGLConvolutionEffect(const GrCustomStage* data)
- : fKernelVar(NULL)
+GrGLConvolutionEffect::GrGLConvolutionEffect(
+ const GrProgramStageFactory& factory,
+ const GrCustomStage* data)
+ : GrGLProgramStage(factory)
+ , fKernelVar(NULL)
, fImageIncrementVar(NULL)
, fKernelLocation(0)
, fImageIncrementLocation(0) {
fKernelWidth = static_cast<const GrConvolutionEffect*>(data)->width();
}
-const char* GrGLConvolutionEffect::name() const {
- return GrConvolutionEffect::Name();
-}
-
void GrGLConvolutionEffect::setupVSUnis(VarArray* vsUnis,
int stage) {
fImageIncrementVar = &vsUnis->push_back();
@@ -188,11 +187,6 @@ GrConvolutionEffect::~GrConvolutionEffect() {
}
-const char* GrConvolutionEffect::name() const {
- return Name();
-}
-
-
const GrProgramStageFactory& GrConvolutionEffect::getFactory() const {
return GrTProgramStageFactory<GrConvolutionEffect>::getInstance();
}