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

Unified Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 2873333002: mac color: Use sRGB for native controls instead of device RGB (Closed)
Patch Set: And roll in the image decode bit Created 3 years, 7 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 | third_party/WebKit/Source/core/layout/LayoutThemeMac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 41ad2796fe47239642a4c577920fcc2eb9798ec2..b3c9e6f811932e2492f276b343ada60e17a6e6c1 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -317,15 +317,25 @@ bool RenderViewHostImpl::CreateRenderView(
params->min_size = GetWidget()->min_size_for_auto_resize();
params->max_size = GetWidget()->max_size_for_auto_resize();
params->page_zoom_level = delegate_->GetPendingPageZoomLevel();
- params->image_decode_color_space = gfx::ICCProfile::FromBestMonitor();
+ bool force_srgb_image_decode_color_space = false;
// Pretend that HDR displays are sRGB so that we do not have inconsistent
// coloring.
// TODO(ccameron): Disable this once color correct rasterization is functional
// https://crbug.com/701942
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHDR)) {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHDR))
+ force_srgb_image_decode_color_space = true;
+ // When color correct rendering is enabled, the image_decode_color_space
+ // parameter should not be used (and all users of it should be using sRGB).
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableColorCorrectRendering)) {
+ force_srgb_image_decode_color_space = true;
+ }
+ if (force_srgb_image_decode_color_space) {
gfx::ColorSpace::CreateSRGB().GetICCProfile(
&params->image_decode_color_space);
+ } else {
+ params->image_decode_color_space = gfx::ICCProfile::FromBestMonitor();
}
GetWidget()->GetResizeParams(&params->initial_size);
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutThemeMac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698