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

Side by Side Diff: ui/ozone/platform/drm/mojo/drm_gpu_impl.cc

Issue 1309273005: native_viewport support for ozone (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 3 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 unified diff | Download patch
OLDNEW
(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 "ui/ozone/platform/drm/mojo/drm_gpu_impl.h"
6
7 #include "base/file_descriptor_posix.h"
8 #include "base/files/file_path.h"
9 #include "mojo/converters/geometry/geometry_type_converters.h"
10 #include "mojo/converters/ozone_drm_gpu/ozone_drm_gpu_type_converters.h"
11 #include "ui/ozone/public/ozone_platform.h"
12
13 namespace ui {
14
15 MojoDrmGpuImpl::MojoDrmGpuImpl(
16 mojo::InterfaceRequest<mojo::OzoneDrmGpu> request)
17 : binding_(this, request.Pass()) {
18 ui::OzonePlatform::InitializeForGPU();
19
20 platform_support_ = static_cast<ui::DrmGpuPlatformSupport*>(
21 ui::OzonePlatform::GetInstance()->GetGpuPlatformSupport());
22
23 platform_support_->OnChannelEstablished();
24 }
25
26 MojoDrmGpuImpl::~MojoDrmGpuImpl() {}
27
28 void MojoDrmGpuImpl::CreateWindow(int64_t widget) {
29 platform_support_->OnCreateWindow(widget);
30 }
31
32 void MojoDrmGpuImpl::WindowBoundsChanged(int64_t widget, mojo::RectPtr bounds) {
33 platform_support_->OnWindowBoundsChanged(widget, bounds.To<gfx::Rect>());
34 }
35
36 void MojoDrmGpuImpl::AddGraphicsDevice(const mojo::String& file_path,
37 int32_t file_descriptor) {
38 platform_support_->OnAddGraphicsDevice(
39 base::FilePath(file_path.get()),
40 base::FileDescriptor(file_descriptor, false));
41 }
42
43 void MojoDrmGpuImpl::RefreshNativeDisplays() {
44 platform_support_->OnRefreshNativeDisplays();
45 }
46
47 void MojoDrmGpuImpl::ConfigureNativeDisplay(int64_t id,
48 mojo::DisplayModePtr mode,
49 mojo::PointPtr originhost) {
50 platform_support_->OnConfigureNativeDisplay(
51 id, mode.To<ui::DisplayMode_Params>(), originhost.To<gfx::Point>());
52 }
53
54 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/mojo/drm_gpu_impl.h ('k') | ui/ozone/platform/drm/mojo/drm_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698