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

Unified Diff: ui/display/display.cc

Issue 2742383006: Display: set color_depth and depth_per_component value based on kEnableHDROutput (Closed)
Patch Set: rebase Created 3 years, 9 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/display/display_switches.h » ('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 fb534b97d5eea94298a478f2b2a3fce77324a534..ae0eb5118995c5a124651956c80f9ee9e52ef613 100644
--- a/ui/display/display.cc
+++ b/ui/display/display.cc
@@ -20,6 +20,12 @@
namespace display {
namespace {
+constexpr int DEFAULT_BITS_PER_PIXEL = 24;
+constexpr int DEFAULT_BITS_PER_COMPONENT = 8;
+
+constexpr int HDR_BITS_PER_PIXEL = 48;
+constexpr int HDR_BITS_PER_COMPONENT = 16;
+
// This variable tracks whether the forced device scale factor switch needs to
// be read from the command line, i.e. if it is set to -1 then the command line
// is checked.
@@ -73,9 +79,6 @@ void Display::ResetForceDeviceScaleFactorForTesting() {
g_forced_device_scale_factor = -1.0;
}
-constexpr int DEFAULT_BITS_PER_PIXEL = 24;
-constexpr int DEFAULT_BITS_PER_COMPONENT = 8;
-
Display::Display() : Display(kInvalidDisplayId) {}
Display::Display(int64_t id) : Display(id, gfx::Rect()) {}
@@ -87,6 +90,10 @@ Display::Display(int64_t id, const gfx::Rect& bounds)
device_scale_factor_(GetForcedDeviceScaleFactor()),
color_depth_(DEFAULT_BITS_PER_PIXEL),
depth_per_component_(DEFAULT_BITS_PER_COMPONENT) {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHDR)) {
+ color_depth_ = HDR_BITS_PER_PIXEL;
+ depth_per_component_ = HDR_BITS_PER_COMPONENT;
+ }
#if defined(USE_AURA)
SetScaleAndBounds(device_scale_factor_, bounds);
#endif
« no previous file with comments | « ui/compositor/compositor.cc ('k') | ui/display/display_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698