| OLD | NEW |
| 1 // Copyright (c) 2012 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_IMAGE_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_IMAGE_MANAGER_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_IMAGE_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_IMAGE_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include <stdint.h> |
| 9 |
| 9 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| 11 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 11 #include "gpu/gpu_export.h" | 13 #include "gpu/gpu_export.h" |
| 12 | 14 |
| 13 namespace gl { | 15 namespace gl { |
| 14 class GLImage; | 16 class GLImage; |
| 15 } | 17 } |
| 16 | 18 |
| 17 namespace gpu { | 19 namespace gpu { |
| 18 namespace gles2 { | 20 namespace gles2 { |
| 19 | 21 |
| 20 // This class keeps track of the images and their state. | 22 // This class keeps track of the images and their state. |
| 21 class GPU_EXPORT ImageManager { | 23 class GPU_EXPORT ImageManager { |
| 22 public: | 24 public: |
| 23 ImageManager(); | 25 ImageManager(); |
| 24 ~ImageManager(); | 26 ~ImageManager(); |
| 25 | 27 |
| 26 void Destroy(bool have_context); | 28 void Destroy(bool have_context); |
| 27 void AddImage(gl::GLImage* image, int32 service_id); | 29 void AddImage(gl::GLImage* image, int32_t service_id); |
| 28 void RemoveImage(int32 service_id); | 30 void RemoveImage(int32_t service_id); |
| 29 gl::GLImage* LookupImage(int32 service_id); | 31 gl::GLImage* LookupImage(int32_t service_id); |
| 30 | 32 |
| 31 private: | 33 private: |
| 32 typedef base::hash_map<int32, scoped_refptr<gl::GLImage>> GLImageMap; | 34 typedef base::hash_map<int32_t, scoped_refptr<gl::GLImage>> GLImageMap; |
| 33 GLImageMap images_; | 35 GLImageMap images_; |
| 34 | 36 |
| 35 DISALLOW_COPY_AND_ASSIGN(ImageManager); | 37 DISALLOW_COPY_AND_ASSIGN(ImageManager); |
| 36 }; | 38 }; |
| 37 | 39 |
| 38 } // namespage gles2 | 40 } // namespage gles2 |
| 39 } // namespace gpu | 41 } // namespace gpu |
| 40 | 42 |
| 41 #endif // GPU_COMMAND_BUFFER_SERVICE_IMAGE_MANAGER_H_ | 43 #endif // GPU_COMMAND_BUFFER_SERVICE_IMAGE_MANAGER_H_ |
| OLD | NEW |