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