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

Unified Diff: src/gpu/GrColorSpaceXform.cpp

Issue 2389983002: Refactored SkColorSpace and added in a Lab PCS GM (Closed)
Patch Set: migrated call from SkColorSpace_Base::makeLinearGamma() to SkColorSpace_XYZ::makeLinearGamma() Created 4 years, 2 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/gradients/SkGradientShader.cpp ('k') | tests/CodecTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrColorSpaceXform.cpp
diff --git a/src/gpu/GrColorSpaceXform.cpp b/src/gpu/GrColorSpaceXform.cpp
index d2270fafdd4a2458b4f8a1721be0a4f41f5adf26..ef96087147c1656ae00586a36f5c2927f09c3be4 100644
--- a/src/gpu/GrColorSpaceXform.cpp
+++ b/src/gpu/GrColorSpaceXform.cpp
@@ -49,8 +49,15 @@ sk_sp<GrColorSpaceXform> GrColorSpaceXform::Make(SkColorSpace* src, SkColorSpace
return nullptr;
}
+
+ const SkMatrix44* toXYZD50 = as_CSB(src)->toXYZD50();
+ const SkMatrix44* fromXYZD50 = as_CSB(dst)->fromXYZD50();
+ if (!toXYZD50 || !fromXYZD50) {
+ // unsupported colour spaces -- cannot specify gamut as a matrix
+ return nullptr;
+ }
SkMatrix44 srcToDst(SkMatrix44::kUninitialized_Constructor);
- srcToDst.setConcat(as_CSB(dst)->fromXYZD50(), as_CSB(src)->toXYZD50());
+ srcToDst.setConcat(*fromXYZD50, *toXYZD50);
if (matrix_is_almost_identity(srcToDst)) {
return nullptr;
« no previous file with comments | « src/effects/gradients/SkGradientShader.cpp ('k') | tests/CodecTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698