Index: ui/ozone/platform/drm/gpu/drm_thread_proxy.cc |
diff --git a/ui/ozone/platform/drm/gpu/drm_thread_proxy.cc b/ui/ozone/platform/drm/gpu/drm_thread_proxy.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..19442cb096e37a41a9ae2f1ec500e4b4152c029c |
--- /dev/null |
+++ b/ui/ozone/platform/drm/gpu/drm_thread_proxy.cc |
@@ -0,0 +1,33 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "ui/ozone/platform/drm/gpu/drm_thread_proxy.h" |
+ |
+#include "base/bind.h" |
+#include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" |
+#include "ui/ozone/platform/drm/gpu/message_filter_proxy.h" |
+#include "ui/ozone/platform/drm/gpu/proxy_helpers.h" |
+ |
+namespace ui { |
+ |
+DrmThreadProxy::DrmThreadProxy() {} |
+ |
+DrmThreadProxy::~DrmThreadProxy() {} |
+ |
+scoped_refptr<MessageFilterProxy> DrmThreadProxy::CreateMessageFilterProxy() { |
+ return make_scoped_refptr(new MessageFilterProxy(&drm_thread_)); |
+} |
+ |
+scoped_ptr<DrmWindowProxy> DrmThreadProxy::CreateDrmWindowProxy( |
+ gfx::AcceleratedWidget widget) { |
+ // Because the DrmDeviceManager can be used from any thread without posting a |
+ // message to the DRM thread, we need to make sure that the DRM thread has |
+ // finished processing the window creation message before returning the proxy |
+ // otherwise we could start requesting buffer allocations for an unrealized |
+ // window. |
+ PostSyncTask(drm_thread_.task_runner(), base::Bind(&base::DoNothing)); |
spang
2015/09/30 18:47:31
Can you do the sync post in CreateNativePixmap ins
dnicoara
2015/10/01 14:36:15
I was talking to alexst@ yesterday and I'll rework
|
+ return make_scoped_ptr(new DrmWindowProxy(widget, &drm_thread_)); |
+} |
+ |
+} // namespace ui |