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

Unified Diff: ui/display/util/edid_parser.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/display/util/display_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/util/edid_parser.cc
diff --git a/ui/display/util/edid_parser.cc b/ui/display/util/edid_parser.cc
index 097cc1ecb6f3c4e02f455acf7b457e6ce8dc6f19..37031c861d27a77ea1b654a3315c672977bd4e69 100644
--- a/ui/display/util/edid_parser.cc
+++ b/ui/display/util/edid_parser.cc
@@ -9,26 +9,13 @@
#include "base/hash.h"
#include "base/strings/string_util.h"
#include "base/sys_byteorder.h"
+#include "ui/display/util/display_util.h"
#include "ui/gfx/geometry/size.h"
namespace ui {
namespace {
-// Returns 64-bit persistent ID for the specified manufacturer's ID and
-// product_code_hash, and the index of the output it is connected to.
-// |output_index| is used to distinguish the displays of the same type. For
-// example, swapping two identical display between two outputs will not be
-// treated as swap. The 'serial number' field in EDID isn't used here because
-// it is not guaranteed to have unique number and it may have the same fixed
-// value (like 0).
-int64_t GetID(uint16_t manufacturer_id,
- uint32_t product_code_hash,
- uint8_t output_index) {
- return ((static_cast<int64_t>(manufacturer_id) << 40) |
- (static_cast<int64_t>(product_code_hash) << 8) | output_index);
-}
-
// Returns a 32-bit identifier for this model of display, using
// |manufacturer_id| and |product_code|.
uint32_t GetProductID(uint16_t manufacturer_id, uint16_t product_code) {
@@ -58,8 +45,8 @@ bool GetDisplayIdFromEDID(const std::vector<uint8_t>& edid,
product_name.empty() ? 0 : base::Hash(product_name);
// An ID based on display's index will be assigned later if this call
// fails.
- *display_id_out = GetID(
- manufacturer_id, product_code_hash, output_index);
+ *display_id_out =
+ GenerateDisplayID(manufacturer_id, product_code_hash, output_index);
// product_id is 64-bit signed so it can store -1 as kInvalidProductID and
// not match a valid product id which will all be in the lowest 32-bits.
if (product_id_out)
« no previous file with comments | « ui/display/util/display_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698