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

Unified Diff: ui/gfx/color_transform.cc

Issue 2705223003: color: Fix accidental partial color conversion (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/color_transform.cc
diff --git a/ui/gfx/color_transform.cc b/ui/gfx/color_transform.cc
index 1d562d48401ec84c1b60a4d3f80bfb59954f310a..815e57cea5fda962932d0158a8ee6564de961861 100644
--- a/ui/gfx/color_transform.cc
+++ b/ui/gfx/color_transform.cc
@@ -618,7 +618,8 @@ void ColorTransformInternal::AppendColorSpaceToColorSpaceTransform(
base::MakeUnique<ColorTransformMatrix>(Invert(GetTransferMatrix(from))));
// If the target color space is not defined, just apply the adjust and
- // tranfer matrices.
+ // tranfer matrices. This path is used by YUV to RGB color conversion
+ // when full color conversion is not enabled.
if (!to.IsValid())
return;
@@ -732,8 +733,15 @@ ColorTransformInternal::ColorTransformInternal(const ColorSpace& src,
if (!src_.IsValid())
return;
- ScopedQcmsProfile src_profile = GetQCMSProfileIfNecessary(src_);
- ScopedQcmsProfile dst_profile = GetQCMSProfileIfNecessary(dst_);
+ // If the target color space is not defined, just apply the adjust and
+ // tranfer matrices. This path is used by YUV to RGB color conversion
+ // when full color conversion is not enabled.
+ ScopedQcmsProfile src_profile;
+ ScopedQcmsProfile dst_profile;
+ if (dst.IsValid()) {
+ src_profile = GetQCMSProfileIfNecessary(src_);
+ dst_profile = GetQCMSProfileIfNecessary(dst_);
+ }
bool has_src_profile = !!src_profile;
bool has_dst_profile = !!dst_profile;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698