OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef GPU_COMMAND_BUFFER_SERVICE_ID_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_ID_MANAGER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_ID_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_ID_MANAGER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
10 #include "gpu/command_buffer/service/gl_utils.h" | 10 #include "gpu/command_buffer/service/gl_utils.h" |
11 #include "gpu/gpu_export.h" | |
12 | 11 |
13 namespace gpu { | 12 namespace gpu { |
14 namespace gles2 { | 13 namespace gles2 { |
15 | 14 |
16 // This class maps one set of ids to another. | 15 // This class maps one set of ids to another. |
17 // | 16 // |
18 // NOTE: To support shared resources an instance of this class will | 17 // NOTE: To support shared resources an instance of this class will |
19 // need to be shared by multiple GLES2Decoders. | 18 // need to be shared by multiple GLES2Decoders. |
20 class GPU_EXPORT IdManager { | 19 class IdManager { |
21 public: | 20 public: |
22 IdManager(); | 21 IdManager(); |
23 ~IdManager(); | 22 ~IdManager(); |
24 | 23 |
25 // Maps a client_id to a service_id. Return false if the client_id or | 24 // Maps a client_id to a service_id. Return false if the client_id or |
26 // service_id are already mapped to something else. | 25 // service_id are already mapped to something else. |
27 bool AddMapping(GLuint client_id, GLuint service_id); | 26 bool AddMapping(GLuint client_id, GLuint service_id); |
28 | 27 |
29 // Unmaps a pair of ids. Returns false if the pair were not previously mapped. | 28 // Unmaps a pair of ids. Returns false if the pair were not previously mapped. |
30 bool RemoveMapping(GLuint client_id, GLuint service_id); | 29 bool RemoveMapping(GLuint client_id, GLuint service_id); |
(...skipping 11 matching lines...) Expand all Loading... |
42 MapType id_map_; | 41 MapType id_map_; |
43 | 42 |
44 DISALLOW_COPY_AND_ASSIGN(IdManager); | 43 DISALLOW_COPY_AND_ASSIGN(IdManager); |
45 }; | 44 }; |
46 | 45 |
47 } // namespace gles2 | 46 } // namespace gles2 |
48 } // namespace gpu | 47 } // namespace gpu |
49 | 48 |
50 #endif // GPU_COMMAND_BUFFER_SERVICE_ID_MANAGER_H_ | 49 #endif // GPU_COMMAND_BUFFER_SERVICE_ID_MANAGER_H_ |
51 | 50 |
OLD | NEW |