Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Side by Side Diff: gpu/command_buffer/service/image_manager.h

Issue 20017005: gpu: Refactor GpuMemoryBuffer framework for multi-process support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "gpu/command_buffer/service/gpu_memory_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
23 : public GpuMemoryBufferManagerInterface,
24 public base::RefCounted<ImageManager> {
22 public: 25 public:
23 ImageManager(); 26 ImageManager();
24 27
28 // Overridden from GpuMemoryBufferManagerInterface:
29 virtual bool RegisterGpuMemoryBuffer(int32 id,
30 gfx::GpuMemoryBufferHandle buffer,
31 size_t width,
32 size_t height,
33 unsigned internalformat) OVERRIDE;
34 virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE;
35
25 void AddImage(gfx::GLImage* gl_image, int32 service_id); 36 void AddImage(gfx::GLImage* gl_image, int32 service_id);
26 void RemoveImage(int32 service_id); 37 void RemoveImage(int32 service_id);
27 gfx::GLImage* LookupImage(int32 service_id); 38 gfx::GLImage* LookupImage(int32 service_id);
28 39
29 private: 40 private:
30 friend class base::RefCounted<ImageManager>; 41 friend class base::RefCounted<ImageManager>;
31 42
32 ~ImageManager(); 43 virtual ~ImageManager();
33 44
34 typedef base::hash_map<uint32, scoped_refptr<gfx::GLImage> > GLImageMap; 45 typedef base::hash_map<uint32, scoped_refptr<gfx::GLImage> > GLImageMap;
35 GLImageMap gl_images_; 46 GLImageMap gl_images_;
36 47
37 DISALLOW_COPY_AND_ASSIGN(ImageManager); 48 DISALLOW_COPY_AND_ASSIGN(ImageManager);
38 }; 49 };
39 50
40 } // namespage gles2 51 } // namespage gles2
41 } // namespace gpu 52 } // namespace gpu
42 53
43 #endif // GPU_COMMAND_BUFFER_SERVICE_IMAGE_MANAGER_H_ 54 #endif // GPU_COMMAND_BUFFER_SERVICE_IMAGE_MANAGER_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gpu_memory_buffer_manager.h ('k') | gpu/command_buffer/service/image_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698