OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROMECAST_OZONE_OZONE_PLATFORM_CAST_H_ |
| 6 #define CHROMECAST_OZONE_OZONE_PLATFORM_CAST_H_ |
| 7 |
| 8 #include "chromecast/ozone/gpu_platform_support_cast.h" |
| 9 #include "chromecast/ozone/surface_factory_cast.h" |
| 10 #include "ui/ozone/public/ozone_platform.h" |
| 11 |
| 12 namespace chromecast { |
| 13 namespace ozone { |
| 14 |
| 15 class CastEglPlatform; |
| 16 |
| 17 // Ozone platform implementation for Cast. Implements functionality |
| 18 // common to all Cast implementations: |
| 19 // - Always one window with window size equal to display size |
| 20 // - No input, cursor support |
| 21 // - Relinquish GPU resources flow for switching to external applications |
| 22 // Meanwhile, platform-specific implementation details are abstracted out |
| 23 // to the CastEglPlatform interface. |
| 24 class OzonePlatformCast : public ui::OzonePlatform { |
| 25 public: |
| 26 explicit OzonePlatformCast(scoped_ptr<CastEglPlatform> egl_platform); |
| 27 ~OzonePlatformCast() override; |
| 28 |
| 29 // OzonePlatform implementation: |
| 30 ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override; |
| 31 ui::CursorFactoryOzone* GetCursorFactoryOzone() override; |
| 32 ui::InputController* GetInputController() override; |
| 33 ui::GpuPlatformSupport* GetGpuPlatformSupport() override; |
| 34 ui::GpuPlatformSupportHost* GetGpuPlatformSupportHost() override; |
| 35 scoped_ptr<ui::SystemInputInjector> CreateSystemInputInjector() override; |
| 36 scoped_ptr<ui::PlatformWindow> CreatePlatformWindow( |
| 37 ui::PlatformWindowDelegate* delegate, |
| 38 const gfx::Rect& bounds) override; |
| 39 scoped_ptr<ui::NativeDisplayDelegate> CreateNativeDisplayDelegate() override; |
| 40 |
| 41 void InitializeUI() override; |
| 42 void InitializeGPU() override; |
| 43 |
| 44 private: |
| 45 scoped_ptr<CastEglPlatform> egl_platform_; |
| 46 scoped_ptr<SurfaceFactoryCast> surface_factory_ozone_; |
| 47 scoped_ptr<ui::CursorFactoryOzone> cursor_factory_ozone_; |
| 48 scoped_ptr<ui::InputController> input_controller_; |
| 49 scoped_ptr<GpuPlatformSupportCast> gpu_platform_support_; |
| 50 scoped_ptr<ui::GpuPlatformSupportHost> gpu_platform_support_host_; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(OzonePlatformCast); |
| 53 }; |
| 54 |
| 55 } // namespace ozone |
| 56 } // namespace chromecast |
| 57 |
| 58 #endif // CHROMECAST_OZONE_OZONE_PLATFORM_CAST_H_ |
OLD | NEW |