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

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

Issue 301793003: During image destroy, delete textures only if we have a GL context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comment addressed. Created 6 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
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/gpu_export.h" 11 #include "gpu/gpu_export.h"
12 12
13 namespace gfx { 13 namespace gfx {
14 class GLImage; 14 class GLImage;
15 } 15 }
16 16
17 namespace gpu { 17 namespace gpu {
18 namespace gles2 { 18 namespace gles2 {
19 19
20 // This class keeps track of the images and their state. 20 // This class keeps track of the images and their state.
21 class GPU_EXPORT ImageManager { 21 class GPU_EXPORT ImageManager {
22 public: 22 public:
23 ImageManager(); 23 ImageManager();
24 ~ImageManager(); 24 ~ImageManager();
25 25
26 void AddImage(gfx::GLImage* image, int32 service_id); 26 void Destroy(bool have_context);
27 void RemoveImage(int32 service_id); 27 bool AddImage(gfx::GLImage* image, int32 service_id);
28 bool RemoveImage(int32 service_id);
no sievers 2014/07/30 12:34:08 I'd leave RemoveImage() as returning void
sohanjg 2014/07/30 13:08:02 Done.
28 gfx::GLImage* LookupImage(int32 service_id); 29 gfx::GLImage* LookupImage(int32 service_id);
29 30
30 private: 31 private:
31 typedef base::hash_map<uint32, scoped_refptr<gfx::GLImage> > GLImageMap; 32 typedef base::hash_map<int32, scoped_refptr<gfx::GLImage> > GLImageMap;
32 GLImageMap images_; 33 GLImageMap images_;
33 34
34 DISALLOW_COPY_AND_ASSIGN(ImageManager); 35 DISALLOW_COPY_AND_ASSIGN(ImageManager);
35 }; 36 };
36 37
37 } // namespage gles2 38 } // namespage gles2
38 } // namespace gpu 39 } // namespace gpu
39 40
40 #endif // GPU_COMMAND_BUFFER_SERVICE_IMAGE_MANAGER_H_ 41 #endif // GPU_COMMAND_BUFFER_SERVICE_IMAGE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698