| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 DisplaySnapshotX11* output = | 185 DisplaySnapshotX11* output = |
| 186 InitDisplaySnapshot(output_id, output_info, &last_used_crtcs, i); | 186 InitDisplaySnapshot(output_id, output_info, &last_used_crtcs, i); |
| 187 cached_outputs_.push_back(output); | 187 cached_outputs_.push_back(output); |
| 188 } | 188 } |
| 189 XRRFreeOutputInfo(output_info); | 189 XRRFreeOutputInfo(output_info); |
| 190 } | 190 } |
| 191 | 191 |
| 192 return cached_outputs_.get(); | 192 return cached_outputs_.get(); |
| 193 } | 193 } |
| 194 | 194 |
| 195 void NativeDisplayDelegateX11::GetDisplays( |
| 196 const GetDisplaysCallback& callback) { |
| 197 callback.Run(GetDisplays()); |
| 198 } |
| 199 |
| 195 void NativeDisplayDelegateX11::AddMode(const DisplaySnapshot& output, | 200 void NativeDisplayDelegateX11::AddMode(const DisplaySnapshot& output, |
| 196 const DisplayMode* mode) { | 201 const DisplayMode* mode) { |
| 197 CHECK(screen_) << "Server not grabbed"; | 202 CHECK(screen_) << "Server not grabbed"; |
| 198 CHECK(mode) << "Must add valid mode"; | 203 CHECK(mode) << "Must add valid mode"; |
| 199 | 204 |
| 200 const DisplaySnapshotX11& x11_output = | 205 const DisplaySnapshotX11& x11_output = |
| 201 static_cast<const DisplaySnapshotX11&>(output); | 206 static_cast<const DisplaySnapshotX11&>(output); |
| 202 RRMode mode_id = static_cast<const DisplayModeX11*>(mode)->mode_id(); | 207 RRMode mode_id = static_cast<const DisplayModeX11*>(mode)->mode_id(); |
| 203 | 208 |
| 204 VLOG(1) << "AddDisplayMode: output=" << x11_output.output() | 209 VLOG(1) << "AddDisplayMode: output=" << x11_output.output() |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 XSetForeground(display_, gc, color.pixel); | 652 XSetForeground(display_, gc, color.pixel); |
| 648 XSetFillStyle(display_, gc, FillSolid); | 653 XSetFillStyle(display_, gc, FillSolid); |
| 649 int width = DisplayWidth(display_, DefaultScreen(display_)); | 654 int width = DisplayWidth(display_, DefaultScreen(display_)); |
| 650 int height = DisplayHeight(display_, DefaultScreen(display_)); | 655 int height = DisplayHeight(display_, DefaultScreen(display_)); |
| 651 XFillRectangle(display_, window_, gc, 0, 0, width, height); | 656 XFillRectangle(display_, window_, gc, 0, 0, width, height); |
| 652 XFreeGC(display_, gc); | 657 XFreeGC(display_, gc); |
| 653 XFreeColors(display_, colormap, &color.pixel, 1, 0); | 658 XFreeColors(display_, colormap, &color.pixel, 1, 0); |
| 654 } | 659 } |
| 655 | 660 |
| 656 } // namespace ui | 661 } // namespace ui |
| OLD | NEW |