Chromium Code Reviews| Index: gpu/command_buffer/client/share_group.cc |
| diff --git a/gpu/command_buffer/client/share_group.cc b/gpu/command_buffer/client/share_group.cc |
| index c7e3845607d73d0bb669ce5912de82bfdcab5eaf..0000866dd7a350cf59a7cd7fd7f30bb19074e344 100644 |
| --- a/gpu/command_buffer/client/share_group.cc |
| +++ b/gpu/command_buffer/client/share_group.cc |
| @@ -67,11 +67,14 @@ class IdHandler : public IdHandlerInterface { |
| } |
| // Overridden from IdHandlerInterface. |
| - bool MarkAsUsedForBind(GLuint id) override { |
| - if (id == 0) |
| - return true; |
| + bool MarkAsUsedForBind(GLES2Implementation* gl_impl, |
| + GLenum target, |
| + GLuint id, |
| + BindFn bind_fn) override { |
| base::AutoLock auto_lock(lock_); |
| - return id_allocator_.MarkAsUsed(id); |
| + bool result = id ? id_allocator_.MarkAsUsed(id) : true; |
| + (gl_impl->*bind_fn)(target, id); |
| + return result; |
| } |
| void FreeContext(GLES2Implementation* gl_impl) override {} |
| @@ -147,13 +150,17 @@ class StrictIdHandler : public IdHandlerInterface { |
| } |
| // Overridden from IdHandler. |
| - bool MarkAsUsedForBind(GLuint id) override { |
| + bool MarkAsUsedForBind(GLES2Implementation* gl_impl, |
| + GLenum target, |
| + GLuint id, |
| + BindFn bind_fn) override { |
| + base::AutoLock auto_lock(lock_); |
|
piman
2014/12/05 20:31:13
You don't need to take the lock in the release pat
Peng
2014/12/05 21:04:39
Done.
|
| #ifndef NDEBUG |
| if (id != 0) { |
| - base::AutoLock auto_lock(lock_); |
| DCHECK(id_states_[id - 1] == kIdInUse); |
| } |
| #endif |
| + (gl_impl->*bind_fn)(target, id); |
| return true; |
| } |
| @@ -218,7 +225,10 @@ class NonReusedIdHandler : public IdHandlerInterface { |
| } |
| // Overridden from IdHandlerInterface. |
| - bool MarkAsUsedForBind(GLuint /* id */) override { |
| + bool MarkAsUsedForBind(GLES2Implementation* /* gl_impl */, |
| + GLenum /* target */, |
| + GLuint /* id */, |
| + BindFn /* bind_fn */) override { |
| // This is only used for Shaders and Programs which have no bind. |
| return false; |
| } |