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

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

Issue 1128113011: ozone: Introduce ClientPixmap and ClientPixmapFactory for non-GPU processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Introduce OzoneClient Created 5 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
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/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "base/threading/thread_checker.h" 12 #include "base/threading/thread_checker.h"
13 #include "library_loaders/libeglplatform_shim.h" 13 #include "library_loaders/libeglplatform_shim.h"
14 #include "third_party/khronos/EGL/egl.h" 14 #include "third_party/khronos/EGL/egl.h"
15 #include "ui/events/devices/device_data_manager.h" 15 #include "ui/events/devices/device_data_manager.h"
16 #include "ui/events/event.h" 16 #include "ui/events/event.h"
17 #include "ui/events/ozone/device/device_manager.h" 17 #include "ui/events/ozone/device/device_manager.h"
18 #include "ui/events/ozone/evdev/event_factory_evdev.h" 18 #include "ui/events/ozone/evdev/event_factory_evdev.h"
19 #include "ui/events/ozone/events_ozone.h" 19 #include "ui/events/ozone/events_ozone.h"
20 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" 20 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h"
21 #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h" 21 #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h"
22 #include "ui/events/platform/platform_event_dispatcher.h" 22 #include "ui/events/platform/platform_event_dispatcher.h"
23 #include "ui/gfx/vsync_provider.h" 23 #include "ui/gfx/vsync_provider.h"
24 #include "ui/ozone/common/egl_util.h" 24 #include "ui/ozone/common/egl_util.h"
25 #include "ui/ozone/common/native_display_delegate_ozone.h" 25 #include "ui/ozone/common/native_display_delegate_ozone.h"
26 #include "ui/ozone/public/cursor_factory_ozone.h" 26 #include "ui/ozone/public/cursor_factory_ozone.h"
27 #include "ui/ozone/public/gpu_platform_support.h" 27 #include "ui/ozone/public/gpu_platform_support.h"
28 #include "ui/ozone/public/gpu_platform_support_host.h" 28 #include "ui/ozone/public/gpu_platform_support_host.h"
29 #include "ui/ozone/public/ozone_client.h"
29 #include "ui/ozone/public/ozone_platform.h" 30 #include "ui/ozone/public/ozone_platform.h"
30 #include "ui/ozone/public/ozone_switches.h" 31 #include "ui/ozone/public/ozone_switches.h"
32 #include "ui/ozone/public/surface_client_factory_ozone.h"
31 #include "ui/ozone/public/surface_factory_ozone.h" 33 #include "ui/ozone/public/surface_factory_ozone.h"
32 #include "ui/ozone/public/surface_ozone_egl.h" 34 #include "ui/ozone/public/surface_ozone_egl.h"
33 #include "ui/ozone/public/system_input_injector.h" 35 #include "ui/ozone/public/system_input_injector.h"
34 #include "ui/platform_window/platform_window.h" 36 #include "ui/platform_window/platform_window.h"
35 #include "ui/platform_window/platform_window_delegate.h" 37 #include "ui/platform_window/platform_window_delegate.h"
36 38
37 namespace ui { 39 namespace ui {
38 40
39 namespace { 41 namespace {
40 42
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; 395 scoped_ptr<EventFactoryEvdev> event_factory_ozone_;
394 scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_; 396 scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_;
395 scoped_ptr<GpuPlatformSupport> gpu_platform_support_; 397 scoped_ptr<GpuPlatformSupport> gpu_platform_support_;
396 scoped_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; 398 scoped_ptr<GpuPlatformSupportHost> gpu_platform_support_host_;
397 399
398 bool shim_initialized_; 400 bool shim_initialized_;
399 401
400 DISALLOW_COPY_AND_ASSIGN(OzonePlatformEgltest); 402 DISALLOW_COPY_AND_ASSIGN(OzonePlatformEgltest);
401 }; 403 };
402 404
405 class OzoneClientEgltest : public OzoneClient {
406 public:
407 OzoneClientEgltest() {}
408 ~OzoneClientEgltest() override {}
409
410 // OzoneClient:
411 SurfaceClientFactoryOzone* GetSurfaceClientFactoryOzone() override {
412 return surface_client_.get();
413 }
414
415 void InitializeUI() override {
416 if (!surface_client_)
417 surface_client_.reset(new SurfaceClientFactoryOzone);
418 }
419
420 void InitializeRenderer() override {
421 if (!surface_client_)
422 surface_client_.reset(new SurfaceClientFactoryOzone);
423 }
424
425 private:
426 scoped_ptr<SurfaceClientFactoryOzone> surface_client_;
427
428 DISALLOW_COPY_AND_ASSIGN(OzoneClientEgltest);
429 };
430
403 } // namespace 431 } // namespace
404 432
405 OzonePlatform* CreateOzonePlatformEgltest() { 433 OzonePlatform* CreateOzonePlatformEgltest() {
406 OzonePlatformEgltest* platform = new OzonePlatformEgltest; 434 OzonePlatformEgltest* platform = new OzonePlatformEgltest;
407 platform->Initialize(); 435 platform->Initialize();
408 return platform; 436 return platform;
409 } 437 }
410 438
439 OzoneClient* CreateOzoneClientEgltest() {
440 return new OzoneClientEgltest;
441 }
442
411 } // namespace ui 443 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698