Make GL bindings conditional
[chromium-blink-merge.git] / gpu / command_buffer / service / image_manager.h
blob0a440f9e178a67b89ae0377c38eca53240cc8971
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.
5 #ifndef GPU_COMMAND_BUFFER_SERVICE_IMAGE_MANAGER_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_IMAGE_MANAGER_H_
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"
13 namespace gfx {
14 class GLImage;
17 namespace gpu {
18 namespace gles2 {
20 // This class keeps track of the images and their state.
21 class GPU_EXPORT ImageManager {
22 public:
23 ImageManager();
24 ~ImageManager();
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);
31 private:
32 typedef base::hash_map<int32, scoped_refptr<gfx::GLImage> > GLImageMap;
33 GLImageMap images_;
35 DISALLOW_COPY_AND_ASSIGN(ImageManager);
38 } // namespage gles2
39 } // namespace gpu
41 #endif // GPU_COMMAND_BUFFER_SERVICE_IMAGE_MANAGER_H_