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