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

Unified Diff: chromecast/ozone/ozone_platform_chromecast.cc

Issue 1025453002: Implement common Ozone interface for Chromecast. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chromecast/ozone/ozone_platform_chromecast.cc
diff --git a/chromecast/ozone/ozone_platform_chromecast.cc b/chromecast/ozone/ozone_platform_chromecast.cc
new file mode 100644
index 0000000000000000000000000000000000000000..311520db2806ab6a72ba790ff2922f1ffa514b43
--- /dev/null
+++ b/chromecast/ozone/ozone_platform_chromecast.cc
@@ -0,0 +1,86 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#include "chromecast/ozone/ozone_platform_chromecast.h"
lcwu1 2015/03/27 00:51:42 Add a vertical space between the header comment an
halliwell 2015/03/27 01:45:02 Done.
+
+#include "chromecast/ozone/chromecast_egl_platform.h"
+#include "chromecast/ozone/gpu_platform_support_chromecast.h"
+#include "chromecast/ozone/platform_window_chromecast.h"
+#include "chromecast/ozone/surface_factory_chromecast.h"
+#include "ui/ozone/common/native_display_delegate_ozone.h"
+#include "ui/ozone/public/cursor_factory_ozone.h"
+#include "ui/ozone/public/gpu_platform_support_host.h"
+#include "ui/ozone/public/input_controller.h"
+#include "ui/ozone/public/system_input_injector.h"
+
+namespace chromecast {
+namespace ozone {
+
+OzonePlatformChromecast::OzonePlatformChromecast(
+ scoped_ptr<ChromecastEglPlatform> egl_platform)
+ : egl_platform_(egl_platform.Pass()) {
+}
+
+OzonePlatformChromecast::~OzonePlatformChromecast() {
+}
+
+ui::SurfaceFactoryOzone* OzonePlatformChromecast::GetSurfaceFactoryOzone() {
+ return surface_factory_ozone_.get();
+}
+
+ui::CursorFactoryOzone* OzonePlatformChromecast::GetCursorFactoryOzone() {
+ return cursor_factory_ozone_.get();
+}
+
+ui::InputController* OzonePlatformChromecast::GetInputController() {
+ return input_controller_.get();
+}
+
+ui::GpuPlatformSupport* OzonePlatformChromecast::GetGpuPlatformSupport() {
+ return gpu_platform_support_.get();
+}
+
+ui::GpuPlatformSupportHost*
+OzonePlatformChromecast::GetGpuPlatformSupportHost() {
+ return gpu_platform_support_host_.get();
+}
+
+scoped_ptr<ui::SystemInputInjector>
+OzonePlatformChromecast::CreateSystemInputInjector() {
+ return scoped_ptr<ui::SystemInputInjector>(); // no input injection support
+}
+
+scoped_ptr<ui::PlatformWindow> OzonePlatformChromecast::CreatePlatformWindow(
+ ui::PlatformWindowDelegate* delegate,
+ const gfx::Rect& bounds) {
+ return make_scoped_ptr<ui::PlatformWindow>(
+ new PlatformWindowChromecast(delegate, bounds));
+}
+
+scoped_ptr<ui::NativeDisplayDelegate>
+OzonePlatformChromecast::CreateNativeDisplayDelegate() {
+ return scoped_ptr<ui::NativeDisplayDelegate>(
+ new ui::NativeDisplayDelegateOzone());
+}
+
+void OzonePlatformChromecast::InitializeUI() {
+ if (!surface_factory_ozone_) {
+ surface_factory_ozone_.reset(
+ new SurfaceFactoryChromecast(egl_platform_.Pass()));
+ }
+ cursor_factory_ozone_.reset(new ui::CursorFactoryOzone());
+ input_controller_ = ui::CreateStubInputController();
+ gpu_platform_support_host_.reset(ui::CreateStubGpuPlatformSupportHost());
+}
+
+void OzonePlatformChromecast::InitializeGPU() {
+ if (!surface_factory_ozone_) {
+ surface_factory_ozone_.reset(
+ new SurfaceFactoryChromecast(egl_platform_.Pass()));
+ }
+ gpu_platform_support_.reset(
+ new GpuPlatformSupportChromecast(surface_factory_ozone_.get()));
+}
+
+} // namespace ozone
+} // namespace chromecast

Powered by Google App Engine
This is Rietveld 408576698