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

Unified Diff: src/effects/SkMorphologyImageFilter.cpp

Issue 2359443003: Fix some GPU image filter code to preserve precision and color space (Closed)
Patch Set: Created 4 years, 3 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
Index: src/effects/SkMorphologyImageFilter.cpp
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 4e6032fa5a18115840c1b8389e6bf4486ba24cfc..f6d400111c604a1c7384d01fd78b55753ca1aecd 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -22,6 +22,7 @@
#include "GrInvariantOutput.h"
#include "GrTexture.h"
#include "SkGr.h"
+#include "SkGrPriv.h"
#include "effects/Gr1DKernelEffect.h"
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
@@ -476,6 +477,7 @@ static sk_sp<SkSpecialImage> apply_morphology(GrContext* context,
sk_sp<GrTexture> srcTexture(input->asTextureRef(context));
SkASSERT(srcTexture);
sk_sp<SkColorSpace> colorSpace = sk_ref_sp(input->getColorSpace());
+ GrPixelConfig config = GrRenderableConfigForColorSpace(colorSpace.get());
// setup new clip
const GrFixedClip clip(SkIRect::MakeWH(srcTexture->width(), srcTexture->height()));
@@ -488,8 +490,7 @@ static sk_sp<SkSpecialImage> apply_morphology(GrContext* context,
if (radius.fWidth > 0) {
sk_sp<GrDrawContext> dstDrawContext(context->makeDrawContext(SkBackingFit::kApprox,
rect.width(), rect.height(),
- kSkia8888_GrPixelConfig,
- colorSpace));
+ config, colorSpace));
if (!dstDrawContext) {
return nullptr;
}
@@ -510,8 +511,7 @@ static sk_sp<SkSpecialImage> apply_morphology(GrContext* context,
if (radius.fHeight > 0) {
sk_sp<GrDrawContext> dstDrawContext(context->makeDrawContext(SkBackingFit::kApprox,
rect.width(), rect.height(),
- kSkia8888_GrPixelConfig,
- colorSpace));
+ config, colorSpace));
if (!dstDrawContext) {
return nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698