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

Unified Diff: cc/surfaces/deferred_gpu_command_service.h

Issue 2498053004: Add InProcessContextProvider and update InProcessCommandBuffer (Closed)
Patch Set: 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
Index: cc/surfaces/deferred_gpu_command_service.h
diff --git a/cc/surfaces/deferred_gpu_command_service.h b/cc/surfaces/deferred_gpu_command_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..e36ff2515a79da6424c9a4c08ca08fc01ba3f94e
--- /dev/null
+++ b/cc/surfaces/deferred_gpu_command_service.h
@@ -0,0 +1,57 @@
+// 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 CC_SURFACES_DEFERRED_GPU_COMMAND_SERVICE_H_
+#define CC_SURFACES_DEFERRED_GPU_COMMAND_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 cc {
+
+class DeferredGpuCommandService
piman 2016/11/15 21:57:32 nit: names... nothing "deferred" about this really
Fady Samuel 2016/11/16 00:33:35 Done.
+ : public gpu::InProcessCommandBuffer::Service,
+ public base::RefCountedThreadSafe<DeferredGpuCommandService> {
+ public:
+ DeferredGpuCommandService(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;
+ const scoped_refptr<gl::GLShareGroup>& GetShareGroup() const override;
+ bool BlockThreadOnWaitSyncToken() const override;
+
+ private:
+ friend class base::RefCountedThreadSafe<DeferredGpuCommandService>;
+
+ ~DeferredGpuCommandService() override;
+
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+
+ base::Lock tasks_lock_;
+ std::queue<base::Closure> tasks_;
piman 2016/11/15 21:57:32 nit: those aren't used.
Fady Samuel 2016/11/16 00:33:35 Done.
+
+ gpu::SyncPointManager* sync_point_manager_;
+ scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_;
+ scoped_refptr<gpu::gles2::FramebufferCompletenessCache>
+ framebuffer_completeness_cache_;
+ scoped_refptr<gl::GLShareGroup> share_group_;
+
+ DISALLOW_COPY_AND_ASSIGN(DeferredGpuCommandService);
+};
+
+} // namespace cc
+
+#endif // CC_SURFACES_DEFERRED_GPU_COMMAND_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698