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.
5 #ifndef UI_OZONE_PUBLIC_OZONE_GPU_THREAD_HELPER_H_
6 #define UI_OZONE_PUBLIC_OZONE_GPU_THREAD_HELPER_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/ozone/ozone_export.h"
13 class SingleThreadTaskRunner
;
20 class FakeGpuProcessHost
;
22 // Helper class for applications that do not have a dedicated GPU channel.
24 // This sets up message forwarding between the "gpu" and "ui" threads.
25 class OZONE_EXPORT OzoneGpuTestHelper
{
28 virtual ~OzoneGpuTestHelper();
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
35 const scoped_refptr
<base::SingleThreadTaskRunner
>& ui_task_runner
,
36 const scoped_refptr
<base::SingleThreadTaskRunner
>& gpu_task_runner
);
39 scoped_ptr
<FakeGpuProcess
> fake_gpu_process_
;
40 scoped_ptr
<FakeGpuProcessHost
> fake_gpu_process_host_
;
41 scoped_ptr
<base::Thread
> io_helper_thread_
;
43 DISALLOW_COPY_AND_ASSIGN(OzoneGpuTestHelper
);
48 #endif // UI_OZONE_PUBLIC_OZONE_GPU_THREAD_HELPER_H_