| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stack> | 5 #include <stack> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "gpu/command_buffer/client/share_group.h" | 8 #include "gpu/command_buffer/client/share_group.h" |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 ids[ii] = id_allocator_.AllocateIDAtOrAbove(id_offset); | 42 ids[ii] = id_allocator_.AllocateIDAtOrAbove(id_offset); |
| 43 id_offset = ids[ii] + 1; | 43 id_offset = ids[ii] + 1; |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 // Overridden from IdHandlerInterface. | 48 // Overridden from IdHandlerInterface. |
| 49 virtual bool FreeIds( | 49 virtual bool FreeIds( |
| 50 GLES2Implementation* gl_impl, | 50 GLES2Implementation* gl_impl, |
| 51 GLsizei n, const GLuint* ids, DeleteFn delete_fn) OVERRIDE { | 51 GLsizei n, const GLuint* ids, DeleteFn delete_fn) OVERRIDE { |
| 52 // Possibly may do a synchronous ipc, so can't hold a lock across it on |
| 53 // pepper: http://crbug.com/418651 |
| 54 (gl_impl->*delete_fn)(n, ids); |
| 55 // We need to ensure that the delete call is evaluated on the service side |
| 56 // before any other contexts issue commands using these client ids. |
| 57 // TODO(vmiura): Can remove this by virtualizing internal ids, however |
| 58 // this code only affects PPAPI for now. |
| 59 gl_impl->helper()->CommandBufferHelper::Flush(); |
| 60 |
| 52 base::AutoLock auto_lock(lock_); | 61 base::AutoLock auto_lock(lock_); |
| 53 | 62 |
| 54 for (GLsizei ii = 0; ii < n; ++ii) { | 63 for (GLsizei ii = 0; ii < n; ++ii) { |
| 55 id_allocator_.FreeID(ids[ii]); | 64 id_allocator_.FreeID(ids[ii]); |
| 56 } | 65 } |
| 57 | 66 |
| 58 (gl_impl->*delete_fn)(n, ids); | |
| 59 // We need to ensure that the delete call is evaluated on the service side | |
| 60 // before any other contexts issue commands using these client ids. | |
| 61 // TODO(vmiura): Can remove this by virtualizing internal ids, however | |
| 62 // this code only affects PPAPI for now. | |
| 63 gl_impl->helper()->CommandBufferHelper::Flush(); | |
| 64 return true; | 67 return true; |
| 65 } | 68 } |
| 66 | 69 |
| 67 // Overridden from IdHandlerInterface. | 70 // Overridden from IdHandlerInterface. |
| 68 virtual bool MarkAsUsedForBind(GLuint id) OVERRIDE { | 71 virtual bool MarkAsUsedForBind(GLuint id) OVERRIDE { |
| 69 if (id == 0) | 72 if (id == 0) |
| 70 return true; | 73 return true; |
| 71 base::AutoLock auto_lock(lock_); | 74 base::AutoLock auto_lock(lock_); |
| 72 return id_allocator_.MarkAsUsed(id); | 75 return id_allocator_.MarkAsUsed(id); |
| 73 } | 76 } |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 } | 253 } |
| 251 | 254 |
| 252 void ShareGroup::set_program_info_manager(ProgramInfoManager* manager) { | 255 void ShareGroup::set_program_info_manager(ProgramInfoManager* manager) { |
| 253 program_info_manager_.reset(manager); | 256 program_info_manager_.reset(manager); |
| 254 } | 257 } |
| 255 | 258 |
| 256 ShareGroup::~ShareGroup() {} | 259 ShareGroup::~ShareGroup() {} |
| 257 | 260 |
| 258 } // namespace gles2 | 261 } // namespace gles2 |
| 259 } // namespace gpu | 262 } // namespace gpu |
| OLD | NEW |