Index: src/effects/SkDisplacementMapEffect.cpp |
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp |
index 392ac43cceaa7c8cd956fb53f56b79ed25cc958c..9370a9fc932e9b027eca84477dbd869a94052a34 100644 |
--- a/src/effects/SkDisplacementMapEffect.cpp |
+++ b/src/effects/SkDisplacementMapEffect.cpp |
@@ -335,9 +335,9 @@ sk_sp<SkSpecialImage> SkDisplacementMapEffect::onFilterImage(SkSpecialImage* sou |
SkMatrix matrix; |
matrix.setTranslate(-SkIntToScalar(colorBounds.x()), -SkIntToScalar(colorBounds.y())); |
- sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kApprox, |
- bounds.width(), bounds.height(), |
- kSkia8888_GrPixelConfig)); |
+ sk_sp<GrDrawContext> drawContext( |
+ context->newDrawContext(SkBackingFit::kApprox, bounds.width(), bounds.height(), |
+ kSkia8888_GrPixelConfig, sk_ref_sp(source->getColorSpace()))); |
if (!drawContext) { |
return nullptr; |
} |
@@ -346,11 +346,10 @@ sk_sp<SkSpecialImage> SkDisplacementMapEffect::onFilterImage(SkSpecialImage* sou |
offset->fX = bounds.left(); |
offset->fY = bounds.top(); |
- // TODO: Get the colorSpace from the drawContext (once it has one) |
return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.height()), |
kNeedNewImageUniqueID_SpecialImage, |
drawContext->asTexture(), |
- sk_ref_sp(source->getColorSpace())); |
+ sk_ref_sp(drawContext->getColorSpace())); |
} |
#endif |