Index: gpu/command_buffer/service/path_manager.h |
diff --git a/gpu/command_buffer/service/path_manager.h b/gpu/command_buffer/service/path_manager.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3c584813fe1ea0eacde55395de668f5af242f048 |
--- /dev/null |
+++ b/gpu/command_buffer/service/path_manager.h |
@@ -0,0 +1,52 @@ |
+// Copyright (c) 2014 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_COMMAND_BUFFER_SERVICE_PATH_MANAGER_H_ |
+#define GPU_COMMAND_BUFFER_SERVICE_PATH_MANAGER_H_ |
+ |
+#include <vector> |
+ |
+#include "base/basictypes.h" |
+#include "base/containers/hash_tables.h" |
+#include "base/memory/ref_counted.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "gpu/command_buffer/service/gl_utils.h" |
+#include "gpu/gpu_export.h" |
+ |
+namespace gpu { |
+namespace gles2 { |
+ |
+// This class keeps track of paths and their client and service ids |
+// so we can correctly clear them. |
+class GPU_EXPORT PathManager { |
+ public: |
+ PathManager(); |
+ ~PathManager(); |
+ |
+ // Must call before destruction. |
+ void Destroy(bool have_context); |
+ |
+ // Creates a path |
piman
2014/04/24 22:26:36
nit: period at the end of comments (here and below
|
+ void CreatePath(GLuint client_id, GLuint service_id); |
+ |
+ // Gets the path. Returns false if path not found |
+ bool GetPath(GLuint client_id, GLuint* service_id = NULL); |
+ |
+ // Removes a range of paths |
+ void RemovePaths(GLuint path, GLuint range); |
+ |
+ private: |
+ // Info for each path in the system. |
+ typedef base::hash_map<GLuint, GLuint> PathMap; |
+ PathMap path_map_; |
+ |
+ bool have_context_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(PathManager); |
+}; |
+ |
+} // namespace gles2 |
+} // namespace gpu |
+ |
+#endif // GPU_COMMAND_BUFFER_SERVICE_PATH_MANAGER_H_ |