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

Unified Diff: src/image/SkImageShader.cpp

Issue 2180803005: Add color gamut xform helpers to GrGLSLShaderBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@xform-storage
Patch Set: Rebase 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
« include/gpu/GrColorSpaceXform.h ('K') | « src/gpu/glsl/GrGLSLShaderBuilder.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImageShader.cpp
diff --git a/src/image/SkImageShader.cpp b/src/image/SkImageShader.cpp
index db2bacb4ef4d96e9c2db5e02184c5463d1086d7a..9afd2073602fba7113436e14273fbfd226f6f4bd 100644
--- a/src/image/SkImageShader.cpp
+++ b/src/image/SkImageShader.cpp
@@ -214,11 +214,15 @@ sk_sp<GrFragmentProcessor> SkImageShader::asFragmentProcessor(const AsFPArgs& ar
return nullptr;
}
+ SkImageInfo info = as_IB(fImage)->onImageInfo();
+ sk_sp<GrColorSpaceXform> colorSpaceXform = GrColorSpaceXform::Make(info.colorSpace(),
+ args.fDstColorSpace,
+ info.alphaType());
sk_sp<GrFragmentProcessor> inner;
if (doBicubic) {
- inner = GrBicubicEffect::Make(texture, nullptr, matrix, tm);
+ inner = GrBicubicEffect::Make(texture, std::move(colorSpaceXform), matrix, tm);
} else {
- inner = GrSimpleTextureEffect::Make(texture, nullptr, matrix, params);
+ inner = GrSimpleTextureEffect::Make(texture, std::move(colorSpaceXform), matrix, params);
}
if (GrPixelConfigIsAlphaOnly(texture->config())) {
« include/gpu/GrColorSpaceXform.h ('K') | « src/gpu/glsl/GrGLSLShaderBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698