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

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

Issue 10382215: Make StrictIdHandler mark IDs as used (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months 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 | 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 23e5456094bbb90f34b35c1c459198f299580455..e57ec607f7c0fdf0d449139306fdaec7e88aa689 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
-
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698