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

Unified Diff: ui/gfx/color_transform.cc

Issue 2697863003: color: Clarify default behaviors (Closed)
Patch Set: Incorporate review feedback 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 | « ui/gfx/color_space_win.cc ('k') | ui/gfx/color_transform_unittest.cc » ('j') | 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 49a3026c895e13c33926b613c6724dc4e45d723c..e88f3a56b92cedc78ef39b696e39653d75a24f23 100644
--- a/ui/gfx/color_transform.cc
+++ b/ui/gfx/color_transform.cc
@@ -542,7 +542,6 @@ void ColorTransformInternal::AppendColorSpaceToColorSpaceTransform(
ColorTransform::Intent intent) {
if (intent == ColorTransform::Intent::INTENT_PERCEPTUAL) {
switch (from.transfer_) {
- case ColorSpace::TransferID::UNSPECIFIED:
case ColorSpace::TransferID::BT709:
case ColorSpace::TransferID::SMPTE170M:
// SMPTE 1886 suggests that we should be using gamma 2.4 for BT709
@@ -686,6 +685,11 @@ ScopedQcmsProfile GetXYZD50Profile() {
ColorTransformInternal::ColorTransformInternal(const ColorSpace& from,
const ColorSpace& to,
Intent intent) {
+ // If no source color space is specified, do no transformation.
+ // TODO(ccameron): We may want to assume sRGB at some point in the future.
+ if (!from.IsValid())
+ return;
+
ScopedQcmsProfile from_profile = GetQCMSProfileIfAvailable(from);
ScopedQcmsProfile to_profile = GetQCMSProfileIfAvailable(to);
bool has_from_profile = !!from_profile;
« no previous file with comments | « ui/gfx/color_space_win.cc ('k') | ui/gfx/color_transform_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698