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

Unified Diff: src/gpu/GrColorSpaceXform.cpp

Issue 2323003002: Cache the inverse matrix on SkColorSpace. Rename xyz() to toXYZ(). (Closed)
Patch Set: Remove xyz() again 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
« no previous file with comments | « src/core/SkColorSpace_Base.h ('k') | tests/ColorSpaceTest.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 03aa27164492f184159a3d7fdec4074bf2e94331..8ff6fda0cbc80eebc1f49cfdc5c14be18f85746f 100644
--- a/src/gpu/GrColorSpaceXform.cpp
+++ b/src/gpu/GrColorSpaceXform.cpp
@@ -7,6 +7,7 @@
#include "GrColorSpaceXform.h"
#include "SkColorSpace.h"
+#include "SkColorSpace_Base.h"
#include "SkMatrix44.h"
static inline bool sk_float_almost_equals(float x, float y, float tol) {
@@ -51,11 +52,8 @@ sk_sp<GrColorSpaceXform> GrColorSpaceXform::Make(SkColorSpace* src, SkColorSpace
return nullptr;
}
- SkMatrix44 srcToDst(SkMatrix44::kUninitialized_Constructor);
- if (!dst->xyz().invert(&srcToDst)) {
- return nullptr;
- }
- srcToDst.postConcat(src->xyz());
+ SkMatrix44 srcToDst = as_CSB(dst)->fromXYZD50();
+ srcToDst.postConcat(src->toXYZD50());
if (matrix_is_almost_identity(srcToDst)) {
return nullptr;
« no previous file with comments | « src/core/SkColorSpace_Base.h ('k') | tests/ColorSpaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698