OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_OZONE_PUBLIC_OZONE_GPU_THREAD_HELPER_H_ |
| 6 #define UI_OZONE_PUBLIC_OZONE_GPU_THREAD_HELPER_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/ozone/ozone_export.h" |
| 11 |
| 12 namespace base { |
| 13 class SingleThreadTaskRunner; |
| 14 class Thread; |
| 15 } |
| 16 |
| 17 namespace ui { |
| 18 |
| 19 class FakeGpuProcess; |
| 20 class FakeGpuProcessHost; |
| 21 |
| 22 // Helper class for applications that do not have a dedicated GPU channel. |
| 23 // |
| 24 // This sets up message forwarding between the "gpu" and "ui" threads. |
| 25 class OZONE_EXPORT OzoneGpuTestHelper { |
| 26 public: |
| 27 OzoneGpuTestHelper(); |
| 28 virtual ~OzoneGpuTestHelper(); |
| 29 |
| 30 // Start processing gpu messages. The host process will be using the |
| 31 // |gpu_task_runner| to post messages intended for the GPU thread. The "gpu" |
| 32 // process will be using the |ui_task_runner| to post messages intended for |
| 33 // the "ui" thread. |
| 34 bool Initialize( |
| 35 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner, |
| 36 const scoped_refptr<base::SingleThreadTaskRunner>& gpu_task_runner); |
| 37 |
| 38 private: |
| 39 scoped_ptr<FakeGpuProcess> fake_gpu_process_; |
| 40 scoped_ptr<FakeGpuProcessHost> fake_gpu_process_host_; |
| 41 scoped_ptr<base::Thread> io_helper_thread_; |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(OzoneGpuTestHelper); |
| 44 }; |
| 45 |
| 46 } // namespace ui |
| 47 |
| 48 #endif // UI_OZONE_PUBLIC_OZONE_GPU_THREAD_HELPER_H_ |
OLD | NEW |