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

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

Issue 786123002: Update from https://crrev.com/307330 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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') | gpu/command_buffer/cmd_buffer_functions.txt » ('j') | 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..b5261eebb57e5bf9f799115ce7c70846ba251784 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,20 @@ 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 {
#ifndef NDEBUG
if (id != 0) {
base::AutoLock auto_lock(lock_);
DCHECK(id_states_[id - 1] == kIdInUse);
}
#endif
+ // StrictIdHandler is used if |bind_generates_resource| is false. In that
+ // case, |bind_fn| will not use Flush() after helper->Bind*(), so it is OK
+ // to call |bind_fn| without holding the lock.
+ (gl_impl->*bind_fn)(target, id);
return true;
}
@@ -218,7 +228,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') | gpu/command_buffer/cmd_buffer_functions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698