diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-17 03:49:12 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-17 03:49:12 +0000 |
commit | b05a367f6e4f8eb3dd1f390ffbd134e93ae6d009 (patch) | |
tree | 15a683869c605f851113ad4adcea292e64c8de56 /gpu | |
parent | 55a44a840df93909d26134d21b68e994222223b2 (diff) | |
download | chromium_src-b05a367f6e4f8eb3dd1f390ffbd134e93ae6d009.zip chromium_src-b05a367f6e4f8eb3dd1f390ffbd134e93ae6d009.tar.gz chromium_src-b05a367f6e4f8eb3dd1f390ffbd134e93ae6d009.tar.bz2 |
Make StrictIdHandler mark IDs as used
BUG=124829
TEST=run aura build with flash and compositor thread, open youtube video, reload many times.
Review URL: https://chromiumcodereview.appspot.com/10382215
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137626 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/client/share_group.cc | 45 |
1 files changed, 4 insertions, 41 deletions
diff --git a/gpu/command_buffer/client/share_group.cc b/gpu/command_buffer/client/share_group.cc index 23e5456..e57ec60 100644 --- a/gpu/command_buffer/client/share_group.cc +++ b/gpu/command_buffer/client/share_group.cc @@ -59,57 +59,21 @@ class IdHandler : public IdHandlerInterface { virtual bool MarkAsUsedForBind(GLuint id) { return id == 0 ? true : id_allocator_.MarkAsUsed(id); } - private: + protected: IdAllocator id_allocator_; }; // An id handler that require Gen before Bind. -class StrictIdHandler : public IdHandlerInterface { +class StrictIdHandler : public IdHandler { public: StrictIdHandler() { } virtual ~StrictIdHandler() { } - // Overridden from IdHandlerInterface. - virtual void Destroy(GLES2Implementation* /* gl_impl */) { - } - - // Overridden from IdHandlerInterface. - virtual void MakeIds( - GLES2Implementation* /* gl_impl */, - GLuint id_offset, GLsizei n, GLuint* ids) { - if (id_offset == 0) { - for (GLsizei ii = 0; ii < n; ++ii) { - ids[ii] = id_allocator_.AllocateID(); - } - } else { - for (GLsizei ii = 0; ii < n; ++ii) { - ids[ii] = id_allocator_.AllocateIDAtOrAbove(id_offset); - id_offset = ids[ii] + 1; - } - } - } - - // Overridden from IdHandlerInterface. - virtual bool FreeIds( - GLES2Implementation* gl_impl, - GLsizei n, const GLuint* ids, DeleteFn delete_fn) { - for (GLsizei ii = 0; ii < n; ++ii) { - id_allocator_.FreeID(ids[ii]); - } - (gl_impl->*delete_fn)(n, ids); - // We need to ensure that the delete call is evaluated on the service side - // before any other contexts issue commands using these client ids. - gl_impl->helper()->CommandBufferHelper::Flush(); - return true; - } - - // Overridden from IdHandlerInterface. + // Overridden from IdHandler. virtual bool MarkAsUsedForBind(GLuint id) { GPU_DCHECK(id == 0 || id_allocator_.InUse(id)); - return true; + return IdHandler::MarkAsUsedForBind(id); } - private: - IdAllocator id_allocator_; }; // An id handler for ids that are never reused. @@ -274,4 +238,3 @@ void ShareGroup::SetGLES2ImplementationForDestruction( } // namespace gles2 } // namespace gpu - |