OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 GPU_IPC_GPU_IN_PROCESS_THREAD_SERVICE_H_ |
| 6 #define GPU_IPC_GPU_IN_PROCESS_THREAD_SERVICE_H_ |
| 7 |
| 8 #include "gpu/command_buffer/service/mailbox_manager.h" |
| 9 #include "gpu/ipc/in_process_command_buffer.h" |
| 10 #include "ui/gl/gl_share_group.h" |
| 11 |
| 12 namespace gpu { |
| 13 |
| 14 // Default Service class when a null service is used. |
| 15 class GpuInProcessThreadService |
| 16 : public gpu::InProcessCommandBuffer::Service, |
| 17 public base::RefCountedThreadSafe<GpuInProcessThreadService> { |
| 18 public: |
| 19 GpuInProcessThreadService( |
| 20 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 21 gpu::SyncPointManager* sync_point_manager, |
| 22 gpu::gles2::MailboxManager* mailbox_manager, |
| 23 scoped_refptr<gl::GLShareGroup> share_group); |
| 24 |
| 25 // gpu::InProcessCommandBuffer::Service implementation. |
| 26 void ScheduleTask(const base::Closure& task) override; |
| 27 void ScheduleDelayedWork(const base::Closure& task) override; |
| 28 bool UseVirtualizedGLContexts() override; |
| 29 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache() |
| 30 override; |
| 31 scoped_refptr<gpu::gles2::FramebufferCompletenessCache> |
| 32 framebuffer_completeness_cache() override; |
| 33 gpu::SyncPointManager* sync_point_manager() override; |
| 34 void AddRef() const override; |
| 35 void Release() const override; |
| 36 bool BlockThreadOnWaitSyncToken() const override; |
| 37 |
| 38 private: |
| 39 friend class base::RefCountedThreadSafe<GpuInProcessThreadService>; |
| 40 |
| 41 ~GpuInProcessThreadService() override; |
| 42 |
| 43 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 44 |
| 45 gpu::SyncPointManager* sync_point_manager_; // Non-owning. |
| 46 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; |
| 47 scoped_refptr<gpu::gles2::FramebufferCompletenessCache> |
| 48 framebuffer_completeness_cache_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(GpuInProcessThreadService); |
| 51 }; |
| 52 |
| 53 } // namespace gpu |
| 54 |
| 55 #endif // GPU_IPC_GPU_IN_PROCESS_THREAD_SERVICE_H_ |
OLD | NEW |