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

Unified Diff: ui/ozone/platform/drm/cursor_proxy_mojo.cc

Issue 2903353002: Make ozone/drm/mojo more immune to startup races (Closed)
Patch Set: make CursorProxyMojo a GpuThreadObserver Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: ui/ozone/platform/drm/cursor_proxy_mojo.cc
diff --git a/ui/ozone/platform/drm/cursor_proxy_mojo.cc b/ui/ozone/platform/drm/cursor_proxy_mojo.cc
index a0918fc0a2250a92eb8a51560bd2af26a22277b5..3e91f1b7ed2c962031c5cb1a26d5ebb826d04f83 100644
--- a/ui/ozone/platform/drm/cursor_proxy_mojo.cc
+++ b/ui/ozone/platform/drm/cursor_proxy_mojo.cc
@@ -25,6 +25,8 @@ void CursorProxyMojo::CursorSet(gfx::AcceleratedWidget widget,
const std::vector<SkBitmap>& bitmaps,
const gfx::Point& location,
int frame_delay_ms) {
+ if (!have_gpu_thread_)
+ return;
if (evdev_ref_ == base::PlatformThread::CurrentRef()) {
evdev_cursor_ptr_->SetCursor(widget, bitmaps, location, frame_delay_ms);
} else {
@@ -34,6 +36,8 @@ void CursorProxyMojo::CursorSet(gfx::AcceleratedWidget widget,
void CursorProxyMojo::Move(gfx::AcceleratedWidget widget,
const gfx::Point& location) {
+ if (!have_gpu_thread_)
+ return;
if (evdev_ref_ == base::PlatformThread::CurrentRef()) {
evdev_cursor_ptr_->MoveCursor(widget, location);
} else {
@@ -41,4 +45,14 @@ void CursorProxyMojo::Move(gfx::AcceleratedWidget widget,
}
}
+void CursorProxyMojo::OnGpuProcessLaunched() {}
+
+void CursorProxyMojo::OnGpuThreadReady() {
+ have_gpu_thread_ = true;
+}
+
+void CursorProxyMojo::OnGpuThreadRetired() {
+ have_gpu_thread_ = false;
+}
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698