Index: src/gpu/SkGr.cpp |
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp |
index 540edb6a38e728c6a5e1f018a2dc3840fda965a8..8da7cbefa63955a76483ae47a0dc42f2313e4985 100644 |
--- a/src/gpu/SkGr.cpp |
+++ b/src/gpu/SkGr.cpp |
@@ -429,7 +429,8 @@ static inline bool skpaint_to_grpaint_impl(GrContext* context, |
const GrFragmentProcessor** shaderProcessor, |
SkXfermode::Mode* primColorMode, |
bool primitiveIsSrc, |
- GrPaint* grPaint) { |
+ GrPaint* grPaint, |
+ GrRenderTarget* dstRT) { |
grPaint->setAntiAlias(skPaint.isAntiAlias()); |
// Setup the initial color considering the shader, the SkPaint color, and the presence or not |
@@ -441,7 +442,8 @@ static inline bool skpaint_to_grpaint_impl(GrContext* context, |
shaderFP = *shaderProcessor; |
} else if (const SkShader* shader = skPaint.getShader()) { |
aufp.reset(shader->asFragmentProcessor(context, viewM, nullptr, |
- skPaint.getFilterQuality())); |
+ skPaint.getFilterQuality(), |
+ dstRT)); |
shaderFP = aufp; |
if (!shaderFP) { |
return false; |
@@ -529,7 +531,7 @@ static inline bool skpaint_to_grpaint_impl(GrContext* context, |
grPaint->setColor(SkColorToPremulGrColor(colorFilter->filterColor(skPaint.getColor()))); |
} else { |
SkAutoTUnref<const GrFragmentProcessor> cfFP( |
- colorFilter->asFragmentProcessor(context)); |
+ colorFilter->asFragmentProcessor(context, dstRT)); |
if (cfFP) { |
grPaint->addColorFragmentProcessor(cfFP); |
} else { |
@@ -557,31 +559,31 @@ static inline bool skpaint_to_grpaint_impl(GrContext* context, |
} |
bool SkPaintToGrPaint(GrContext* context, const SkPaint& skPaint, const SkMatrix& viewM, |
- GrPaint* grPaint) { |
- return skpaint_to_grpaint_impl(context, skPaint, viewM, nullptr, nullptr, false, grPaint); |
+ GrPaint* grPaint, GrRenderTarget* dstRT) { |
+ return skpaint_to_grpaint_impl(context, skPaint, viewM, nullptr, nullptr, false, grPaint, dstRT); |
} |
/** Replaces the SkShader (if any) on skPaint with the passed in GrFragmentProcessor. */ |
bool SkPaintToGrPaintReplaceShader(GrContext* context, |
const SkPaint& skPaint, |
const GrFragmentProcessor* shaderFP, |
- GrPaint* grPaint) { |
+ GrPaint* grPaint, GrRenderTarget* dstRT) { |
if (!shaderFP) { |
return false; |
} |
return skpaint_to_grpaint_impl(context, skPaint, SkMatrix::I(), &shaderFP, nullptr, false, |
- grPaint); |
+ grPaint, dstRT); |
} |
/** Ignores the SkShader (if any) on skPaint. */ |
bool SkPaintToGrPaintNoShader(GrContext* context, |
const SkPaint& skPaint, |
- GrPaint* grPaint) { |
+ GrPaint* grPaint, GrRenderTarget* dstRT) { |
// Use a ptr to a nullptr to to indicate that the SkShader is ignored and not replaced. |
static const GrFragmentProcessor* kNullShaderFP = nullptr; |
static const GrFragmentProcessor** kIgnoreShader = &kNullShaderFP; |
return skpaint_to_grpaint_impl(context, skPaint, SkMatrix::I(), kIgnoreShader, nullptr, false, |
- grPaint); |
+ grPaint, dstRT); |
} |
/** Blends the SkPaint's shader (or color if no shader) with a per-primitive color which must |
@@ -591,9 +593,10 @@ bool SkPaintToGrPaintWithXfermode(GrContext* context, |
const SkMatrix& viewM, |
SkXfermode::Mode primColorMode, |
bool primitiveIsSrc, |
- GrPaint* grPaint) { |
+ GrPaint* grPaint, |
+ GrRenderTarget* dstRT) { |
return skpaint_to_grpaint_impl(context, skPaint, viewM, nullptr, &primColorMode, primitiveIsSrc, |
- grPaint); |
+ grPaint, dstRT); |
} |