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

Unified Diff: ui/ozone/public/ozone_gpu_test_helper.h

Issue 936703002: Fix UiThreadGpu initialization for video accelerator tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/dri/ozone_platform_dri.cc ('k') | ui/ozone/public/ozone_gpu_test_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/public/ozone_gpu_test_helper.h
diff --git a/ui/ozone/public/ozone_gpu_test_helper.h b/ui/ozone/public/ozone_gpu_test_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..e3428656ad5a680a93a9af67e98890e5298cced6
--- /dev/null
+++ b/ui/ozone/public/ozone_gpu_test_helper.h
@@ -0,0 +1,48 @@
+// Copyright 2014 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.
+
+#ifndef UI_OZONE_PUBLIC_OZONE_GPU_THREAD_HELPER_H_
+#define UI_OZONE_PUBLIC_OZONE_GPU_THREAD_HELPER_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "ui/ozone/ozone_export.h"
+
+namespace base {
+class SingleThreadTaskRunner;
+class Thread;
+}
+
+namespace ui {
+
+class FakeGpuProcess;
+class FakeGpuProcessHost;
+
+// Helper class for applications that do not have a dedicated GPU channel.
+//
+// This sets up message forwarding between the "gpu" and "ui" threads.
+class OZONE_EXPORT OzoneGpuTestHelper {
+ public:
+ OzoneGpuTestHelper();
+ virtual ~OzoneGpuTestHelper();
+
+ // Start processing gpu messages. The host process will be using the
+ // |gpu_task_runner| to post messages intended for the GPU thread. The "gpu"
+ // process will be using the |ui_task_runner| to post messages intended for
+ // the "ui" thread.
+ bool Initialize(
+ const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner,
+ const scoped_refptr<base::SingleThreadTaskRunner>& gpu_task_runner);
+
+ private:
+ scoped_ptr<FakeGpuProcess> fake_gpu_process_;
+ scoped_ptr<FakeGpuProcessHost> fake_gpu_process_host_;
+ scoped_ptr<base::Thread> io_helper_thread_;
+
+ DISALLOW_COPY_AND_ASSIGN(OzoneGpuTestHelper);
+};
+
+} // namespace ui
+
+#endif // UI_OZONE_PUBLIC_OZONE_GPU_THREAD_HELPER_H_
« no previous file with comments | « ui/ozone/platform/dri/ozone_platform_dri.cc ('k') | ui/ozone/public/ozone_gpu_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698