blob: 6516ba6ae8a71f0de26b0e00382b87b2167e87c9 [file] [log] [blame]
[email protected]d7a2d892013-08-16 07:45:361// Copyright 2013 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
[email protected]8707caa2013-09-04 16:41:305#ifndef CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_
6#define CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_
[email protected]d7a2d892013-08-16 07:45:367
8#include "base/threading/thread.h"
9#include "content/common/content_export.h"
morritac6238ab2015-03-18 01:48:2910#include "content/common/in_process_child_thread_params.h"
[email protected]d7a2d892013-08-16 07:45:3611
boliuc5befe72015-07-21 19:08:5612namespace gpu {
13class SyncPointManager;
14}
15
[email protected]d7a2d892013-08-16 07:45:3616namespace content {
17
grt8c648422015-06-29 18:17:1718class GpuMemoryBufferFactory;
[email protected]d7a2d892013-08-16 07:45:3619class GpuProcess;
20
21// This class creates a GPU thread (instead of a GPU process), when running
22// with --in-process-gpu or --single-process.
[email protected]8707caa2013-09-04 16:41:3023class InProcessGpuThread : public base::Thread {
[email protected]d7a2d892013-08-16 07:45:3624 public:
boliuc5befe72015-07-21 19:08:5625 InProcessGpuThread(const InProcessChildThreadParams& params,
26 gpu::SyncPointManager* sync_point_manager_override);
dchenge933b3e2014-10-21 11:44:0927 ~InProcessGpuThread() override;
[email protected]d7a2d892013-08-16 07:45:3628
29 protected:
dchenge933b3e2014-10-21 11:44:0930 void Init() override;
31 void CleanUp() override;
[email protected]d7a2d892013-08-16 07:45:3632
33 private:
morritac6238ab2015-03-18 01:48:2934 InProcessChildThreadParams params_;
35
[email protected]d7a2d892013-08-16 07:45:3636 // Deleted in CleanUp() on the gpu thread, so don't use smart pointers.
37 GpuProcess* gpu_process_;
38
boliuc5befe72015-07-21 19:08:5639 // Can be null if overridden.
40 scoped_ptr<gpu::SyncPointManager> sync_point_manager_;
41
42 // Non-owning.
43 gpu::SyncPointManager* sync_point_manager_override_;
44
grt8c648422015-06-29 18:17:1745 scoped_ptr<GpuMemoryBufferFactory> gpu_memory_buffer_factory_;
46
[email protected]8707caa2013-09-04 16:41:3047 DISALLOW_COPY_AND_ASSIGN(InProcessGpuThread);
[email protected]d7a2d892013-08-16 07:45:3648};
49
[email protected]8707caa2013-09-04 16:41:3050CONTENT_EXPORT base::Thread* CreateInProcessGpuThread(
morritac6238ab2015-03-18 01:48:2951 const InProcessChildThreadParams& params);
[email protected]d7a2d892013-08-16 07:45:3652
53} // namespace content
54
[email protected]8707caa2013-09-04 16:41:3055#endif // CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_