diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-10-04 14:38:48 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-10-04 14:38:48 +0000 |
commit | e6e62d1de9ab6cd7ad098a5e953bf207047389e8 (patch) | |
tree | fafb308b00b99adb1f6adc83c92578c1622441b2 /src/effects/gradients | |
parent | 73d5b2f620c02f0741c9ce13091f108855f066ae (diff) |
Make numTextures() be non-virtual on GrCustomStage.
R=tomhudson@google.com,robertphillips@google.com,senorblanco@chromium.org
Review URL: https://codereview.appspot.com/6586081
git-svn-id: http://skia.googlecode.com/svn/trunk@5805 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects/gradients')
-rw-r--r-- | src/effects/gradients/SkGradientShader.cpp | 8 | ||||
-rw-r--r-- | src/effects/gradients/SkGradientShaderPriv.h | 5 |
2 files changed, 3 insertions, 10 deletions
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp index 9a965ff817..cc7e13ccb6 100644 --- a/src/effects/gradients/SkGradientShader.cpp +++ b/src/effects/gradients/SkGradientShader.cpp @@ -719,7 +719,7 @@ void GrGLGradientStage::emitColorLookup(GrGLShaderBuilder* builder, GrGradientEffect::GrGradientEffect(GrContext* ctx, const SkGradientShaderBase& shader, SkShader::TileMode tileMode) - : fUseTexture (true) { + : INHERITED(1) { // TODO: check for simple cases where we don't need a texture: //GradientInfo info; //shader.asAGradient(&info); @@ -765,12 +765,8 @@ GrGradientEffect::~GrGradientEffect() { } } -int GrGradientEffect::numTextures() const { - return fUseTexture ? 1 : 0; -} - const GrTextureAccess& GrGradientEffect::textureAccess(int index) const { - GrAssert(fUseTexture && 0 == index); + GrAssert(0 == index); return fTextureAccess; } diff --git a/src/effects/gradients/SkGradientShaderPriv.h b/src/effects/gradients/SkGradientShaderPriv.h index bdea9008e8..61b9c35774 100644 --- a/src/effects/gradients/SkGradientShaderPriv.h +++ b/src/effects/gradients/SkGradientShaderPriv.h @@ -232,12 +232,10 @@ public: virtual ~GrGradientEffect(); - virtual int numTextures() const SK_OVERRIDE; virtual const GrTextureAccess& textureAccess(int index) const SK_OVERRIDE; - bool useTexture() const { return fUseTexture; } bool useAtlas() const { return SkToBool(-1 != fRow); } - GrScalar getYCoord() const { GrAssert(fUseTexture); return fYCoord; }; + GrScalar getYCoord() const { return fYCoord; }; virtual bool isEqual(const GrCustomStage& stage) const SK_OVERRIDE { const GrGradientEffect& s = static_cast<const GrGradientEffect&>(stage); @@ -262,7 +260,6 @@ protected: private: GrTextureAccess fTextureAccess; - bool fUseTexture; GrScalar fYCoord; GrTextureStripAtlas* fAtlas; int fRow; |