| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |