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

Unified Diff: src/effects/SkMorphologyImageFilter.cpp

Issue 2164363002: Add SkColorSpace to GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove ':' from comment Created 4 years, 5 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/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkMorphologyImageFilter.cpp
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 5d4b58c880fdf4911eac7ddb87ba6ae1b4a4fd52..7e27249a13d97edd953c6529833e2a1327c2083c 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -474,6 +474,7 @@ static sk_sp<SkSpecialImage> apply_morphology(GrContext* context,
SkISize radius) {
sk_sp<GrTexture> srcTexture(input->asTextureRef(context));
SkASSERT(srcTexture);
+ sk_sp<SkColorSpace> colorSpace = sk_ref_sp(input->getColorSpace());
// setup new clip
const GrFixedClip clip(SkIRect::MakeWH(srcTexture->width(), srcTexture->height()));
@@ -486,7 +487,8 @@ static sk_sp<SkSpecialImage> apply_morphology(GrContext* context,
if (radius.fWidth > 0) {
sk_sp<GrDrawContext> dstDrawContext(context->newDrawContext(SkBackingFit::kApprox,
rect.width(), rect.height(),
- kSkia8888_GrPixelConfig));
+ kSkia8888_GrPixelConfig,
+ colorSpace));
if (!dstDrawContext) {
return nullptr;
}
@@ -507,7 +509,8 @@ static sk_sp<SkSpecialImage> apply_morphology(GrContext* context,
if (radius.fHeight > 0) {
sk_sp<GrDrawContext> dstDrawContext(context->newDrawContext(SkBackingFit::kApprox,
rect.width(), rect.height(),
- kSkia8888_GrPixelConfig));
+ kSkia8888_GrPixelConfig,
+ colorSpace));
if (!dstDrawContext) {
return nullptr;
}
@@ -519,10 +522,9 @@ static sk_sp<SkSpecialImage> apply_morphology(GrContext* context,
srcTexture = dstDrawContext->asTexture();
}
- // TODO: Get the colorSpace from the drawContext (once it has one)
return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(rect.width(), rect.height()),
kNeedNewImageUniqueID_SpecialImage,
- std::move(srcTexture), sk_ref_sp(input->getColorSpace()),
+ std::move(srcTexture), std::move(colorSpace),
&input->props());
}
#endif
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698