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

Unified Diff: mojo/services/gles2/gpu_state.h

Issue 1049993002: Get mojo_shell building inside chromium checkout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix presubmit Created 5 years, 9 months 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 | « mojo/services/gles2/gpu_impl.cc ('k') | mojo/services/gles2/gpu_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/gles2/gpu_state.h
diff --git a/mojo/services/gles2/gpu_state.h b/mojo/services/gles2/gpu_state.h
new file mode 100644
index 0000000000000000000000000000000000000000..1d75318c57afd3013b79be13895c5d9072cf2235
--- /dev/null
+++ b/mojo/services/gles2/gpu_state.h
@@ -0,0 +1,52 @@
+// Copyright 2015 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 SERVICES_GLES2_GPU_STATE_H_
+#define SERVICES_GLES2_GPU_STATE_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/single_thread_task_runner.h"
+#include "base/threading/thread.h"
+#include "gpu/command_buffer/service/mailbox_manager_impl.h"
+#include "gpu/command_buffer/service/sync_point_manager.h"
+#include "ui/gl/gl_share_group.h"
+
+namespace gles2 {
+
+// We need to share these across all CommandBuffer instances so that contexts
+// they create can share resources with each other via mailboxes.
+class GpuState : public base::RefCounted<GpuState> {
+ public:
+ GpuState();
+
+ // We run the CommandBufferImpl on the control_task_runner, which forwards
+ // most method class to the CommandBufferDriver, which runs on the "driver",
+ // thread (i.e., the thread on which GpuImpl instances are created).
+ scoped_refptr<base::SingleThreadTaskRunner> control_task_runner() {
+ return control_thread_.task_runner();
+ }
+
+ // These objects are intended to be used on the "driver" thread (i.e., the
+ // thread on which GpuImpl instances are created).
+ gfx::GLShareGroup* share_group() const { return share_group_.get(); }
+ gpu::gles2::MailboxManager* mailbox_manager() const {
+ return mailbox_manager_.get();
+ }
+ gpu::SyncPointManager* sync_point_manager() const {
+ return sync_point_manager_.get();
+ }
+
+ private:
+ friend class base::RefCounted<GpuState>;
+ ~GpuState();
+
+ base::Thread control_thread_;
+ scoped_refptr<gpu::SyncPointManager> sync_point_manager_;
+ scoped_refptr<gfx::GLShareGroup> share_group_;
+ scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_;
+};
+
+} // namespace gles2
+
+#endif // SERVICES_GLES2_GPU_STATE_H_
« no previous file with comments | « mojo/services/gles2/gpu_impl.cc ('k') | mojo/services/gles2/gpu_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698