From e742bf0ab19659145325ac894f7e0b78c8efbd89 Mon Sep 17 00:00:00 2001 From: "tomhudson@google.com" Date: Fri, 13 Jul 2012 19:54:19 +0000 Subject: Start removing calls to GrDrawState::setTexture() (and GrPaint::setTexture()?) when there's a GrSingleTextureEffect involved holding the texture. http://codereview.appspot.com/6353094/ git-svn-id: http://skia.googlecode.com/svn/trunk@4608 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/gpu/SkGpuDevice.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gpu/SkGpuDevice.cpp') diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 6443fa28e7..dfded26c65 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -562,7 +562,6 @@ inline bool skPaint2GrPaintShader(SkGpuDevice* dev, SkDebugf("Couldn't convert bitmap to texture.\n"); return false; } - grPaint->setTexture(kShaderTextureIdx, texture); switch (bmptype) { case SkShader::kRadial_BitmapType: @@ -595,6 +594,9 @@ inline bool skPaint2GrPaintShader(SkGpuDevice* dev, } else { sampler->setFilter(GrSamplerState::kNearest_Filter); } + // TODO - once we have a trivial GrCustomStage for texture drawing, + // create that here & get rid of the paint's texture + grPaint->setTexture(kShaderTextureIdx, texture); break; } sampler->setWrapX(sk_tile_mode_to_grwrap(tileModes[0])); @@ -1476,7 +1478,6 @@ void apply_custom_stage(GrContext* context, paint.textureSampler(0)->setFilter(GrSamplerState::kBilinear_Filter); paint.textureSampler(0)->reset(sampleM); paint.textureSampler(0)->setCustomStage(stage); - paint.setTexture(0, srcTexture); context->drawRect(paint, rect); } -- cgit v1.2.3