Introduces new SingleTextureEffect base class for GrCustomStage objects.
This class tracks the texture that the object uses. A future commit will get rid of the
GrTexture pointer currenty stored in the GrDrawState, allowing us to have CustomStages
*without* textures.
Requires gyp change on next roll.
http://codereview.appspot.com/6306097/
git-svn-id: http://skia.googlecode.com/svn/trunk@4576 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/effects/Gr1DKernelEffect.h b/src/gpu/effects/Gr1DKernelEffect.h
index b6e116f..9ef7652 100644
--- a/src/gpu/effects/Gr1DKernelEffect.h
+++ b/src/gpu/effects/Gr1DKernelEffect.h
@@ -8,7 +8,7 @@
#ifndef Gr1DKernelEffect_DEFINED
#define Gr1DKernelEffect_DEFINED
-#include "GrCustomStage.h"
+#include "GrSingleTextureEffect.h"
/**
* Base class for 1D kernel effects. The kernel operates either in X or Y and
@@ -18,7 +18,7 @@
* read. Since the center pixel is also read, the total width is one larger than
* two times the radius.
*/
-class Gr1DKernelEffect : public GrCustomStage {
+class Gr1DKernelEffect : public GrSingleTextureEffect {
public:
enum Direction {
@@ -26,9 +26,11 @@
kY_Direction,
};
- Gr1DKernelEffect(Direction direction,
+ Gr1DKernelEffect(GrTexture* texture,
+ Direction direction,
int radius)
- : fDirection(direction)
+ : GrSingleTextureEffect(texture)
+ , fDirection(direction)
, fRadius(radius) {}
virtual ~Gr1DKernelEffect() {};
@@ -44,7 +46,7 @@
Direction fDirection;
int fRadius;
- typedef GrCustomStage INHERITED;
+ typedef GrSingleTextureEffect INHERITED;
};
#endif