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

Side by Side Diff: gpu/command_buffer/service/indexed_buffer_binding_host.cc

Issue 2435803004: Initialize buffers before allowing access to them. (Closed)
Patch Set: win failure Created 4 years, 2 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698