From e6e62d1de9ab6cd7ad098a5e953bf207047389e8 Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Thu, 4 Oct 2012 14:38:48 +0000 Subject: 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 --- src/effects/gradients/SkGradientShader.cpp | 8 ++------ src/effects/gradients/SkGradientShaderPriv.h | 5 +---- 2 files changed, 3 insertions(+), 10 deletions(-) (limited to 'src/effects/gradients') 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(stage); @@ -262,7 +260,6 @@ protected: private: GrTextureAccess fTextureAccess; - bool fUseTexture; GrScalar fYCoord; GrTextureStripAtlas* fAtlas; int fRow; -- cgit v1.2.3