| 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 "base/basictypes.h" |
| 9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "gpu/command_buffer/common/image_buffer_manager.h" |
| 11 #include "gpu/gpu_export.h" | 12 #include "gpu/gpu_export.h" |
| 12 | 13 |
| 13 namespace gfx { | 14 namespace gfx { |
| 14 class GLImage; | 15 class GLImage; |
| 15 } | 16 } |
| 16 | 17 |
| 17 namespace gpu { | 18 namespace gpu { |
| 18 namespace gles2 { | 19 namespace gles2 { |
| 19 | 20 |
| 20 // Interface used by the cmd decoder to lookup images. | 21 // Interface used by the cmd decoder to lookup images. |
| 21 class GPU_EXPORT ImageManager : public base::RefCounted<ImageManager> { | 22 class GPU_EXPORT ImageManager : public base::RefCounted<ImageManager>, |
| 23 public ImageManagerProxy { |
| 22 public: | 24 public: |
| 23 ImageManager(); | 25 ImageManager(); |
| 24 | 26 |
| 25 void AddImage(gfx::GLImage* gl_image, int32 service_id); | 27 void AddImage(gfx::GLImage* gl_image, int32 service_id); |
| 26 void RemoveImage(int32 service_id); | 28 void RemoveImage(int32 service_id); |
| 27 gfx::GLImage* LookupImage(int32 service_id); | 29 gfx::GLImage* LookupImage(int32 service_id); |
| 28 | 30 |
| 31 // Methods from ImageManagerProxy |
| 32 void AddImageBuffer(void* buffer, int image_id, int width, |
| 33 int height) OVERRIDE; |
| 29 private: | 34 private: |
| 30 friend class base::RefCounted<ImageManager>; | 35 friend class base::RefCounted<ImageManager>; |
| 31 | 36 |
| 32 ~ImageManager(); | 37 ~ImageManager(); |
| 33 | 38 |
| 34 typedef base::hash_map<uint32, scoped_refptr<gfx::GLImage> > GLImageMap; | 39 typedef base::hash_map<uint32, scoped_refptr<gfx::GLImage> > GLImageMap; |
| 35 GLImageMap gl_images_; | 40 GLImageMap gl_images_; |
| 36 | 41 |
| 37 DISALLOW_COPY_AND_ASSIGN(ImageManager); | 42 DISALLOW_COPY_AND_ASSIGN(ImageManager); |
| 38 }; | 43 }; |
| 39 | 44 |
| 40 } // namespage gles2 | 45 } // namespage gles2 |
| 41 } // namespace gpu | 46 } // namespace gpu |
| 42 | 47 |
| 43 #endif // GPU_COMMAND_BUFFER_SERVICE_IMAGE_MANAGER_H_ | 48 #endif // GPU_COMMAND_BUFFER_SERVICE_IMAGE_MANAGER_H_ |
| OLD | NEW |