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

Side by Side Diff: ui/ozone/platform/x11/ozone_platform_x11.cc

Issue 2629983002: Fix the MessageLoop type in case more than one ozone platform is built (Closed)
Patch Set: addressed moar sadrul/kylechar's feedback Created 3 years, 10 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/ozone/platform/x11/ozone_platform_x11.h" 5 #include "ui/ozone/platform/x11/ozone_platform_x11.h"
6 6
7 #include <X11/Xlib.h> 7 #include <X11/Xlib.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 cursor_factory_ozone_.reset(new X11CursorFactoryOzone()); 97 cursor_factory_ozone_.reset(new X11CursorFactoryOzone());
98 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); 98 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost());
99 } 99 }
100 100
101 void InitializeGPU() override { 101 void InitializeGPU() override {
102 if (!event_source_) 102 if (!event_source_)
103 event_source_.reset(new X11EventSourceLibevent(gfx::GetXDisplay())); 103 event_source_.reset(new X11EventSourceLibevent(gfx::GetXDisplay()));
104 surface_factory_ozone_.reset(new X11SurfaceFactory()); 104 surface_factory_ozone_.reset(new X11SurfaceFactory());
105 } 105 }
106 106
107 base::MessageLoop::Type GetMessageLoopTypeForGpu() override {
108 // If we are be running Ozone X11 we need a UI loop to grab Expose events.
109 // See GLSurfaceGLX and https://crbug.com/326995.
fwang 2017/02/07 17:03:46 "we are running" grab or Expose?
110 return base::MessageLoop::TYPE_UI;
111 }
112
107 private: 113 private:
108 // Objects in the browser process. 114 // Objects in the browser process.
109 std::unique_ptr<X11WindowManagerOzone> window_manager_; 115 std::unique_ptr<X11WindowManagerOzone> window_manager_;
110 std::unique_ptr<OverlayManagerOzone> overlay_manager_; 116 std::unique_ptr<OverlayManagerOzone> overlay_manager_;
111 std::unique_ptr<InputController> input_controller_; 117 std::unique_ptr<InputController> input_controller_;
112 std::unique_ptr<X11CursorFactoryOzone> cursor_factory_ozone_; 118 std::unique_ptr<X11CursorFactoryOzone> cursor_factory_ozone_;
113 std::unique_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; 119 std::unique_ptr<GpuPlatformSupportHost> gpu_platform_support_host_;
114 120
115 // Objects in the GPU process. 121 // Objects in the GPU process.
116 std::unique_ptr<X11SurfaceFactory> surface_factory_ozone_; 122 std::unique_ptr<X11SurfaceFactory> surface_factory_ozone_;
117 123
118 // Objects in both browser and GPU process. 124 // Objects in both browser and GPU process.
119 std::unique_ptr<X11EventSourceLibevent> event_source_; 125 std::unique_ptr<X11EventSourceLibevent> event_source_;
120 126
121 DISALLOW_COPY_AND_ASSIGN(OzonePlatformX11); 127 DISALLOW_COPY_AND_ASSIGN(OzonePlatformX11);
122 }; 128 };
123 129
124 } // namespace 130 } // namespace
125 131
126 OzonePlatform* CreateOzonePlatformX11() { 132 OzonePlatform* CreateOzonePlatformX11() {
127 return new OzonePlatformX11; 133 return new OzonePlatformX11;
128 } 134 }
129 135
130 } // namespace ui 136 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698