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

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

Issue 338193003: ozone: gpu: Add plumbing for platform-specific gpu messaging (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: get instance via OzonePlatform Created 6 years, 6 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/device/device_manager.h"
14 #include "ui/events/ozone/evdev/event_factory_evdev.h" 14 #include "ui/events/ozone/evdev/event_factory_evdev.h"
15 #include "ui/gfx/ozone/impl/file_surface_factory.h" 15 #include "ui/gfx/ozone/impl/file_surface_factory.h"
16 #include "ui/gfx/ozone/surface_ozone_egl.h" 16 #include "ui/gfx/ozone/surface_ozone_egl.h"
17 #include "ui/gfx/vsync_provider.h" 17 #include "ui/gfx/vsync_provider.h"
18 #include "ui/ozone/gpu/gpu_platform_support.h"
19 #include "ui/ozone/gpu/gpu_platform_support_host.h"
18 #include "ui/ozone/ozone_platform.h" 20 #include "ui/ozone/ozone_platform.h"
19 #include "ui/ozone/ozone_switches.h" 21 #include "ui/ozone/ozone_switches.h"
20 22
21 #if defined(OS_CHROMEOS) 23 #if defined(OS_CHROMEOS)
22 #include "ui/ozone/common/chromeos/native_display_delegate_ozone.h" 24 #include "ui/ozone/common/chromeos/native_display_delegate_ozone.h"
23 #include "ui/ozone/common/chromeos/touchscreen_device_manager_ozone.h" 25 #include "ui/ozone/common/chromeos/touchscreen_device_manager_ozone.h"
24 #endif 26 #endif
25 27
26 #include <EGL/egl.h> 28 #include <EGL/egl.h>
27 29
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 // OzonePlatform: 240 // OzonePlatform:
239 virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE { 241 virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE {
240 return surface_factory_ozone_.get(); 242 return surface_factory_ozone_.get();
241 } 243 }
242 virtual EventFactoryOzone* GetEventFactoryOzone() OVERRIDE { 244 virtual EventFactoryOzone* GetEventFactoryOzone() OVERRIDE {
243 return event_factory_ozone_.get(); 245 return event_factory_ozone_.get();
244 } 246 }
245 virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE { 247 virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
246 return cursor_factory_ozone_.get(); 248 return cursor_factory_ozone_.get();
247 } 249 }
250 virtual GpuPlatformSupport* GetGpuPlatformSupport() OVERRIDE {
251 return gpu_platform_support_.get();
252 }
253 virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE {
254 return gpu_platform_support_host_.get();
255 }
248 256
249 #if defined(OS_CHROMEOS) 257 #if defined(OS_CHROMEOS)
250 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() 258 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
251 OVERRIDE { 259 OVERRIDE {
252 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone()); 260 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone());
253 } 261 }
254 virtual scoped_ptr<TouchscreenDeviceManager> 262 virtual scoped_ptr<TouchscreenDeviceManager>
255 CreateTouchscreenDeviceManager() OVERRIDE { 263 CreateTouchscreenDeviceManager() OVERRIDE {
256 return scoped_ptr<TouchscreenDeviceManager>( 264 return scoped_ptr<TouchscreenDeviceManager>(
257 new TouchscreenDeviceManagerOzone()); 265 new TouchscreenDeviceManagerOzone());
258 } 266 }
259 #endif 267 #endif
260 268
261 virtual void InitializeUI() OVERRIDE { 269 virtual void InitializeUI() OVERRIDE {
262 device_manager_ = CreateDeviceManager(); 270 device_manager_ = CreateDeviceManager();
263 surface_factory_ozone_.reset(new SurfaceFactoryEgltest(&eglplatform_shim_)); 271 surface_factory_ozone_.reset(new SurfaceFactoryEgltest(&eglplatform_shim_));
264 event_factory_ozone_.reset( 272 event_factory_ozone_.reset(
265 new EventFactoryEvdev(NULL, device_manager_.get())); 273 new EventFactoryEvdev(NULL, device_manager_.get()));
266 cursor_factory_ozone_.reset(new CursorFactoryOzone()); 274 cursor_factory_ozone_.reset(new CursorFactoryOzone());
275 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost());
267 } 276 }
268 277
269 virtual void InitializeGPU() OVERRIDE { 278 virtual void InitializeGPU() OVERRIDE {
270 surface_factory_ozone_.reset(new SurfaceFactoryEgltest(&eglplatform_shim_)); 279 surface_factory_ozone_.reset(new SurfaceFactoryEgltest(&eglplatform_shim_));
280 gpu_platform_support_.reset(CreateStubGpuPlatformSupport());
271 } 281 }
272 282
273 private: 283 private:
274 LibeglplatformShimLoader eglplatform_shim_; 284 LibeglplatformShimLoader eglplatform_shim_;
275 scoped_ptr<DeviceManager> device_manager_; 285 scoped_ptr<DeviceManager> device_manager_;
276 scoped_ptr<SurfaceFactoryEgltest> surface_factory_ozone_; 286 scoped_ptr<SurfaceFactoryEgltest> surface_factory_ozone_;
277 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; 287 scoped_ptr<EventFactoryEvdev> event_factory_ozone_;
278 scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_; 288 scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_;
289 scoped_ptr<GpuPlatformSupport> gpu_platform_support_;
290 scoped_ptr<GpuPlatformSupportHost> gpu_platform_support_host_;
279 291
280 bool shim_initialized_; 292 bool shim_initialized_;
281 293
282 DISALLOW_COPY_AND_ASSIGN(OzonePlatformEgltest); 294 DISALLOW_COPY_AND_ASSIGN(OzonePlatformEgltest);
283 }; 295 };
284 296
285 } // namespace 297 } // namespace
286 298
287 OzonePlatform* CreateOzonePlatformEgltest() { 299 OzonePlatform* CreateOzonePlatformEgltest() {
288 OzonePlatformEgltest* platform = new OzonePlatformEgltest; 300 OzonePlatformEgltest* platform = new OzonePlatformEgltest;
289 platform->Initialize(); 301 platform->Initialize();
290 return platform; 302 return platform;
291 } 303 }
292 304
293 } // namespace ui 305 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/ozone_platform_gbm.cc ('k') | ui/ozone/platform/test/ozone_platform_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698