OLD | NEW |
(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 |
OLD | NEW |