Chromium Code Reviews| 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/gpu/drm_window_proxy.h" | |
| 6 | |
| 7 #include "ui/ozone/platform/drm/gpu/drm_device.h" | |
| 8 #include "ui/ozone/platform/drm/gpu/drm_window.h" | |
| 9 #include "ui/ozone/platform/drm/gpu/hardware_display_controller.h" | |
| 10 #include "ui/ozone/platform/drm/gpu/proxy_helpers.h" | |
| 11 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" | |
| 12 | |
| 13 namespace ui { | |
| 14 | |
| 15 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.
| |
| 16 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | |
| 17 base::WeakPtr<DrmWindow> impl, | |
| 18 gfx::AcceleratedWidget widget) | |
| 19 : task_runner_(task_runner), impl_(impl), widget_(widget) {} | |
| 20 | |
| 21 DrmWindowProxy::~DrmWindowProxy() {} | |
| 22 | |
| 23 void DrmWindowProxy::QueueOverlayPlane(const OverlayPlane& plane) const { | |
| 24 task_runner_->PostTask( | |
| 25 FROM_HERE, base::Bind(&DrmWindow::QueueOverlayPlane, impl_, plane)); | |
| 26 } | |
| 27 | |
| 28 bool DrmWindowProxy::SchedulePageFlip( | |
| 29 bool is_sync, | |
| 30 const SwapCompletionCallback& callback) const { | |
| 31 task_runner_->PostTask( | |
| 32 FROM_HERE, base::Bind(&DrmWindow::SchedulePageFlip, impl_, is_sync, | |
| 33 CreateSafeCallback(callback))); | |
| 34 return true; | |
| 35 } | |
| 36 | |
| 37 bool DrmWindowProxy::IsDisplayedOnUniversalDisplayLinkDevice() const { | |
| 38 bool is_udl = false; | |
| 39 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
| |
| 40 task_runner_, | |
| 41 CreateWeakPtrCallback(&DrmWindow::IsDisplayedOnUniversalDisplayLinkDevice, | |
| 42 impl_, &is_udl)); | |
| 43 return is_udl; | |
| 44 } | |
| 45 | |
| 46 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.
| |
| 47 gfx::Rect bounds; | |
| 48 PostSyncTask(task_runner_, | |
| 49 CreateWeakPtrCallback(&DrmWindow::bounds, impl_, &bounds)); | |
| 50 return bounds; | |
| 51 } | |
| 52 | |
| 53 void DrmWindowProxy::GetVSyncParameters( | |
| 54 const gfx::VSyncProvider::UpdateVSyncCallback& callback) const { | |
| 55 task_runner_->PostTask(FROM_HERE, | |
| 56 base::Bind(&DrmWindow::GetVSyncParameters, impl_, | |
| 57 CreateSafeCallback(callback))); | |
| 58 } | |
| 59 | |
| 60 scoped_refptr<DrmDevice> DrmWindowProxy::GetDrmDevice() const { | |
| 61 scoped_refptr<DrmDevice> drm; | |
| 62 PostSyncTask( | |
| 63 task_runner_, | |
| 64 CreateWeakPtrCallback(&DrmWindow::GetAllocationDrmDevice, impl_, &drm)); | |
| 65 return drm; | |
| 66 } | |
| 67 | |
| 68 } // namespace ui | |
| OLD | NEW |