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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 5676003: Make shader and program object lifetimes match OpenGL ES spec.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/gles2_implementation.cc
===================================================================
--- gpu/command_buffer/client/gles2_implementation.cc (revision 68479)
+++ gpu/command_buffer/client/gles2_implementation.cc (working copy)
@@ -59,6 +59,34 @@
IdAllocator id_allocator_;
};
+// An id handler for non-shared ids that are never reused.
+class NonSharedNonReusedIdHandler : public IdHandlerInterface {
+ public:
+ NonSharedNonReusedIdHandler() : last_id_(0) { }
+ virtual ~NonSharedNonReusedIdHandler() { }
+
+ // Overridden from IdHandlerInterface.
+ virtual void MakeIds(GLuint id_offset, GLsizei n, GLuint* ids) {
+ for (GLsizei ii = 0; ii < n; ++ii) {
+ ids[ii] = ++last_id_ + id_offset;
+ }
+ }
+
+ // Overridden from IdHandlerInterface.
+ virtual void FreeIds(GLsizei /* n */, const GLuint* /* ids */) {
+ // Ids are never freed.
+ }
+
+ // Overridden from IdHandlerInterface.
+ virtual bool MarkAsUsedForBind(GLuint /* id */) {
+ // This is only used for Shaders and Programs which have no bind.
+ return false;
+ }
+
+ private:
+ GLuint last_id_;
+};
+
// An id handler for shared ids.
class SharedIdHandler : public IdHandlerInterface {
public:
@@ -439,7 +467,7 @@
buffer_id_handler_.reset(new NonSharedIdHandler());
framebuffer_id_handler_.reset(new NonSharedIdHandler());
renderbuffer_id_handler_.reset(new NonSharedIdHandler());
- program_and_shader_id_handler_.reset(new NonSharedIdHandler());
+ program_and_shader_id_handler_.reset(new NonSharedNonReusedIdHandler());
texture_id_handler_.reset(new NonSharedIdHandler());
}
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698