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

Side by Side 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, 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_host_delegate.h"
6
7 #include "base/logging.h"
8 #include "base/process/process.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 MojoDrmHostDelegate::MojoDrmHostDelegate(mojo::OzoneDrmGpu* ozone_drm_gpu)
16 : ozone_drm_gpu_(ozone_drm_gpu) {
17 auto platform_support = static_cast<ui::DrmGpuPlatformSupportHost*>(
18 ui::OzonePlatform::GetInstance()->GetGpuPlatformSupportHost());
19 platform_support->SetDelegate(this);
20 }
21
22 MojoDrmHostDelegate::~MojoDrmHostDelegate() {}
23
24 void MojoDrmHostDelegate::CreateWindow(const gfx::AcceleratedWidget& widget) {
25 ozone_drm_gpu_->CreateWindow(widget);
26 }
27
28 void MojoDrmHostDelegate::WindowBoundsChanged(
29 const gfx::AcceleratedWidget& widget,
30 const gfx::Rect& bounds) {
31 ozone_drm_gpu_->WindowBoundsChanged(widget, mojo::Rect::From(bounds));
32 }
33
34 void MojoDrmHostDelegate::AddGraphicsDevice(const base::FilePath& path,
35 const base::FileDescriptor& fd) {
36 ozone_drm_gpu_->AddGraphicsDevice(path.value(), fd.fd);
37 }
38
39 bool MojoDrmHostDelegate::RefreshNativeDisplays() {
40 ozone_drm_gpu_->RefreshNativeDisplays();
41 return true;
42 }
43
44 bool MojoDrmHostDelegate::ConfigureNativeDisplay(
45 int64_t id,
46 const ui::DisplayMode_Params& mode,
47 const gfx::Point& originhost) {
48 ozone_drm_gpu_->ConfigureNativeDisplay(
49 id, mojo::DisplayMode::From<ui::DisplayMode_Params>(mode),
50 mojo::Point::From(originhost));
51 return true;
52 }
53
54 } // namespace ui
OLDNEW
« 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