| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "GrGLBufferImpl.h" | 8 #include "GrGLBufferImpl.h" |
| 9 #include "GrGpuGL.h" | 9 #include "GrGpuGL.h" |
| 10 | 10 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 GL_CALL(gpu, BufferSubData(fBufferType, 0, srcSizeInBytes, src)); | 151 GL_CALL(gpu, BufferSubData(fBufferType, 0, srcSizeInBytes, src)); |
| 152 } else { | 152 } else { |
| 153 GL_CALL(gpu, BufferData(fBufferType, srcSizeInBytes, src, usage)); | 153 GL_CALL(gpu, BufferData(fBufferType, srcSizeInBytes, src, usage)); |
| 154 } | 154 } |
| 155 #endif | 155 #endif |
| 156 return true; | 156 return true; |
| 157 } | 157 } |
| 158 | 158 |
| 159 void GrGLBufferImpl::validate() const { | 159 void GrGLBufferImpl::validate() const { |
| 160 GrAssert(GR_GL_ARRAY_BUFFER == fBufferType || GR_GL_ELEMENT_ARRAY_BUFFER ==
fBufferType); | 160 GrAssert(GR_GL_ARRAY_BUFFER == fBufferType || GR_GL_ELEMENT_ARRAY_BUFFER ==
fBufferType); |
| 161 GrAssert((0 == fDesc.fID) == (NULL != fCPUData)); | 161 // The following assert isn't valid when the buffer has been abandoned: |
| 162 // GrAssert((0 == fDesc.fID) == (NULL != fCPUData)); |
| 162 GrAssert(0 != fDesc.fID || !fDesc.fIsWrapped); | 163 GrAssert(0 != fDesc.fID || !fDesc.fIsWrapped); |
| 163 GrAssert(NULL == fCPUData || NULL == fLockPtr || fCPUData == fLockPtr); | 164 GrAssert(NULL == fCPUData || NULL == fLockPtr || fCPUData == fLockPtr); |
| 164 } | 165 } |
| OLD | NEW |