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

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

Issue 1708983002: Command buffer: Fix bugs for drawing when the type of vertex attrib is a packed type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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) 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 "gpu/command_buffer/service/buffer_manager.h" 5 #include "gpu/command_buffer/service/buffer_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 GLuint offset, GLsizei count, GLenum type, GLuint* max_value) { 216 GLuint offset, GLsizei count, GLenum type, GLuint* max_value) {
217 Range range(offset, count, type); 217 Range range(offset, count, type);
218 RangeToMaxValueMap::iterator it = range_set_.find(range); 218 RangeToMaxValueMap::iterator it = range_set_.find(range);
219 if (it != range_set_.end()) { 219 if (it != range_set_.end()) {
220 *max_value = it->second; 220 *max_value = it->second;
221 return true; 221 return true;
222 } 222 }
223 223
224 uint32_t size; 224 uint32_t size;
225 if (!SafeMultiplyUint32( 225 if (!SafeMultiplyUint32(
226 count, GLES2Util::GetGLTypeSizeForTexturesAndBuffers(type), &size)) { 226 count, GLES2Util::GetGLTypeSizeForBuffers(type), &size)) {
227 return false; 227 return false;
228 } 228 }
229 229
230 if (!SafeAddUint32(offset, size, &size)) { 230 if (!SafeAddUint32(offset, size, &size)) {
231 return false; 231 return false;
232 } 232 }
233 233
234 if (size > static_cast<uint32_t>(size_)) { 234 if (size > static_cast<uint32_t>(size_)) {
235 return false; 235 return false;
236 } 236 }
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 auto guid = gfx::GetGLBufferGUIDForTracing( 554 auto guid = gfx::GetGLBufferGUIDForTracing(
555 memory_tracker_->ShareGroupTracingGUID(), client_buffer_id); 555 memory_tracker_->ShareGroupTracingGUID(), client_buffer_id);
556 pmd->CreateSharedGlobalAllocatorDump(guid); 556 pmd->CreateSharedGlobalAllocatorDump(guid);
557 pmd->AddOwnershipEdge(dump->guid(), guid); 557 pmd->AddOwnershipEdge(dump->guid(), guid);
558 } 558 }
559 return true; 559 return true;
560 } 560 }
561 561
562 } // namespace gles2 562 } // namespace gles2
563 } // namespace gpu 563 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698