Chromium Code Reviews| Index: ui/ozone/platform/drm/gpu/drm_window_proxy.cc |
| diff --git a/ui/ozone/platform/drm/gpu/drm_window_proxy.cc b/ui/ozone/platform/drm/gpu/drm_window_proxy.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..160531dae5308859b37c4bf8c3d259d7f4a580b0 |
| --- /dev/null |
| +++ b/ui/ozone/platform/drm/gpu/drm_window_proxy.cc |
| @@ -0,0 +1,68 @@ |
| +// 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/gpu/drm_window_proxy.h" |
| + |
| +#include "ui/ozone/platform/drm/gpu/drm_device.h" |
| +#include "ui/ozone/platform/drm/gpu/drm_window.h" |
| +#include "ui/ozone/platform/drm/gpu/hardware_display_controller.h" |
| +#include "ui/ozone/platform/drm/gpu/proxy_helpers.h" |
| +#include "ui/ozone/platform/drm/gpu/scanout_buffer.h" |
| + |
| +namespace ui { |
| + |
| +DrmWindowProxy::DrmWindowProxy( |
|
spang
2015/09/14 18:41:43
Can we merge this with the surface class?
dnicoara
2015/09/17 21:58:21
Done.
|
| + const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| + base::WeakPtr<DrmWindow> impl, |
| + gfx::AcceleratedWidget widget) |
| + : task_runner_(task_runner), impl_(impl), widget_(widget) {} |
| + |
| +DrmWindowProxy::~DrmWindowProxy() {} |
| + |
| +void DrmWindowProxy::QueueOverlayPlane(const OverlayPlane& plane) const { |
| + task_runner_->PostTask( |
| + FROM_HERE, base::Bind(&DrmWindow::QueueOverlayPlane, impl_, plane)); |
| +} |
| + |
| +bool DrmWindowProxy::SchedulePageFlip( |
| + bool is_sync, |
| + const SwapCompletionCallback& callback) const { |
| + task_runner_->PostTask( |
| + FROM_HERE, base::Bind(&DrmWindow::SchedulePageFlip, impl_, is_sync, |
| + CreateSafeCallback(callback))); |
| + return true; |
| +} |
| + |
| +bool DrmWindowProxy::IsDisplayedOnUniversalDisplayLinkDevice() const { |
| + bool is_udl = false; |
| + PostSyncTask( |
|
spang
2015/09/14 18:41:43
What stops these sync queries from turning into ra
dnicoara
2015/09/17 21:58:21
I've re-done this function to no longer require a
|
| + task_runner_, |
| + CreateWeakPtrCallback(&DrmWindow::IsDisplayedOnUniversalDisplayLinkDevice, |
| + impl_, &is_udl)); |
| + return is_udl; |
| +} |
| + |
| +gfx::Rect DrmWindowProxy::GetBounds() const { |
|
spang
2015/09/14 18:41:43
I don't think this function should exist here.
dnicoara
2015/09/17 21:58:21
Removed, no longer necessary.
|
| + gfx::Rect bounds; |
| + PostSyncTask(task_runner_, |
| + CreateWeakPtrCallback(&DrmWindow::bounds, impl_, &bounds)); |
| + return bounds; |
| +} |
| + |
| +void DrmWindowProxy::GetVSyncParameters( |
| + const gfx::VSyncProvider::UpdateVSyncCallback& callback) const { |
| + task_runner_->PostTask(FROM_HERE, |
| + base::Bind(&DrmWindow::GetVSyncParameters, impl_, |
| + CreateSafeCallback(callback))); |
| +} |
| + |
| +scoped_refptr<DrmDevice> DrmWindowProxy::GetDrmDevice() const { |
| + scoped_refptr<DrmDevice> drm; |
| + PostSyncTask( |
| + task_runner_, |
| + CreateWeakPtrCallback(&DrmWindow::GetAllocationDrmDevice, impl_, &drm)); |
| + return drm; |
| +} |
| + |
| +} // namespace ui |