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

Side by Side Diff: ui/display/chromeos/x11/native_display_delegate_x11.cc

Issue 2324163002: Add FakeDisplayDelegate for off device usage. (Closed)
Patch Set: Fix windows compile problems. Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « ui/display/chromeos/x11/native_display_delegate_x11.h ('k') | ui/display/display_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 } 275 }
276 276
277 void NativeDisplayDelegateX11::AddObserver(NativeDisplayObserver* observer) { 277 void NativeDisplayDelegateX11::AddObserver(NativeDisplayObserver* observer) {
278 observers_.AddObserver(observer); 278 observers_.AddObserver(observer);
279 } 279 }
280 280
281 void NativeDisplayDelegateX11::RemoveObserver(NativeDisplayObserver* observer) { 281 void NativeDisplayDelegateX11::RemoveObserver(NativeDisplayObserver* observer) {
282 observers_.RemoveObserver(observer); 282 observers_.RemoveObserver(observer);
283 } 283 }
284 284
285 display::FakeDisplayController*
286 NativeDisplayDelegateX11::GetFakeDisplayController() {
287 return nullptr;
288 }
289
285 void NativeDisplayDelegateX11::InitModes() { 290 void NativeDisplayDelegateX11::InitModes() {
286 CHECK(screen_) << "Server not grabbed"; 291 CHECK(screen_) << "Server not grabbed";
287 292
288 base::STLDeleteContainerPairSecondPointers(modes_.begin(), modes_.end()); 293 base::STLDeleteContainerPairSecondPointers(modes_.begin(), modes_.end());
289 modes_.clear(); 294 modes_.clear();
290 295
291 for (int i = 0; i < screen_->nmode; ++i) { 296 for (int i = 0; i < screen_->nmode; ++i) {
292 const XRRModeInfo& info = screen_->modes[i]; 297 const XRRModeInfo& info = screen_->modes[i];
293 float refresh_rate = 0.0f; 298 float refresh_rate = 0.0f;
294 if (info.hTotal && info.vTotal) { 299 if (info.hTotal && info.vTotal) {
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 XSetForeground(display_, gc, color.pixel); 660 XSetForeground(display_, gc, color.pixel);
656 XSetFillStyle(display_, gc, FillSolid); 661 XSetFillStyle(display_, gc, FillSolid);
657 int width = DisplayWidth(display_, DefaultScreen(display_)); 662 int width = DisplayWidth(display_, DefaultScreen(display_));
658 int height = DisplayHeight(display_, DefaultScreen(display_)); 663 int height = DisplayHeight(display_, DefaultScreen(display_));
659 XFillRectangle(display_, window_, gc, 0, 0, width, height); 664 XFillRectangle(display_, window_, gc, 0, 0, width, height);
660 XFreeGC(display_, gc); 665 XFreeGC(display_, gc);
661 XFreeColors(display_, colormap, &color.pixel, 1, 0); 666 XFreeColors(display_, colormap, &color.pixel, 1, 0);
662 } 667 }
663 668
664 } // namespace ui 669 } // namespace ui
OLDNEW
« no previous file with comments | « ui/display/chromeos/x11/native_display_delegate_x11.h ('k') | ui/display/display_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698