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

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

Issue 1456623002: Add support for virtual displays (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use std::max as suggested by oshima@ Created 5 years 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 | « ui/display/util/display_util.h ('k') | ui/display/util/edid_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/util/display_util.h" 5 #include "ui/display/util/display_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 return 1.0f; 61 return 1.0f;
62 62
63 const unsigned int dpi = static_cast<unsigned int>( 63 const unsigned int dpi = static_cast<unsigned int>(
64 kInchInMm * screen_size_in_pixels.width() / physical_size_in_mm.width()); 64 kInchInMm * screen_size_in_pixels.width() / physical_size_in_mm.width());
65 const unsigned int threshold = 65 const unsigned int threshold =
66 (physical_size_in_mm.width() >= kLargeDisplayWidthThresholdMM) ? 66 (physical_size_in_mm.width() >= kLargeDisplayWidthThresholdMM) ?
67 kHighDensityDPIThresholdLarge : kHighDensityDPIThresholdSmall; 67 kHighDensityDPIThresholdLarge : kHighDensityDPIThresholdSmall;
68 return (dpi > threshold) ? 2.0f : 1.0f; 68 return (dpi > threshold) ? 2.0f : 1.0f;
69 } 69 }
70 70
71 int64_t GenerateDisplayID(uint16_t manufacturer_id,
72 uint32_t product_code_hash,
73 uint8_t output_index) {
74 return ((static_cast<int64_t>(manufacturer_id) << 40) |
75 (static_cast<int64_t>(product_code_hash) << 8) | output_index);
76 }
77
71 } // namespace ui 78 } // namespace ui
OLDNEW
« no previous file with comments | « ui/display/util/display_util.h ('k') | ui/display/util/edid_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698