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

Unified Diff: ui/ozone/common/display_util.cc

Issue 1131813003: [2/2][Ozone-Drm] Scan for displays on browser size during startup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@handle-display-init3
Patch Set: rebased 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/ozone/common/display_util.h ('k') | ui/ozone/common/display_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/common/display_util.cc
diff --git a/ui/ozone/common/display_util.cc b/ui/ozone/common/display_util.cc
index 4ce67c0b840349634ede792d61713b0b9d5f12a1..5e853bcef0cad8b169d2dfbbe5f7189b8618b267 100644
--- a/ui/ozone/common/display_util.cc
+++ b/ui/ozone/common/display_util.cc
@@ -96,50 +96,4 @@ bool CreateSnapshotFromCommandLine(DisplaySnapshot_Params* snapshot_out) {
return true;
}
-bool CreateSnapshotFromEDID(bool internal,
- const std::vector<uint8_t>& edid,
- DisplaySnapshot_Params* snapshot_out) {
- uint16_t manufacturer_id = 0;
- gfx::Size resolution;
-
- DisplayMode_Params mode_param;
- mode_param.refresh_rate = 60.0f;
-
- if (!ParseOutputDeviceData(edid, &manufacturer_id,
- &snapshot_out->display_name, &mode_param.size,
- &snapshot_out->physical_size) ||
- !GetDisplayIdFromEDID(edid, 0, &snapshot_out->display_id)) {
- return false;
- }
- ParseOutputOverscanFlag(edid, &snapshot_out->has_overscan);
-
- snapshot_out->modes.push_back(mode_param);
- // Use VGA for external display for now.
- // TODO(oshima): frecon should set this value in the display_info.bin file.
- snapshot_out->type =
- internal ? DISPLAY_CONNECTION_TYPE_INTERNAL : DISPLAY_CONNECTION_TYPE_VGA;
- snapshot_out->has_current_mode = true;
- snapshot_out->current_mode = mode_param;
- snapshot_out->has_native_mode = true;
- snapshot_out->native_mode = mode_param;
- return true;
-}
-
-bool CreateSnapshotFromEDIDFile(const base::FilePath& file,
- DisplaySnapshot_Params* snapshot_out) {
- std::string raw_display_info;
- const int kEDIDMaxSize = 128;
- if (!base::ReadFileToString(file, &raw_display_info, kEDIDMaxSize + 1) ||
- raw_display_info.size() < 10) {
- return false;
- }
- std::vector<uint8_t> edid;
- // The head of the file contains one byte flag that indicates the type of
- // display.
- bool internal = raw_display_info[0] == 1;
- edid.assign(raw_display_info.c_str() + 1,
- raw_display_info.c_str() + raw_display_info.size());
- return CreateSnapshotFromEDID(internal, edid, snapshot_out);
-}
-
} // namespace ui
« no previous file with comments | « ui/ozone/common/display_util.h ('k') | ui/ozone/common/display_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698