Commit be8523a5 authored by Mike Klein's avatar Mike Klein Committed by Commit Bot

switch to alternate SkColorSpace::toXYZD50()

Both SkColorSpace::toXYZD50() routines return the same information, but
the out-parameter version gives more flexibility in how SkColorSpace
represents that gamut matrix internally.  As is, there's no way around
storing an SkMatrix44.

Change-Id: I8459f4e611890114bace574df098040441e698f8
Reviewed-on: https://chromium-review.googlesource.com/c/1261397Reviewed-by: default avatarccameron <ccameron@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596745}
parent a0d0a733
......@@ -120,9 +120,10 @@ ColorSpace::ColorSpace(const SkColorSpace& sk_color_space)
}
// Use custom primaries, if they are representable as a "to XYZD50" matrix.
if (const auto* to_XYZD50 = sk_color_space.toXYZD50()) {
SkMatrix44 to_XYZD50{SkMatrix44::kUninitialized_Constructor};
if (sk_color_space.toXYZD50(&to_XYZD50)) {
primaries_ = PrimaryID::CUSTOM;
SetCustomPrimaries(*to_XYZD50);
SetCustomPrimaries(to_XYZD50);
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment