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

Side by Side Diff: ui/display/display.cc

Issue 2950183002: color: Use ICCProfile from display::Display instead of FromBestMonitor (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/display/display.h" 5 #include "ui/display/display.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 : id_(id), 107 : id_(id),
108 bounds_(bounds), 108 bounds_(bounds),
109 work_area_(bounds), 109 work_area_(bounds),
110 device_scale_factor_(GetForcedDeviceScaleFactor()), 110 device_scale_factor_(GetForcedDeviceScaleFactor()),
111 color_depth_(DEFAULT_BITS_PER_PIXEL), 111 color_depth_(DEFAULT_BITS_PER_PIXEL),
112 depth_per_component_(DEFAULT_BITS_PER_COMPONENT) { 112 depth_per_component_(DEFAULT_BITS_PER_COMPONENT) {
113 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHDR)) { 113 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHDR)) {
114 color_depth_ = HDR_BITS_PER_PIXEL; 114 color_depth_ = HDR_BITS_PER_PIXEL;
115 depth_per_component_ = HDR_BITS_PER_COMPONENT; 115 depth_per_component_ = HDR_BITS_PER_COMPONENT;
116 } 116 }
117 // TODO(ccameron): Populate this in platform-specific code.
118 icc_profile_ = gfx::ICCProfile::FromBestMonitor();
119 if (!icc_profile_.IsValid())
120 icc_profile_ = gfx::ICCProfile::CreateSRGB();
121
117 #if defined(USE_AURA) 122 #if defined(USE_AURA)
118 SetScaleAndBounds(device_scale_factor_, bounds); 123 SetScaleAndBounds(device_scale_factor_, bounds);
119 #endif 124 #endif
120 } 125 }
121 126
122 Display::Display(const Display& other) = default; 127 Display::Display(const Display& other) = default;
123 128
124 Display::~Display() {} 129 Display::~Display() {}
125 130
126 int Display::RotationAsDegree() const { 131 int Display::RotationAsDegree() const {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 DCHECK_NE(kInvalidDisplayId, display_id); 239 DCHECK_NE(kInvalidDisplayId, display_id);
235 return HasInternalDisplay() && internal_display_id_ == display_id; 240 return HasInternalDisplay() && internal_display_id_ == display_id;
236 } 241 }
237 242
238 // static 243 // static
239 bool Display::HasInternalDisplay() { 244 bool Display::HasInternalDisplay() {
240 return internal_display_id_ != kInvalidDisplayId; 245 return internal_display_id_ != kInvalidDisplayId;
241 } 246 }
242 247
243 } // namespace display 248 } // namespace display
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698