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

Unified Diff: ui/ozone/platform/drm/mojo/drm_host_delegate.cc

Issue 1309273005: native_viewport support for ozone (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 4 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
« no previous file with comments | « ui/ozone/platform/drm/mojo/drm_host_delegate.h ('k') | ui/ozone/platform/drm/mojo/drm_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/mojo/drm_host_delegate.cc
diff --git a/ui/ozone/platform/drm/mojo/drm_host_delegate.cc b/ui/ozone/platform/drm/mojo/drm_host_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..60473145920af832c47156a21350a04f7035e739
--- /dev/null
+++ b/ui/ozone/platform/drm/mojo/drm_host_delegate.cc
@@ -0,0 +1,54 @@
+// 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 "ui/ozone/platform/drm/mojo/drm_host_delegate.h"
+
+#include "base/logging.h"
+#include "base/process/process.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "mojo/converters/ozone_drm_gpu/ozone_drm_gpu_type_converters.h"
+#include "ui/ozone/public/ozone_platform.h"
+
+namespace ui {
+
+MojoDrmHostDelegate::MojoDrmHostDelegate(mojo::OzoneDrmGpu* ozone_drm_gpu)
+ : ozone_drm_gpu_(ozone_drm_gpu) {
+ auto platform_support = static_cast<ui::DrmGpuPlatformSupportHost*>(
+ ui::OzonePlatform::GetInstance()->GetGpuPlatformSupportHost());
+ platform_support->SetDelegate(this);
+}
+
+MojoDrmHostDelegate::~MojoDrmHostDelegate() {}
+
+void MojoDrmHostDelegate::CreateWindow(const gfx::AcceleratedWidget& widget) {
+ ozone_drm_gpu_->CreateWindow(widget);
+}
+
+void MojoDrmHostDelegate::WindowBoundsChanged(
+ const gfx::AcceleratedWidget& widget,
+ const gfx::Rect& bounds) {
+ ozone_drm_gpu_->WindowBoundsChanged(widget, mojo::Rect::From(bounds));
+}
+
+void MojoDrmHostDelegate::AddGraphicsDevice(const base::FilePath& path,
+ const base::FileDescriptor& fd) {
+ ozone_drm_gpu_->AddGraphicsDevice(path.value(), fd.fd);
+}
+
+bool MojoDrmHostDelegate::RefreshNativeDisplays() {
+ ozone_drm_gpu_->RefreshNativeDisplays();
+ return true;
+}
+
+bool MojoDrmHostDelegate::ConfigureNativeDisplay(
+ int64_t id,
+ const ui::DisplayMode_Params& mode,
+ const gfx::Point& originhost) {
+ ozone_drm_gpu_->ConfigureNativeDisplay(
+ id, mojo::DisplayMode::From<ui::DisplayMode_Params>(mode),
+ mojo::Point::From(originhost));
+ return true;
+}
+
+} // namespace ui
« no previous file with comments | « ui/ozone/platform/drm/mojo/drm_host_delegate.h ('k') | ui/ozone/platform/drm/mojo/drm_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698