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

Unified Diff: ui/display/util/edid_parser.cc

Issue 1129863003: Load ICC file for display color correction based on display product identifier (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nuked extra {} Created 5 years, 7 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/display/util/edid_parser.h ('k') | ui/display/util/edid_parser_unittest.cc » ('j') | 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 97aa77c1ed40b48fca3e804a9d489504f4e94e33..974b4256e7e6a645801677807a0257d6ca129d1e 100644
--- a/ui/display/util/edid_parser.cc
+++ b/ui/display/util/edid_parser.cc
@@ -29,11 +29,19 @@ int64_t GetID(uint16_t manufacturer_id,
(static_cast<int64_t>(product_code_hash) << 8) | output_index);
}
+// Returns a 64-bit identifier for this model of display, using
+// |manufacturer_id| and |product_code_hash|.
+int64_t GetProductID(uint16_t manufacturer_id, uint32_t product_code_hash) {
+ return ((static_cast<int64_t>(manufacturer_id) << 32) |
+ (static_cast<int64_t>(product_code_hash)));
+}
+
} // namespace
bool GetDisplayIdFromEDID(const std::vector<uint8_t>& edid,
uint8_t output_index,
- int64_t* display_id_out) {
+ int64_t* display_id_out,
+ int64_t* product_id_out) {
uint16_t manufacturer_id = 0;
std::string product_name;
@@ -50,6 +58,8 @@ bool GetDisplayIdFromEDID(const std::vector<uint8_t>& edid,
// fails.
*display_id_out = GetID(
manufacturer_id, product_code_hash, output_index);
+ if (product_id_out)
+ *product_id_out = GetProductID(manufacturer_id, product_code_hash);
return true;
}
return false;
« no previous file with comments | « ui/display/util/edid_parser.h ('k') | ui/display/util/edid_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698