OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/ozone/platform/drm/host/drm_display_host.h" | 5 #include "ui/ozone/platform/drm/host/drm_display_host.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/memory/ptr_util.h" |
8 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
9 #include "ui/ozone/common/display_snapshot_proxy.h" | 10 #include "ui/ozone/common/display_snapshot_proxy.h" |
10 #include "ui/ozone/common/display_util.h" | 11 #include "ui/ozone/common/display_util.h" |
11 #include "ui/ozone/platform/drm/host/gpu_thread_adapter.h" | 12 #include "ui/ozone/platform/drm/host/gpu_thread_adapter.h" |
12 | 13 |
13 namespace ui { | 14 namespace ui { |
14 | 15 |
15 DrmDisplayHost::DrmDisplayHost(GpuThreadAdapter* sender, | 16 DrmDisplayHost::DrmDisplayHost(GpuThreadAdapter* sender, |
16 const DisplaySnapshot_Params& params, | 17 const DisplaySnapshot_Params& params, |
17 bool is_dummy) | 18 bool is_dummy) |
18 : sender_(sender), | 19 : sender_(sender), |
19 snapshot_(new DisplaySnapshotProxy(params)), | 20 snapshot_(new DisplaySnapshotProxy(params)), |
20 is_dummy_(is_dummy) { | 21 is_dummy_(is_dummy) { |
21 sender_->AddGpuThreadObserver(this); | 22 sender_->AddGpuThreadObserver(this); |
22 } | 23 } |
23 | 24 |
24 DrmDisplayHost::~DrmDisplayHost() { | 25 DrmDisplayHost::~DrmDisplayHost() { |
25 sender_->RemoveGpuThreadObserver(this); | 26 sender_->RemoveGpuThreadObserver(this); |
26 ClearCallbacks(); | 27 ClearCallbacks(); |
27 } | 28 } |
28 | 29 |
29 void DrmDisplayHost::UpdateDisplaySnapshot( | 30 void DrmDisplayHost::UpdateDisplaySnapshot( |
30 const DisplaySnapshot_Params& params) { | 31 const DisplaySnapshot_Params& params) { |
31 snapshot_ = make_scoped_ptr(new DisplaySnapshotProxy(params)); | 32 snapshot_ = base::WrapUnique(new DisplaySnapshotProxy(params)); |
32 } | 33 } |
33 | 34 |
34 void DrmDisplayHost::Configure(const DisplayMode* mode, | 35 void DrmDisplayHost::Configure(const DisplayMode* mode, |
35 const gfx::Point& origin, | 36 const gfx::Point& origin, |
36 const ConfigureCallback& callback) { | 37 const ConfigureCallback& callback) { |
37 if (is_dummy_) { | 38 if (is_dummy_) { |
38 callback.Run(true); | 39 callback.Run(true); |
39 return; | 40 return; |
40 } | 41 } |
41 | 42 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 void DrmDisplayHost::ClearCallbacks() { | 123 void DrmDisplayHost::ClearCallbacks() { |
123 if (!configure_callback_.is_null()) | 124 if (!configure_callback_.is_null()) |
124 OnDisplayConfigured(false); | 125 OnDisplayConfigured(false); |
125 if (!get_hdcp_callback_.is_null()) | 126 if (!get_hdcp_callback_.is_null()) |
126 OnHDCPStateReceived(false, HDCP_STATE_UNDESIRED); | 127 OnHDCPStateReceived(false, HDCP_STATE_UNDESIRED); |
127 if (!set_hdcp_callback_.is_null()) | 128 if (!set_hdcp_callback_.is_null()) |
128 OnHDCPStateUpdated(false); | 129 OnHDCPStateUpdated(false); |
129 } | 130 } |
130 | 131 |
131 } // namespace ui | 132 } // namespace ui |
OLD | NEW |