| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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" |
| 11 | 12 |
| 12 namespace gpu { | 13 namespace gpu { |
| 13 namespace gles2 { | 14 namespace gles2 { |
| 14 | 15 |
| 15 // This class maps one set of ids to another. | 16 // This class maps one set of ids to another. |
| 16 // | 17 // |
| 17 // NOTE: To support shared resources an instance of this class will | 18 // NOTE: To support shared resources an instance of this class will |
| 18 // need to be shared by multiple GLES2Decoders. | 19 // need to be shared by multiple GLES2Decoders. |
| 19 class IdManager { | 20 class GPU_EXPORT IdManager { |
| 20 public: | 21 public: |
| 21 IdManager(); | 22 IdManager(); |
| 22 ~IdManager(); | 23 ~IdManager(); |
| 23 | 24 |
| 24 // Maps a client_id to a service_id. Return false if the client_id or | 25 // Maps a client_id to a service_id. Return false if the client_id or |
| 25 // service_id are already mapped to something else. | 26 // service_id are already mapped to something else. |
| 26 bool AddMapping(GLuint client_id, GLuint service_id); | 27 bool AddMapping(GLuint client_id, GLuint service_id); |
| 27 | 28 |
| 28 // Unmaps a pair of ids. Returns false if the pair were not previously mapped. | 29 // Unmaps a pair of ids. Returns false if the pair were not previously mapped. |
| 29 bool RemoveMapping(GLuint client_id, GLuint service_id); | 30 bool RemoveMapping(GLuint client_id, GLuint service_id); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 41 MapType id_map_; | 42 MapType id_map_; |
| 42 | 43 |
| 43 DISALLOW_COPY_AND_ASSIGN(IdManager); | 44 DISALLOW_COPY_AND_ASSIGN(IdManager); |
| 44 }; | 45 }; |
| 45 | 46 |
| 46 } // namespace gles2 | 47 } // namespace gles2 |
| 47 } // namespace gpu | 48 } // namespace gpu |
| 48 | 49 |
| 49 #endif // GPU_COMMAND_BUFFER_SERVICE_ID_MANAGER_H_ | 50 #endif // GPU_COMMAND_BUFFER_SERVICE_ID_MANAGER_H_ |
| 50 | 51 |
| OLD | NEW |