| 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 #include "chromecast/ozone/ozone_platform_cast.h" | |
| 6 | |
| 7 #include "chromecast/ozone/cast_egl_platform.h" | |
| 8 #include "chromecast/ozone/gpu_platform_support_cast.h" | |
| 9 #include "chromecast/ozone/platform_window_cast.h" | |
| 10 #include "chromecast/ozone/surface_factory_cast.h" | |
| 11 #include "ui/ozone/common/native_display_delegate_ozone.h" | |
| 12 #include "ui/ozone/public/cursor_factory_ozone.h" | |
| 13 #include "ui/ozone/public/gpu_platform_support_host.h" | |
| 14 #include "ui/ozone/public/input_controller.h" | |
| 15 #include "ui/ozone/public/system_input_injector.h" | |
| 16 | |
| 17 namespace chromecast { | |
| 18 namespace ozone { | |
| 19 | |
| 20 OzonePlatformCast::OzonePlatformCast(scoped_ptr<CastEglPlatform> egl_platform) | |
| 21 : egl_platform_(egl_platform.Pass()) { | |
| 22 } | |
| 23 | |
| 24 OzonePlatformCast::~OzonePlatformCast() { | |
| 25 } | |
| 26 | |
| 27 ui::SurfaceFactoryOzone* OzonePlatformCast::GetSurfaceFactoryOzone() { | |
| 28 return surface_factory_ozone_.get(); | |
| 29 } | |
| 30 | |
| 31 ui::CursorFactoryOzone* OzonePlatformCast::GetCursorFactoryOzone() { | |
| 32 return cursor_factory_ozone_.get(); | |
| 33 } | |
| 34 | |
| 35 ui::InputController* OzonePlatformCast::GetInputController() { | |
| 36 return input_controller_.get(); | |
| 37 } | |
| 38 | |
| 39 ui::GpuPlatformSupport* OzonePlatformCast::GetGpuPlatformSupport() { | |
| 40 return gpu_platform_support_.get(); | |
| 41 } | |
| 42 | |
| 43 ui::GpuPlatformSupportHost* OzonePlatformCast::GetGpuPlatformSupportHost() { | |
| 44 return gpu_platform_support_host_.get(); | |
| 45 } | |
| 46 | |
| 47 scoped_ptr<ui::SystemInputInjector> | |
| 48 OzonePlatformCast::CreateSystemInputInjector() { | |
| 49 return scoped_ptr<ui::SystemInputInjector>(); // no input injection support | |
| 50 } | |
| 51 | |
| 52 scoped_ptr<ui::PlatformWindow> OzonePlatformCast::CreatePlatformWindow( | |
| 53 ui::PlatformWindowDelegate* delegate, | |
| 54 const gfx::Rect& bounds) { | |
| 55 return make_scoped_ptr<ui::PlatformWindow>( | |
| 56 new PlatformWindowCast(delegate, bounds)); | |
| 57 } | |
| 58 | |
| 59 scoped_ptr<ui::NativeDisplayDelegate> | |
| 60 OzonePlatformCast::CreateNativeDisplayDelegate() { | |
| 61 return scoped_ptr<ui::NativeDisplayDelegate>( | |
| 62 new ui::NativeDisplayDelegateOzone()); | |
| 63 } | |
| 64 | |
| 65 void OzonePlatformCast::InitializeUI() { | |
| 66 if (!surface_factory_ozone_) { | |
| 67 surface_factory_ozone_.reset(new SurfaceFactoryCast(egl_platform_.Pass())); | |
| 68 } | |
| 69 cursor_factory_ozone_.reset(new ui::CursorFactoryOzone()); | |
| 70 input_controller_ = ui::CreateStubInputController(); | |
| 71 gpu_platform_support_host_.reset(ui::CreateStubGpuPlatformSupportHost()); | |
| 72 } | |
| 73 | |
| 74 void OzonePlatformCast::InitializeGPU() { | |
| 75 if (!surface_factory_ozone_) { | |
| 76 surface_factory_ozone_.reset(new SurfaceFactoryCast(egl_platform_.Pass())); | |
| 77 } | |
| 78 gpu_platform_support_.reset( | |
| 79 new GpuPlatformSupportCast(surface_factory_ozone_.get())); | |
| 80 } | |
| 81 | |
| 82 } // namespace ozone | |
| 83 } // namespace chromecast | |
| OLD | NEW |