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

Unified Diff: src/gpu/GrColorSpaceXform.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
Index: src/gpu/GrColorSpaceXform.cpp
diff --git a/src/gpu/GrColorSpaceXform.cpp b/src/gpu/GrColorSpaceXform.cpp
index a1e89380482707cc24ac517c8024eb4c21cbcc2e..03aa27164492f184159a3d7fdec4074bf2e94331 100644
--- a/src/gpu/GrColorSpaceXform.cpp
+++ b/src/gpu/GrColorSpaceXform.cpp
@@ -34,11 +34,13 @@ static inline bool matrix_is_almost_identity(const SkMatrix44& m,
sk_float_almost_equals(m.getFloat(3, 3), 1.0f, tol);
}
-GrColorSpaceXform::GrColorSpaceXform(const SkMatrix44& srcToDst) {
+GrColorSpaceXform::GrColorSpaceXform(const SkMatrix44& srcToDst, SkAlphaType srcAlphaType)
+ : fSrcAlphaType(srcAlphaType) {
srcToDst.asColMajorf(fSrcToDst);
}
-sk_sp<GrColorSpaceXform> GrColorSpaceXform::Make(SkColorSpace* src, SkColorSpace* dst) {
+sk_sp<GrColorSpaceXform> GrColorSpaceXform::Make(SkColorSpace* src, SkColorSpace* dst,
+ SkAlphaType srcAlphaType) {
if (!src || !dst) {
// Invalid
return nullptr;
@@ -59,5 +61,5 @@ sk_sp<GrColorSpaceXform> GrColorSpaceXform::Make(SkColorSpace* src, SkColorSpace
return nullptr;
}
- return sk_make_sp<GrColorSpaceXform>(srcToDst);
+ return sk_make_sp<GrColorSpaceXform>(srcToDst, srcAlphaType);
}

Powered by Google App Engine
This is Rietveld 408576698