Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(474)

Unified Diff: gpu/ipc/gpu_in_process_thread_service.h

Issue 2498053004: Add InProcessContextProvider and update InProcessCommandBuffer (Closed)
Patch Set: Revert experiments and fix android_webview Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/ipc/gl_in_process_context.cc ('k') | gpu/ipc/gpu_in_process_thread_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/gpu_in_process_thread_service.h
diff --git a/gpu/ipc/gpu_in_process_thread_service.h b/gpu/ipc/gpu_in_process_thread_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..52e8b489566f77fdadf4417a9571a719510259eb
--- /dev/null
+++ b/gpu/ipc/gpu_in_process_thread_service.h
@@ -0,0 +1,55 @@
+// 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 "gpu/command_buffer/service/mailbox_manager.h"
+#include "gpu/ipc/in_process_command_buffer.h"
+#include "ui/gl/gl_share_group.h"
+
+namespace gpu {
+
+// Default Service class when a null service is used.
+class 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);
+
+ // gpu::InProcessCommandBuffer::Service implementation.
+ void ScheduleTask(const base::Closure& task) override;
+ void ScheduleDelayedWork(const base::Closure& task) override;
+ bool UseVirtualizedGLContexts() override;
+ scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache()
+ override;
+ scoped_refptr<gpu::gles2::FramebufferCompletenessCache>
+ framebuffer_completeness_cache() 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.
+ scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_;
+ scoped_refptr<gpu::gles2::FramebufferCompletenessCache>
+ framebuffer_completeness_cache_;
+
+ DISALLOW_COPY_AND_ASSIGN(GpuInProcessThreadService);
+};
+
+} // namespace gpu
+
+#endif // GPU_IPC_GPU_IN_PROCESS_THREAD_SERVICE_H_
« no previous file with comments | « gpu/ipc/gl_in_process_context.cc ('k') | gpu/ipc/gpu_in_process_thread_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698