Index: src/gpu/SkGpuDevice_drawTexture.cpp |
diff --git a/src/gpu/SkGpuDevice_drawTexture.cpp b/src/gpu/SkGpuDevice_drawTexture.cpp |
index b41d69c6fd7aa5f690c18bb27fb4de2834235985..a94f1ecf8ee9b61fe2a6d61e17e76187c58ddadc 100644 |
--- a/src/gpu/SkGpuDevice_drawTexture.cpp |
+++ b/src/gpu/SkGpuDevice_drawTexture.cpp |
@@ -23,35 +23,6 @@ static inline bool use_shader(bool textureIsAlphaOnly, const SkPaint& paint) { |
return textureIsAlphaOnly && paint.getShader(); |
} |
-/** Determines how to combine the texture FP with the paint's color and SkShader, if any. */ |
-static const GrFragmentProcessor* mix_texture_fp_with_paint_color_and_shader( |
- const GrFragmentProcessor* textureFP, |
- bool textureIsAlphaOnly, |
- GrContext* context, |
- const SkMatrix& viewMatrix, |
- const SkPaint& paint) { |
- // According to the SkCanvas API, we only consider the shader if the bitmap or image being |
- // rendered is alpha-only. |
- if (textureIsAlphaOnly) { |
- if (const SkShader* shader = paint.getShader()) { |
- SkAutoTUnref<const GrFragmentProcessor> shaderFP( |
- shader->asFragmentProcessor(context, |
- viewMatrix, |
- nullptr, |
- paint.getFilterQuality())); |
- if (!shaderFP) { |
- return nullptr; |
- } |
- const GrFragmentProcessor* fpSeries[] = { shaderFP, textureFP }; |
- return GrFragmentProcessor::RunInSeries(fpSeries, 2); |
- } else { |
- return GrFragmentProcessor::MulOutputByInputUnpremulColor(textureFP); |
- } |
- } else { |
- return GrFragmentProcessor::MulOutputByInputAlpha(textureFP); |
- } |
-} |
- |
void SkGpuDevice::drawTextureAdjuster(GrTextureAdjuster* adjuster, |
bool alphaOnly, |
const SkRect* srcRect, |
@@ -156,10 +127,9 @@ void SkGpuDevice::drawTextureAdjusterImpl(GrTextureAdjuster* adjuster, |
if (!fp) { |
return; |
} |
- fp.reset(mix_texture_fp_with_paint_color_and_shader(fp, alphaTexture, this->context(), |
- viewMatrix, paint)); |
+ |
GrPaint grPaint; |
- if (!SkPaintToGrPaintReplaceShader(fContext, paint, fp, &grPaint)) { |
+ if (!SkPaintToGrPaintWithTexture(fContext, paint, viewMatrix, fp, alphaTexture, &grPaint)) { |
return; |
} |