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

Side by Side Diff: ui/ozone/platform/egltest/ozone_platform_egltest.cc

Issue 281283002: ozone: evdev: Fix cursorless constructor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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 | Annotate | Revision Log
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/ozone/platform/egltest/ozone_platform_egltest.h" 5 #include "ui/ozone/platform/egltest/ozone_platform_egltest.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "library_loaders/libeglplatform_shim.h" 11 #include "library_loaders/libeglplatform_shim.h"
12 #include "ui/base/cursor/ozone/cursor_factory_ozone.h" 12 #include "ui/base/cursor/ozone/cursor_factory_ozone.h"
13 #include "ui/events/ozone/device/device_manager.h"
13 #include "ui/events/ozone/evdev/event_factory_evdev.h" 14 #include "ui/events/ozone/evdev/event_factory_evdev.h"
14 #include "ui/gfx/ozone/impl/file_surface_factory.h" 15 #include "ui/gfx/ozone/impl/file_surface_factory.h"
15 #include "ui/gfx/ozone/surface_ozone_egl.h" 16 #include "ui/gfx/ozone/surface_ozone_egl.h"
16 #include "ui/gfx/vsync_provider.h" 17 #include "ui/gfx/vsync_provider.h"
17 #include "ui/ozone/ime/input_method_context_factory_ozone.h" 18 #include "ui/ozone/ime/input_method_context_factory_ozone.h"
18 #include "ui/ozone/ozone_platform.h" 19 #include "ui/ozone/ozone_platform.h"
19 #include "ui/ozone/ozone_switches.h" 20 #include "ui/ozone/ozone_switches.h"
20 21
21 #if defined(OS_CHROMEOS) 22 #if defined(OS_CHROMEOS)
22 #include "ui/ozone/common/chromeos/native_display_delegate_ozone.h" 23 #include "ui/ozone/common/chromeos/native_display_delegate_ozone.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 199
199 // Test platform for EGL. 200 // Test platform for EGL.
200 // 201 //
201 // This is a tiny EGL-based platform. Creation of the native window is 202 // This is a tiny EGL-based platform. Creation of the native window is
202 // handled by a separate library called eglplatform_shim.so.1 because 203 // handled by a separate library called eglplatform_shim.so.1 because
203 // this itself is platform specific and we want to test out multiple 204 // this itself is platform specific and we want to test out multiple
204 // hardware platforms. 205 // hardware platforms.
205 class OzonePlatformEgltest : public OzonePlatform { 206 class OzonePlatformEgltest : public OzonePlatform {
206 public: 207 public:
207 OzonePlatformEgltest() 208 OzonePlatformEgltest()
208 : surface_factory_ozone_(&eglplatform_shim_), shim_initialized_(false) {} 209 : device_manager_(CreateDeviceManager()),
210 surface_factory_ozone_(&eglplatform_shim_),
211 event_factory_ozone_(NULL, device_manager_.get()),
212 shim_initialized_(false) {}
209 virtual ~OzonePlatformEgltest() { 213 virtual ~OzonePlatformEgltest() {
210 if (shim_initialized_) 214 if (shim_initialized_)
211 eglplatform_shim_.ShimTerminate(); 215 eglplatform_shim_.ShimTerminate();
212 } 216 }
213 217
214 void LoadShim() { 218 void LoadShim() {
215 std::string library = GetShimLibraryName(); 219 std::string library = GetShimLibraryName();
216 220
217 if (eglplatform_shim_.Load(library)) 221 if (eglplatform_shim_.Load(library))
218 return; 222 return;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 254
251 #if defined(OS_CHROMEOS) 255 #if defined(OS_CHROMEOS)
252 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() 256 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
253 OVERRIDE { 257 OVERRIDE {
254 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone()); 258 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone());
255 } 259 }
256 #endif 260 #endif
257 261
258 private: 262 private:
259 LibeglplatformShimLoader eglplatform_shim_; 263 LibeglplatformShimLoader eglplatform_shim_;
264 scoped_ptr<DeviceManager> device_manager_;
260 SurfaceFactoryEgltest surface_factory_ozone_; 265 SurfaceFactoryEgltest surface_factory_ozone_;
261 EventFactoryEvdev event_factory_ozone_; 266 EventFactoryEvdev event_factory_ozone_;
262 InputMethodContextFactoryOzone input_method_context_factory_ozone_; 267 InputMethodContextFactoryOzone input_method_context_factory_ozone_;
263 CursorFactoryOzone cursor_factory_ozone_; 268 CursorFactoryOzone cursor_factory_ozone_;
264 269
265 bool shim_initialized_; 270 bool shim_initialized_;
266 271
267 DISALLOW_COPY_AND_ASSIGN(OzonePlatformEgltest); 272 DISALLOW_COPY_AND_ASSIGN(OzonePlatformEgltest);
268 }; 273 };
269 274
270 } // namespace 275 } // namespace
271 276
272 OzonePlatform* CreateOzonePlatformEgltest() { 277 OzonePlatform* CreateOzonePlatformEgltest() {
273 OzonePlatformEgltest* platform = new OzonePlatformEgltest; 278 OzonePlatformEgltest* platform = new OzonePlatformEgltest;
274 platform->Initialize(); 279 platform->Initialize();
275 return platform; 280 return platform;
276 } 281 }
277 282
278 } // namespace ui 283 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698