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

Unified Diff: ui/display/mac/screen_mac.mm

Issue 2871893002: color: Ensure solid color IOSurface layers are sRGB (Closed)
Patch Set: Fix up deps 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 | « ui/compositor/compositor.cc ('k') | ui/gfx/BUILD.gn » ('j') | ui/gfx/BUILD.gn » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/mac/screen_mac.mm
diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm
index 060d3108ce1195aab0a2b5d5ce46bf253d410fa4..b85236dbeb93c6a65454c0a7bdea22b57c03eb43 100644
--- a/ui/display/mac/screen_mac.mm
+++ b/ui/display/mac/screen_mac.mm
@@ -11,6 +11,7 @@
#include <map>
#include <memory>
+#include "base/command_line.h"
#include "base/logging.h"
#include "base/mac/mac_util.h"
#include "base/mac/sdk_forward_declarations.h"
@@ -19,6 +20,7 @@
#include "ui/display/display.h"
#include "ui/display/display_change_notifier.h"
#include "ui/gfx/mac/coordinate_conversion.h"
+#include "ui/gfx/switches.h"
extern "C" {
Boolean CGDisplayUsesForceToGray(void);
@@ -81,7 +83,10 @@ Display BuildDisplayForScreen(NSScreen* screen) {
// IOSurfaces do not opt-out of color correction.
// https://crbug.com/654488
CGColorSpaceRef color_space = [[screen colorSpace] CGColorSpace];
- if (base::mac::IsAtLeastOS10_12())
+ static bool color_correct_rendering_enabled =
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableColorCorrectRendering);
+ if (base::mac::IsAtLeastOS10_12() && !color_correct_rendering_enabled)
color_space = base::mac::GetSystemColorSpace();
display.set_icc_profile(gfx::ICCProfile::FromCGColorSpace(color_space));
« no previous file with comments | « ui/compositor/compositor.cc ('k') | ui/gfx/BUILD.gn » ('j') | ui/gfx/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698