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

Side by Side Diff: ui/ozone/platform/drm/host/drm_display_host.cc

Issue 1603213002: Renamed ChannelObserver to better describe its purpose (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review nit Created 4 years, 10 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
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/thread_task_runner_handle.h" 7 #include "base/thread_task_runner_handle.h"
8 #include "ui/ozone/common/display_snapshot_proxy.h" 8 #include "ui/ozone/common/display_snapshot_proxy.h"
9 #include "ui/ozone/common/display_util.h" 9 #include "ui/ozone/common/display_util.h"
10 #include "ui/ozone/common/gpu/ozone_gpu_messages.h" 10 #include "ui/ozone/common/gpu/ozone_gpu_messages.h"
11 #include "ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h" 11 #include "ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h"
12 12
13 namespace ui { 13 namespace ui {
14 14
15 DrmDisplayHost::DrmDisplayHost(DrmGpuPlatformSupportHost* sender, 15 DrmDisplayHost::DrmDisplayHost(DrmGpuPlatformSupportHost* sender,
16 const DisplaySnapshot_Params& params, 16 const DisplaySnapshot_Params& params,
17 bool is_dummy) 17 bool is_dummy)
18 : sender_(sender), 18 : sender_(sender),
19 snapshot_(new DisplaySnapshotProxy(params)), 19 snapshot_(new DisplaySnapshotProxy(params)),
20 is_dummy_(is_dummy) { 20 is_dummy_(is_dummy) {
21 sender_->AddChannelObserver(this); 21 sender_->AddGpuThreadObserver(this);
22 } 22 }
23 23
24 DrmDisplayHost::~DrmDisplayHost() { 24 DrmDisplayHost::~DrmDisplayHost() {
25 sender_->RemoveChannelObserver(this); 25 sender_->RemoveGpuThreadObserver(this);
26 ClearCallbacks(); 26 ClearCallbacks();
27 } 27 }
28 28
29 void DrmDisplayHost::UpdateDisplaySnapshot( 29 void DrmDisplayHost::UpdateDisplaySnapshot(
30 const DisplaySnapshot_Params& params) { 30 const DisplaySnapshot_Params& params) {
31 snapshot_ = make_scoped_ptr(new DisplaySnapshotProxy(params)); 31 snapshot_ = make_scoped_ptr(new DisplaySnapshotProxy(params));
32 } 32 }
33 33
34 void DrmDisplayHost::Configure(const DisplayMode* mode, 34 void DrmDisplayHost::Configure(const DisplayMode* mode,
35 const gfx::Point& origin, 35 const gfx::Point& origin,
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 << snapshot_->display_id(); 100 << snapshot_->display_id();
101 } 101 }
102 102
103 set_hdcp_callback_.Reset(); 103 set_hdcp_callback_.Reset();
104 } 104 }
105 105
106 void DrmDisplayHost::SetGammaRamp(const std::vector<GammaRampRGBEntry>& lut) { 106 void DrmDisplayHost::SetGammaRamp(const std::vector<GammaRampRGBEntry>& lut) {
107 sender_->Send(new OzoneGpuMsg_SetGammaRamp(snapshot_->display_id(), lut)); 107 sender_->Send(new OzoneGpuMsg_SetGammaRamp(snapshot_->display_id(), lut));
108 } 108 }
109 109
110 void DrmDisplayHost::OnChannelEstablished() { 110 void DrmDisplayHost::OnGpuThreadReady() {
111 is_dummy_ = false; 111 is_dummy_ = false;
112 112
113 // Note: These responses are done here since the OnChannelDestroyed() is 113 // Note: These responses are done here since the OnChannelDestroyed() is
114 // called after OnChannelEstablished(). 114 // called after OnChannelEstablished().
115 ClearCallbacks(); 115 ClearCallbacks();
116 } 116 }
117 117
118 void DrmDisplayHost::OnChannelDestroyed() { 118 void DrmDisplayHost::OnGpuThreadRetired() {}
119 }
120 119
121 void DrmDisplayHost::ClearCallbacks() { 120 void DrmDisplayHost::ClearCallbacks() {
122 if (!configure_callback_.is_null()) 121 if (!configure_callback_.is_null())
123 OnDisplayConfigured(false); 122 OnDisplayConfigured(false);
124 if (!get_hdcp_callback_.is_null()) 123 if (!get_hdcp_callback_.is_null())
125 OnHDCPStateReceived(false, HDCP_STATE_UNDESIRED); 124 OnHDCPStateReceived(false, HDCP_STATE_UNDESIRED);
126 if (!set_hdcp_callback_.is_null()) 125 if (!set_hdcp_callback_.is_null())
127 OnHDCPStateUpdated(false); 126 OnHDCPStateUpdated(false);
128 } 127 }
129 128
130 } // namespace ui 129 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/host/drm_display_host.h ('k') | ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698