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

Unified Diff: src/effects/SkLightingImageFilter.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/SkLightingImageFilter.cpp
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index c8d2154b8669f4587e636e06dff851d5406652dd..3485bd867ced0ee6795736a09f1208cec3d3b43c 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -22,6 +22,7 @@
#include "GrInvariantOutput.h"
#include "GrPaint.h"
#include "SkGr.h"
+#include "SkGrPriv.h"
#include "effects/GrSingleTextureEffect.h"
#include "effects/GrTextureDomain.h"
#include "glsl/GrGLSLFragmentProcessor.h"
@@ -409,11 +410,10 @@ sk_sp<SkSpecialImage> SkLightingImageFilterInternal::filterImageGPU(SkSpecialIma
sk_sp<GrTexture> inputTexture(input->asTextureRef(context));
SkASSERT(inputTexture);
- sk_sp<GrDrawContext> drawContext(context->makeDrawContext(SkBackingFit::kApprox,
- offsetBounds.width(),
- offsetBounds.height(),
- kRGBA_8888_GrPixelConfig,
- sk_ref_sp(source->getColorSpace())));
+ sk_sp<GrDrawContext> drawContext(
+ context->makeDrawContext(SkBackingFit::kApprox,offsetBounds.width(), offsetBounds.height(),
+ GrRenderableConfigForColorSpace(source->getColorSpace()),
+ sk_ref_sp(source->getColorSpace())));
if (!drawContext) {
return nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698