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