Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2014 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_COMMAND_BUFFER_SERVICE_PATH_MANAGER_H_ | |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_PATH_MANAGER_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/containers/hash_tables.h" | |
| 12 #include "base/memory/ref_counted.h" | |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "gpu/command_buffer/service/gl_utils.h" | |
| 15 #include "gpu/gpu_export.h" | |
| 16 | |
| 17 namespace gpu { | |
| 18 namespace gles2 { | |
| 19 | |
| 20 // This class keeps track of paths and their client and service ids | |
| 21 // so we can correctly clear them. | |
| 22 class GPU_EXPORT PathManager { | |
| 23 public: | |
| 24 PathManager(); | |
| 25 ~PathManager(); | |
| 26 | |
| 27 // Must call before destruction. | |
| 28 void Destroy(bool have_context); | |
| 29 | |
| 30 // Creates a path | |
|
piman
2014/04/24 22:26:36
nit: period at the end of comments (here and below
| |
| 31 void CreatePath(GLuint client_id, GLuint service_id); | |
| 32 | |
| 33 // Gets the path. Returns false if path not found | |
| 34 bool GetPath(GLuint client_id, GLuint* service_id = NULL); | |
| 35 | |
| 36 // Removes a range of paths | |
| 37 void RemovePaths(GLuint path, GLuint range); | |
| 38 | |
| 39 private: | |
| 40 // Info for each path in the system. | |
| 41 typedef base::hash_map<GLuint, GLuint> PathMap; | |
| 42 PathMap path_map_; | |
| 43 | |
| 44 bool have_context_; | |
| 45 | |
| 46 DISALLOW_COPY_AND_ASSIGN(PathManager); | |
| 47 }; | |
| 48 | |
| 49 } // namespace gles2 | |
| 50 } // namespace gpu | |
| 51 | |
| 52 #endif // GPU_COMMAND_BUFFER_SERVICE_PATH_MANAGER_H_ | |
| OLD | NEW |