forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpu_in_process_thread_service.h
53 lines (41 loc) · 1.84 KB
/
gpu_in_process_thread_service.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2016 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 GPU_IPC_GPU_IN_PROCESS_THREAD_SERVICE_H_
#define GPU_IPC_GPU_IN_PROCESS_THREAD_SERVICE_H_
#include "base/compiler_specific.h"
#include "base/single_thread_task_runner.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "gpu/gpu_export.h"
#include "gpu/ipc/in_process_command_buffer.h"
#include "ui/gl/gl_share_group.h"
namespace gpu {
// Default Service class when no service is specified. GpuInProcessThreadService
// is used by Mus and unit tests.
class GPU_EXPORT GpuInProcessThreadService
: public gpu::InProcessCommandBuffer::Service,
public base::RefCountedThreadSafe<GpuInProcessThreadService> {
public:
GpuInProcessThreadService(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
gpu::SyncPointManager* sync_point_manager,
gpu::gles2::MailboxManager* mailbox_manager,
scoped_refptr<gl::GLShareGroup> share_group,
const GpuFeatureInfo& gpu_feature_info);
// gpu::InProcessCommandBuffer::Service implementation.
void ScheduleTask(const base::Closure& task) override;
void ScheduleDelayedWork(const base::Closure& task) override;
bool UseVirtualizedGLContexts() override;
gpu::SyncPointManager* sync_point_manager() override;
void AddRef() const override;
void Release() const override;
bool BlockThreadOnWaitSyncToken() const override;
private:
friend class base::RefCountedThreadSafe<GpuInProcessThreadService>;
~GpuInProcessThreadService() override;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
gpu::SyncPointManager* sync_point_manager_; // Non-owning.
DISALLOW_COPY_AND_ASSIGN(GpuInProcessThreadService);
};
} // namespace gpu
#endif // GPU_IPC_GPU_IN_PROCESS_THREAD_SERVICE_H_