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

Unified Diff: ui/gfx/color_transform.cc

Issue 2697863003: color: Clarify default behaviors (Closed)
Patch Set: Do less 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
Index: ui/gfx/color_transform.cc
diff --git a/ui/gfx/color_transform.cc b/ui/gfx/color_transform.cc
index 49a3026c895e13c33926b613c6724dc4e45d723c..e427ad709526b11b6855c0c583667b62dabd9ac1 100644
--- a/ui/gfx/color_transform.cc
+++ b/ui/gfx/color_transform.cc
@@ -686,6 +686,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;

Powered by Google App Engine
This is Rietveld 408576698