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

Side by Side Diff: ui/ozone/platform/dri/native_display_delegate_proxy.cc

Issue 796263002: Remove synchronous GetDisplays() and Configure() from NativeDisplayDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@async-refactor5
Patch Set: Removed deprecated calls from TestNativeDisplayDelegate and update the ExternalControl test Created 6 years 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
« no previous file with comments | « ui/ozone/platform/dri/native_display_delegate_proxy.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/dri/native_display_delegate_proxy.h" 5 #include "ui/ozone/platform/dri/native_display_delegate_proxy.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/display/types/display_snapshot.h" 10 #include "ui/display/types/display_snapshot.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 89
90 void NativeDisplayDelegateProxy::SetBackgroundColor(uint32_t color_argb) { 90 void NativeDisplayDelegateProxy::SetBackgroundColor(uint32_t color_argb) {
91 NOTIMPLEMENTED(); 91 NOTIMPLEMENTED();
92 } 92 }
93 93
94 void NativeDisplayDelegateProxy::ForceDPMSOn() { 94 void NativeDisplayDelegateProxy::ForceDPMSOn() {
95 proxy_->Send(new OzoneGpuMsg_ForceDPMSOn()); 95 proxy_->Send(new OzoneGpuMsg_ForceDPMSOn());
96 } 96 }
97 97
98 std::vector<DisplaySnapshot*> NativeDisplayDelegateProxy::GetDisplays() {
99 // GetDisplays() is supposed to force a refresh of the display list.
100 proxy_->Send(new OzoneGpuMsg_RefreshNativeDisplays(
101 std::vector<DisplaySnapshot_Params>()));
102 return displays_.get();
103 }
104
105 void NativeDisplayDelegateProxy::GetDisplays( 98 void NativeDisplayDelegateProxy::GetDisplays(
106 const GetDisplaysCallback& callback) { 99 const GetDisplaysCallback& callback) {
107 callback.Run(GetDisplays()); 100 // GetDisplays() is supposed to force a refresh of the display list.
101 proxy_->Send(new OzoneGpuMsg_RefreshNativeDisplays(
102 std::vector<DisplaySnapshot_Params>()));
103 callback.Run(displays_.get());
108 } 104 }
109 105
110 void NativeDisplayDelegateProxy::AddMode(const DisplaySnapshot& output, 106 void NativeDisplayDelegateProxy::AddMode(const DisplaySnapshot& output,
111 const DisplayMode* mode) { 107 const DisplayMode* mode) {
112 } 108 }
113 109
114 bool NativeDisplayDelegateProxy::Configure(const DisplaySnapshot& output, 110 void NativeDisplayDelegateProxy::Configure(const DisplaySnapshot& output,
115 const DisplayMode* mode, 111 const DisplayMode* mode,
116 const gfx::Point& origin) { 112 const gfx::Point& origin,
113 const ConfigureCallback& callback) {
117 // TODO(dnicoara) Should handle an asynchronous response. 114 // TODO(dnicoara) Should handle an asynchronous response.
118 if (mode) 115 if (mode)
119 proxy_->Send(new OzoneGpuMsg_ConfigureNativeDisplay( 116 proxy_->Send(new OzoneGpuMsg_ConfigureNativeDisplay(
120 output.display_id(), GetDisplayModeParams(*mode), origin)); 117 output.display_id(), GetDisplayModeParams(*mode), origin));
121 else 118 else
122 proxy_->Send(new OzoneGpuMsg_DisableNativeDisplay(output.display_id())); 119 proxy_->Send(new OzoneGpuMsg_DisableNativeDisplay(output.display_id()));
123 120
124 return true; 121 callback.Run(true);
125 }
126
127 void NativeDisplayDelegateProxy::Configure(const DisplaySnapshot& output,
128 const DisplayMode* mode,
129 const gfx::Point& origin,
130 const ConfigureCallback& callback) {
131 callback.Run(Configure(output, mode, origin));
132 } 122 }
133 123
134 void NativeDisplayDelegateProxy::CreateFrameBuffer(const gfx::Size& size) { 124 void NativeDisplayDelegateProxy::CreateFrameBuffer(const gfx::Size& size) {
135 } 125 }
136 126
137 bool NativeDisplayDelegateProxy::GetHDCPState(const DisplaySnapshot& output, 127 bool NativeDisplayDelegateProxy::GetHDCPState(const DisplaySnapshot& output,
138 HDCPState* state) { 128 HDCPState* state) {
139 NOTIMPLEMENTED(); 129 NOTIMPLEMENTED();
140 return false; 130 return false;
141 } 131 }
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 displays_.clear(); 228 displays_.clear();
239 for (size_t i = 0; i < displays.size(); ++i) 229 for (size_t i = 0; i < displays.size(); ++i)
240 displays_.push_back( 230 displays_.push_back(
241 new DriDisplaySnapshotProxy(displays[i], display_manager_)); 231 new DriDisplaySnapshotProxy(displays[i], display_manager_));
242 232
243 FOR_EACH_OBSERVER(NativeDisplayObserver, observers_, 233 FOR_EACH_OBSERVER(NativeDisplayObserver, observers_,
244 OnConfigurationChanged()); 234 OnConfigurationChanged());
245 } 235 }
246 236
247 } // namespace ui 237 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/native_display_delegate_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698