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

Unified Diff: ui/display/display.cc

Issue 2950183002: color: Use ICCProfile from display::Display instead of FromBestMonitor (Closed)
Patch Set: Use forced color profile in display::Display ctor Created 3 years, 6 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/display/display.h ('k') | ui/display/mac/screen_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/display.cc
diff --git a/ui/display/display.cc b/ui/display/display.cc
index 4ec8ea0d063f2cdd1f66b41838e7577281b87f43..a86c72034b4fd3281eb258e850d333ba1426b677 100644
--- a/ui/display/display.cc
+++ b/ui/display/display.cc
@@ -16,6 +16,7 @@
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/gfx/geometry/size_conversions.h"
+#include "ui/gfx/icc_profile.h"
namespace display {
namespace {
@@ -57,6 +58,12 @@ float GetForcedDeviceScaleFactorImpl() {
int64_t internal_display_id_ = -1;
+gfx::ColorSpace GetForcedColorSpace() {
+ if (gfx::ICCProfile::HasForcedProfile())
+ return gfx::ICCProfile::GetForcedProfile().GetColorSpace();
+ return gfx::ColorSpace::CreateSRGB();
+}
+
} // namespace
bool CompareDisplayIds(int64_t id1, int64_t id2) {
@@ -108,6 +115,7 @@ Display::Display(int64_t id, const gfx::Rect& bounds)
bounds_(bounds),
work_area_(bounds),
device_scale_factor_(GetForcedDeviceScaleFactor()),
+ color_space_(GetForcedColorSpace()),
color_depth_(DEFAULT_BITS_PER_PIXEL),
depth_per_component_(DEFAULT_BITS_PER_COMPONENT) {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHDR)) {
« no previous file with comments | « ui/display/display.h ('k') | ui/display/mac/screen_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698