aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkDisplacementMapEffect.cpp
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-09-22 07:15:37 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-22 07:15:37 -0700
commit2a75e5df300a2838f943ca52a52a85a5cf69802b (patch)
treeef64ee5043762606de08fde3da60b39777c3bc22 /src/effects/SkDisplacementMapEffect.cpp
parent4be0e7cfe0efceeaf4c7a4d598d77c27cfd3e69b (diff)
Add output format properties to SkImageFilter::Context
For now, this is just the color space (of the original requesting device). This is used when constructing intermediate rendering surfaces, so that we ensure we land in a surface that's similar/compatible to the final consumer of the DAG's output. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2357273002 Review-Url: https://codereview.chromium.org/2357273002
Diffstat (limited to 'src/effects/SkDisplacementMapEffect.cpp')
-rw-r--r--src/effects/SkDisplacementMapEffect.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index 0f49a991c2..8fc0ec1366 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -336,10 +336,11 @@ sk_sp<SkSpecialImage> SkDisplacementMapEffect::onFilterImage(SkSpecialImage* sou
SkMatrix matrix;
matrix.setTranslate(-SkIntToScalar(colorBounds.x()), -SkIntToScalar(colorBounds.y()));
+ SkColorSpace* colorSpace = ctx.outputProperties().colorSpace();
sk_sp<GrDrawContext> drawContext(
context->makeDrawContext(SkBackingFit::kApprox, bounds.width(), bounds.height(),
- GrRenderableConfigForColorSpace(source->getColorSpace()),
- sk_ref_sp(source->getColorSpace())));
+ GrRenderableConfigForColorSpace(colorSpace),
+ sk_ref_sp(colorSpace)));
if (!drawContext) {
return nullptr;
}