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/GrContext.cpp b/src/gpu/GrContext.cpp
index 149359f..95e0eca 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -244,7 +244,7 @@
sampleM.setIDiv(texture->width(), texture->height());
drawState->sampler(0)->reset(sampleM);
SkAutoTUnref<GrCustomStage> morph(
- SkNEW_ARGS(GrMorphologyEffect, (direction, radius, morphType)));
+ SkNEW_ARGS(GrMorphologyEffect, (texture, direction, radius, morphType)));
drawState->sampler(0)->setCustomStage(morph);
drawState->setTexture(0, texture);
gpu->drawSimpleRect(rect, NULL, 1 << 0);
@@ -264,7 +264,7 @@
sampleM.setIDiv(texture->width(), texture->height());
drawState->sampler(0)->reset(sampleM);
SkAutoTUnref<GrConvolutionEffect> conv(SkNEW_ARGS(GrConvolutionEffect,
- (direction, radius)));
+ (texture, direction, radius)));
conv->setGaussianKernel(sigma);
drawState->sampler(0)->setCustomStage(conv);
drawState->setTexture(0, texture);