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

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

Issue 2880013: Free the resources used by a context group. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_FRAMEBUFFER_MANAGER_H_ 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ 6 #define GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // Service side framebuffer id. 56 // Service side framebuffer id.
57 GLuint service_id_; 57 GLuint service_id_;
58 58
59 // A map of attachments to renderbuffers. 59 // A map of attachments to renderbuffers.
60 typedef std::map<GLenum, RenderbufferManager::RenderbufferInfo::Ref> 60 typedef std::map<GLenum, RenderbufferManager::RenderbufferInfo::Ref>
61 AttachmentToRenderbufferMap; 61 AttachmentToRenderbufferMap;
62 AttachmentToRenderbufferMap renderbuffers_; 62 AttachmentToRenderbufferMap renderbuffers_;
63 }; 63 };
64 64
65 FramebufferManager() { } 65 FramebufferManager() { }
66 ~FramebufferManager();
67
68 // Must call before destruction.
69 void Destroy(bool have_context);
66 70
67 // Creates a FramebufferInfo for the given framebuffer. 71 // Creates a FramebufferInfo for the given framebuffer.
68 void CreateFramebufferInfo(GLuint client_id, GLuint service_id); 72 void CreateFramebufferInfo(GLuint client_id, GLuint service_id);
69 73
70 // Gets the framebuffer info for the given framebuffer. 74 // Gets the framebuffer info for the given framebuffer.
71 FramebufferInfo* GetFramebufferInfo(GLuint client_id); 75 FramebufferInfo* GetFramebufferInfo(GLuint client_id);
72 76
73 // Removes a framebuffer info for the given framebuffer. 77 // Removes a framebuffer info for the given framebuffer.
74 void RemoveFramebufferInfo(GLuint client_id); 78 void RemoveFramebufferInfo(GLuint client_id);
75 79
76 // Gets a client id for a given service id. 80 // Gets a client id for a given service id.
77 bool GetClientId(GLuint service_id, GLuint* client_id) const; 81 bool GetClientId(GLuint service_id, GLuint* client_id) const;
78 82
79 private: 83 private:
80 // Info for each framebuffer in the system. 84 // Info for each framebuffer in the system.
81 // TODO(gman): Choose a faster container. 85 // TODO(gman): Choose a faster container.
82 typedef std::map<GLuint, FramebufferInfo::Ref> FramebufferInfoMap; 86 typedef std::map<GLuint, FramebufferInfo::Ref> FramebufferInfoMap;
83 FramebufferInfoMap framebuffer_infos_; 87 FramebufferInfoMap framebuffer_infos_;
84 88
85 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); 89 DISALLOW_COPY_AND_ASSIGN(FramebufferManager);
86 }; 90 };
87 91
88 } // namespace gles2 92 } // namespace gles2
89 } // namespace gpu 93 } // namespace gpu
90 94
91 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ 95 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_
92 96
93 97
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/context_group.cc ('k') | gpu/command_buffer/service/framebuffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698