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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 2496913003: Display linear-srgb color managed canvas (Closed)
Patch Set: Created 4 years, 1 month 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: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 1aad8e4acf9d0c2508c00c8a2f560735be0f0d1c..1648cfb376b96d9962b89cbae273cf321912fc39 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -88,6 +88,8 @@ LayerTreeImpl::LayerTreeImpl(
top_controls_height_(0),
bottom_controls_height_(0),
top_controls_shown_ratio_(top_controls_shown_ratio) {
+ if (layer_tree_host_impl_->settings().enable_color_correct_rendering)
+ device_color_space_ = gfx::ColorSpace::CreateSRGB();
property_trees()->is_main_thread = false;
}
@@ -872,6 +874,15 @@ void LayerTreeImpl::SetDeviceColorSpace(
const gfx::ColorSpace& device_color_space) {
if (device_color_space == device_color_space_)
return;
+
+ // If color correct rendering is enabled, the default color space must be
+ // SRGB.
+ if (layer_tree_host_impl_->settings().enable_color_correct_rendering &&
+ device_color_space == gfx::ColorSpace()) {
+ device_color_space_ = gfx::ColorSpace::CreateSRGB();
+ return;
+ }
+
device_color_space_ = device_color_space;
}

Powered by Google App Engine
This is Rietveld 408576698