Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Unified Diff: src/gpu/SkGr.cpp

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/SkGpuDevice_drawTexture.cpp ('k') | src/gpu/SkGrPriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « src/gpu/SkGpuDevice_drawTexture.cpp ('k') | src/gpu/SkGrPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698