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

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

Issue 763383002: GPU: Flush in glBind* to avoid being executed after future glDelete* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review issues Created 6 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 | « gpu/command_buffer/client/share_group.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « gpu/command_buffer/client/share_group.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698