OLD | NEW |
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/chromeos/x11/native_display_delegate_x11.h" | 5 #include "ui/display/chromeos/x11/native_display_delegate_x11.h" |
6 | 6 |
7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 #include <X11/extensions/dpms.h> | 9 #include <X11/extensions/dpms.h> |
10 #include <X11/extensions/Xrandr.h> | 10 #include <X11/extensions/Xrandr.h> |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 info.id))); | 304 info.id))); |
305 } | 305 } |
306 } | 306 } |
307 | 307 |
308 DisplaySnapshotX11* NativeDisplayDelegateX11::InitDisplaySnapshot( | 308 DisplaySnapshotX11* NativeDisplayDelegateX11::InitDisplaySnapshot( |
309 RROutput output, | 309 RROutput output, |
310 XRROutputInfo* info, | 310 XRROutputInfo* info, |
311 std::set<RRCrtc>* last_used_crtcs, | 311 std::set<RRCrtc>* last_used_crtcs, |
312 int index) { | 312 int index) { |
313 int64_t display_id = 0; | 313 int64_t display_id = 0; |
314 if (!GetDisplayId(output, static_cast<uint8_t>(index), &display_id)) | 314 ui::EDIDParserX11 edid_parser(output); |
| 315 if (!edid_parser.GetDisplayId(static_cast<uint8_t>(index), &display_id)) |
315 display_id = index; | 316 display_id = index; |
316 | 317 |
317 bool has_overscan = false; | 318 bool has_overscan = false; |
318 GetOutputOverscanFlag(output, &has_overscan); | 319 edid_parser.GetOutputOverscanFlag(&has_overscan); |
319 | 320 |
320 DisplayConnectionType type = GetDisplayConnectionTypeFromName(info->name); | 321 DisplayConnectionType type = GetDisplayConnectionTypeFromName(info->name); |
321 if (type == DISPLAY_CONNECTION_TYPE_UNKNOWN) | 322 if (type == DISPLAY_CONNECTION_TYPE_UNKNOWN) |
322 LOG(ERROR) << "Unknown link type: " << info->name; | 323 LOG(ERROR) << "Unknown link type: " << info->name; |
323 | 324 |
324 RRMode native_mode_id = GetOutputNativeMode(info); | 325 RRMode native_mode_id = GetOutputNativeMode(info); |
325 RRMode current_mode_id = None; | 326 RRMode current_mode_id = None; |
326 gfx::Point origin; | 327 gfx::Point origin; |
327 if (info->crtc) { | 328 if (info->crtc) { |
328 XRRCrtcInfo* crtc_info = | 329 XRRCrtcInfo* crtc_info = |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 } | 361 } |
361 } | 362 } |
362 | 363 |
363 DisplaySnapshotX11* display_snapshot = | 364 DisplaySnapshotX11* display_snapshot = |
364 new DisplaySnapshotX11(display_id, | 365 new DisplaySnapshotX11(display_id, |
365 origin, | 366 origin, |
366 gfx::Size(info->mm_width, info->mm_height), | 367 gfx::Size(info->mm_width, info->mm_height), |
367 type, | 368 type, |
368 IsOutputAspectPreservingScaling(output), | 369 IsOutputAspectPreservingScaling(output), |
369 has_overscan, | 370 has_overscan, |
370 GetDisplayName(output), | 371 edid_parser.GetDisplayName(), |
371 display_modes, | 372 display_modes, |
| 373 edid_parser.edid(), |
372 current_mode, | 374 current_mode, |
373 native_mode, | 375 native_mode, |
374 output, | 376 output, |
375 crtc, | 377 crtc, |
376 index); | 378 index); |
377 | 379 |
378 VLOG(1) << "Found display " << cached_outputs_.size() << ":" | 380 VLOG(1) << "Found display " << cached_outputs_.size() << ":" |
379 << " output=" << output << " crtc=" << crtc | 381 << " output=" << output << " crtc=" << crtc |
380 << " current_mode=" << current_mode_id; | 382 << " current_mode=" << current_mode_id; |
381 | 383 |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 XSetForeground(display_, gc, color.pixel); | 652 XSetForeground(display_, gc, color.pixel); |
651 XSetFillStyle(display_, gc, FillSolid); | 653 XSetFillStyle(display_, gc, FillSolid); |
652 int width = DisplayWidth(display_, DefaultScreen(display_)); | 654 int width = DisplayWidth(display_, DefaultScreen(display_)); |
653 int height = DisplayHeight(display_, DefaultScreen(display_)); | 655 int height = DisplayHeight(display_, DefaultScreen(display_)); |
654 XFillRectangle(display_, window_, gc, 0, 0, width, height); | 656 XFillRectangle(display_, window_, gc, 0, 0, width, height); |
655 XFreeGC(display_, gc); | 657 XFreeGC(display_, gc); |
656 XFreeColors(display_, colormap, &color.pixel, 1, 0); | 658 XFreeColors(display_, colormap, &color.pixel, 1, 0); |
657 } | 659 } |
658 | 660 |
659 } // namespace ui | 661 } // namespace ui |
OLD | NEW |