OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 "chromecast/ozone/ozone_platform_cast.h" | 5 #include "chromecast/ozone/ozone_platform_cast.h" |
6 | 6 |
7 #include "chromecast/ozone/cast_egl_platform.h" | |
8 #include "chromecast/ozone/gpu_platform_support_cast.h" | 7 #include "chromecast/ozone/gpu_platform_support_cast.h" |
9 #include "chromecast/ozone/platform_window_cast.h" | 8 #include "chromecast/ozone/platform_window_cast.h" |
10 #include "chromecast/ozone/surface_factory_cast.h" | 9 #include "chromecast/ozone/surface_factory_cast.h" |
| 10 #include "chromecast/public/cast_egl_platform.h" |
| 11 #include "chromecast/public/cast_egl_platform_shlib.h" |
| 12 #include "media/ozone/media_ozone_platform.h" |
11 #include "ui/ozone/common/native_display_delegate_ozone.h" | 13 #include "ui/ozone/common/native_display_delegate_ozone.h" |
12 #include "ui/ozone/public/cursor_factory_ozone.h" | 14 #include "ui/ozone/public/cursor_factory_ozone.h" |
13 #include "ui/ozone/public/gpu_platform_support_host.h" | 15 #include "ui/ozone/public/gpu_platform_support_host.h" |
14 #include "ui/ozone/public/input_controller.h" | 16 #include "ui/ozone/public/input_controller.h" |
15 #include "ui/ozone/public/system_input_injector.h" | 17 #include "ui/ozone/public/system_input_injector.h" |
16 | 18 |
| 19 namespace { |
| 20 |
| 21 class MediaOzonePlatformStub : public media::MediaOzonePlatform { |
| 22 public: |
| 23 MediaOzonePlatformStub() {} |
| 24 |
| 25 ~MediaOzonePlatformStub() override {} |
| 26 |
| 27 private: |
| 28 DISALLOW_COPY_AND_ASSIGN(MediaOzonePlatformStub); |
| 29 }; |
| 30 |
| 31 } // namespace |
| 32 |
17 namespace chromecast { | 33 namespace chromecast { |
18 namespace ozone { | 34 namespace ozone { |
19 | 35 |
20 OzonePlatformCast::OzonePlatformCast(scoped_ptr<CastEglPlatform> egl_platform) | 36 OzonePlatformCast::OzonePlatformCast(scoped_ptr<CastEglPlatform> egl_platform) |
21 : egl_platform_(egl_platform.Pass()) { | 37 : egl_platform_(egl_platform.Pass()) { |
22 } | 38 } |
23 | 39 |
24 OzonePlatformCast::~OzonePlatformCast() { | 40 OzonePlatformCast::~OzonePlatformCast() { |
25 } | 41 } |
26 | 42 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 void OzonePlatformCast::InitializeGPU() { | 90 void OzonePlatformCast::InitializeGPU() { |
75 if (!surface_factory_ozone_) { | 91 if (!surface_factory_ozone_) { |
76 surface_factory_ozone_.reset(new SurfaceFactoryCast(egl_platform_.Pass())); | 92 surface_factory_ozone_.reset(new SurfaceFactoryCast(egl_platform_.Pass())); |
77 } | 93 } |
78 gpu_platform_support_.reset( | 94 gpu_platform_support_.reset( |
79 new GpuPlatformSupportCast(surface_factory_ozone_.get())); | 95 new GpuPlatformSupportCast(surface_factory_ozone_.get())); |
80 } | 96 } |
81 | 97 |
82 } // namespace ozone | 98 } // namespace ozone |
83 } // namespace chromecast | 99 } // namespace chromecast |
| 100 |
| 101 namespace ui { |
| 102 |
| 103 OzonePlatform* CreateOzonePlatformCast() { |
| 104 scoped_ptr<chromecast::CastEglPlatform> platform( |
| 105 chromecast::CastEglPlatformShlib::Create()); |
| 106 return new chromecast::ozone::OzonePlatformCast(platform.Pass()); |
| 107 } |
| 108 |
| 109 } // namespace ui |
| 110 |
| 111 namespace media { |
| 112 |
| 113 MediaOzonePlatform* CreateMediaOzonePlatformCast() { |
| 114 return new MediaOzonePlatformStub; |
| 115 } |
| 116 |
| 117 } // namespace ui |
OLD | NEW |