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

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

Issue 1878903002: Use injection and remove ozone dependency from ui/display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unique_ptr Created 4 years, 8 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/display_configurator_x11.cc ('k') | ui/display/display.gyp » ('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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 //////////////////////////////////////////////////////////////////////////////// 103 ////////////////////////////////////////////////////////////////////////////////
104 // NativeDisplayDelegateX11 implementation: 104 // NativeDisplayDelegateX11 implementation:
105 105
106 NativeDisplayDelegateX11::NativeDisplayDelegateX11() 106 NativeDisplayDelegateX11::NativeDisplayDelegateX11()
107 : display_(gfx::GetXDisplay()), 107 : display_(gfx::GetXDisplay()),
108 window_(DefaultRootWindow(display_)), 108 window_(DefaultRootWindow(display_)),
109 background_color_argb_(0) {} 109 background_color_argb_(0) {}
110 110
111 NativeDisplayDelegateX11::~NativeDisplayDelegateX11() { 111 NativeDisplayDelegateX11::~NativeDisplayDelegateX11() {
112 if (ui::PlatformEventSource::GetInstance()) { 112 if (ui::PlatformEventSource::GetInstance() &&
113 platform_event_dispatcher_.get()) {
113 ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher( 114 ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(
114 platform_event_dispatcher_.get()); 115 platform_event_dispatcher_.get());
115 } 116 }
116 117
117 STLDeleteContainerPairSecondPointers(modes_.begin(), modes_.end()); 118 STLDeleteContainerPairSecondPointers(modes_.begin(), modes_.end());
118 } 119 }
119 120
120 void NativeDisplayDelegateX11::Initialize() { 121 void NativeDisplayDelegateX11::Initialize() {
121 int error_base_ignored = 0; 122 int error_base_ignored = 0;
122 int xrandr_event_base = 0; 123 int xrandr_event_base = 0;
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 XSetForeground(display_, gc, color.pixel); 655 XSetForeground(display_, gc, color.pixel);
655 XSetFillStyle(display_, gc, FillSolid); 656 XSetFillStyle(display_, gc, FillSolid);
656 int width = DisplayWidth(display_, DefaultScreen(display_)); 657 int width = DisplayWidth(display_, DefaultScreen(display_));
657 int height = DisplayHeight(display_, DefaultScreen(display_)); 658 int height = DisplayHeight(display_, DefaultScreen(display_));
658 XFillRectangle(display_, window_, gc, 0, 0, width, height); 659 XFillRectangle(display_, window_, gc, 0, 0, width, height);
659 XFreeGC(display_, gc); 660 XFreeGC(display_, gc);
660 XFreeColors(display_, colormap, &color.pixel, 1, 0); 661 XFreeColors(display_, colormap, &color.pixel, 1, 0);
661 } 662 }
662 663
663 } // namespace ui 664 } // namespace ui
OLDNEW
« no previous file with comments | « ui/display/chromeos/x11/display_configurator_x11.cc ('k') | ui/display/display.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698