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

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

Issue 15830003: Manual Merge 201756 "Changes how to compute the id of a display." (2nd) (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1500/src/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/display.h ('k') | 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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 return kForcedDeviceScaleFactor; 47 return kForcedDeviceScaleFactor;
48 } 48 }
49 49
50 //static 50 //static
51 bool Display::HasForceDeviceScaleFactor() { 51 bool Display::HasForceDeviceScaleFactor() {
52 return HasForceDeviceScaleFactorImpl(); 52 return HasForceDeviceScaleFactorImpl();
53 } 53 }
54 54
55 // static 55 // static
56 int64 Display::GetID(uint16 manufacturer_id, 56 int64 Display::GetID(uint16 manufacturer_id,
57 uint16 product_code, 57 uint32 product_code_hash,
58 uint8 output_index) { 58 uint8 output_index) {
59 int64 new_id = ((static_cast<int64>(manufacturer_id) << 24) | 59 int64 new_id = ((static_cast<int64>(manufacturer_id) << 40) |
60 (static_cast<int64>(product_code) << 8) | output_index); 60 (static_cast<int64>(product_code_hash) << 8) | output_index);
61 DCHECK_NE(kInvalidDisplayID, new_id); 61 DCHECK_NE(kInvalidDisplayID, new_id);
62 return new_id; 62 return new_id;
63 } 63 }
64 64
65 Display::Display() 65 Display::Display()
66 : id_(kInvalidDisplayID), 66 : id_(kInvalidDisplayID),
67 device_scale_factor_(GetForcedDeviceScaleFactor()), 67 device_scale_factor_(GetForcedDeviceScaleFactor()),
68 rotation_(ROTATE_0) { 68 rotation_(ROTATE_0) {
69 } 69 }
70 70
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 151
152 int64 Display::InternalDisplayId() { 152 int64 Display::InternalDisplayId() {
153 return internal_display_id_; 153 return internal_display_id_;
154 } 154 }
155 155
156 void Display::SetInternalDisplayId(int64 internal_display_id) { 156 void Display::SetInternalDisplayId(int64 internal_display_id) {
157 internal_display_id_ = internal_display_id; 157 internal_display_id_ = internal_display_id;
158 } 158 }
159 159
160 } // namespace gfx 160 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/display.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698