Move convolution from code in GrGLProgram to new GrConvolutionEffect
class. This is the first test of the new Ganesh shader pipeline.
Also includes some cleanup of the gpu.gyp file: added src/gpu, allowing
us to remove ../ from many #include directives.
http://codereview.appspot.com/6199053/
git-svn-id: http://skia.googlecode.com/svn/trunk@3887 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/effects/GrConvolutionEffect.h b/src/gpu/effects/GrConvolutionEffect.h
new file mode 100644
index 0000000..e3c3aa9
--- /dev/null
+++ b/src/gpu/effects/GrConvolutionEffect.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2012 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrConvolutionEffect_DEFINED
+#define GrConvolutionEffect_DEFINED
+
+#include "GrCustomStage.h"
+#include "GrSamplerState.h" // for MAX_KENEL_WIDTH, FilterDirection
+
+class GrConvolutionEffect : public GrCustomStage {
+
+public:
+
+ GrConvolutionEffect(GrSamplerState::FilterDirection direction,
+ unsigned int kernelWidth, const float* kernel);
+ virtual ~GrConvolutionEffect();
+
+ virtual const char* name() const SK_OVERRIDE;
+ virtual GrProgramStageFactory* getFactory() const SK_OVERRIDE;
+ virtual bool isEqual(const GrCustomStage *) const SK_OVERRIDE;
+
+ unsigned int width() const { return fKernelWidth; }
+
+protected:
+
+ GrSamplerState::FilterDirection fDirection;
+ unsigned int fKernelWidth;
+ float fKernel[MAX_KERNEL_WIDTH];
+
+ friend class GrGLConvolutionEffect;
+
+private:
+
+ typedef GrCustomStage INHERITED;
+};
+
+#endif