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

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_thread.cc

Issue 2903353002: Make ozone/drm/mojo more immune to startup races (Closed)
Patch Set: added todo Created 3 years, 6 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/gpu/drm_thread.h" 5 #include "ui/ozone/platform/drm/gpu/drm_thread.h"
6 6
7 #include <gbm.h> 7 #include <gbm.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 200
201 void DrmThread::SetWindowBounds(gfx::AcceleratedWidget widget, 201 void DrmThread::SetWindowBounds(gfx::AcceleratedWidget widget,
202 const gfx::Rect& bounds) { 202 const gfx::Rect& bounds) {
203 screen_manager_->GetWindow(widget)->SetBounds(bounds); 203 screen_manager_->GetWindow(widget)->SetBounds(bounds);
204 } 204 }
205 205
206 void DrmThread::SetCursor(const gfx::AcceleratedWidget& widget, 206 void DrmThread::SetCursor(const gfx::AcceleratedWidget& widget,
207 const std::vector<SkBitmap>& bitmaps, 207 const std::vector<SkBitmap>& bitmaps,
208 const gfx::Point& location, 208 const gfx::Point& location,
209 int32_t frame_delay_ms) { 209 int32_t frame_delay_ms) {
210 screen_manager_->GetWindow(widget) 210 auto window = screen_manager_->GetWindow(widget);
sadrul 2017/05/29 16:50:15 I think we suggest using 'auto*' here.
211 ->SetCursor(bitmaps, location, frame_delay_ms); 211 // TODO(rjkroege): This check is needed only to address mushrome startup
dnicoara 2017/05/29 17:01:54 Why isn't the |drm_thread_| check enough for this
212 // synchronization issues. Remove as part of http://crbug.com/581462
213 if (!window)
214 return;
215 window->SetCursor(bitmaps, location, frame_delay_ms);
212 } 216 }
213 217
214 void DrmThread::MoveCursor(const gfx::AcceleratedWidget& widget, 218 void DrmThread::MoveCursor(const gfx::AcceleratedWidget& widget,
215 const gfx::Point& location) { 219 const gfx::Point& location) {
216 screen_manager_->GetWindow(widget)->MoveCursor(location); 220 screen_manager_->GetWindow(widget)->MoveCursor(location);
217 } 221 }
218 222
219 void DrmThread::CheckOverlayCapabilities( 223 void DrmThread::CheckOverlayCapabilities(
220 gfx::AcceleratedWidget widget, 224 gfx::AcceleratedWidget widget,
221 const std::vector<OverlayCheck_Params>& overlays, 225 const std::vector<OverlayCheck_Params>& overlays,
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 correction_matrix); 294 correction_matrix);
291 } 295 }
292 296
293 // DrmThread requires a BindingSet instead of a simple Binding because it will 297 // DrmThread requires a BindingSet instead of a simple Binding because it will
294 // be used from multiple threads in multiple processes. 298 // be used from multiple threads in multiple processes.
295 void DrmThread::AddBinding(ozone::mojom::DeviceCursorRequest request) { 299 void DrmThread::AddBinding(ozone::mojom::DeviceCursorRequest request) {
296 bindings_.AddBinding(this, std::move(request)); 300 bindings_.AddBinding(this, std::move(request));
297 } 301 }
298 302
299 } // namespace ui 303 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/ozone/platform/drm/mus_thread_proxy.cc » ('j') | ui/ozone/platform/drm/mus_thread_proxy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698