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

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

Issue 186733009: Avoid repeated command-line checks for forced DPI scale (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Name tweak Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/gfx/display.h" 5 #include "ui/gfx/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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 // static 45 // static
46 float Display::GetForcedDeviceScaleFactor() { 46 float Display::GetForcedDeviceScaleFactor() {
47 static const float kForcedDeviceScaleFactor = 47 static const float kForcedDeviceScaleFactor =
48 GetForcedDeviceScaleFactorImpl(); 48 GetForcedDeviceScaleFactorImpl();
49 return kForcedDeviceScaleFactor; 49 return kForcedDeviceScaleFactor;
50 } 50 }
51 51
52 //static 52 //static
53 bool Display::HasForceDeviceScaleFactor() { 53 bool Display::HasForceDeviceScaleFactor() {
54 return HasForceDeviceScaleFactorImpl(); 54 static const bool kHasForceDeviceScaleFactor =
55 HasForceDeviceScaleFactorImpl();
56 return kHasForceDeviceScaleFactor;
55 } 57 }
56 58
57 Display::Display() 59 Display::Display()
58 : id_(kInvalidDisplayID), 60 : id_(kInvalidDisplayID),
59 device_scale_factor_(GetForcedDeviceScaleFactor()), 61 device_scale_factor_(GetForcedDeviceScaleFactor()),
60 rotation_(ROTATE_0), 62 rotation_(ROTATE_0),
61 touch_support_(TOUCH_SUPPORT_UNKNOWN) { 63 touch_support_(TOUCH_SUPPORT_UNKNOWN) {
62 } 64 }
63 65
64 Display::Display(int64 id) 66 Display::Display(int64 id)
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 148
147 int64 Display::InternalDisplayId() { 149 int64 Display::InternalDisplayId() {
148 return internal_display_id_; 150 return internal_display_id_;
149 } 151 }
150 152
151 void Display::SetInternalDisplayId(int64 internal_display_id) { 153 void Display::SetInternalDisplayId(int64 internal_display_id) {
152 internal_display_id_ = internal_display_id; 154 internal_display_id_ = internal_display_id;
153 } 155 }
154 156
155 } // namespace gfx 157 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698