OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 "gpu/command_buffer/service/indexed_buffer_binding_host.h" | 5 #include "gpu/command_buffer/service/indexed_buffer_binding_host.h" |
6 | 6 |
7 #include "gpu/command_buffer/service/buffer_manager.h" | 7 #include "gpu/command_buffer/service/buffer_manager.h" |
8 | 8 |
9 namespace gpu { | 9 namespace gpu { |
10 namespace gles2 { | 10 namespace gles2 { |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 for (size_t ii = changed_index; ii > 0; --ii) { | 257 for (size_t ii = changed_index; ii > 0; --ii) { |
258 if (buffer_bindings_[ii - 1].buffer.get()) { | 258 if (buffer_bindings_[ii - 1].buffer.get()) { |
259 max_non_null_binding_index_plus_one_ = ii; | 259 max_non_null_binding_index_plus_one_ = ii; |
260 break; | 260 break; |
261 } | 261 } |
262 } | 262 } |
263 } | 263 } |
264 } | 264 } |
265 } | 265 } |
266 | 266 |
| 267 bool IndexedBufferBindingHost::UsesBuffer( |
| 268 size_t used_binding_count, const Buffer* buffer) const { |
| 269 DCHECK(buffer); |
| 270 DCHECK_LE(used_binding_count, buffer_bindings_.size()); |
| 271 for (size_t ii = 0; ii < used_binding_count; ++ii) { |
| 272 if (buffer == buffer_bindings_[ii].buffer) |
| 273 return true; |
| 274 } |
| 275 return false; |
| 276 } |
| 277 |
267 } // namespace gles2 | 278 } // namespace gles2 |
268 } // namespace gpu | 279 } // namespace gpu |
OLD | NEW |