| 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 |
| 11 #define GL_CALL(GPU, X) GR_GL_CALL(GPU->glInterface(), X) | 11 #define GL_CALL(GPU, X) GR_GL_CALL(GPU->glInterface(), X) |
| 12 | 12 |
| 13 #if GR_DEBUG | 13 #ifdef SK_DEBUG |
| 14 #define VALIDATE() this->validate() | 14 #define VALIDATE() this->validate() |
| 15 #else | 15 #else |
| 16 #define VALIDATE() do {} while(false) | 16 #define VALIDATE() do {} while(false) |
| 17 #endif | 17 #endif |
| 18 | 18 |
| 19 // GL_STREAM_DRAW triggers an optimization in Chromium's GPU process where a cli
ent's vertex buffer | 19 // GL_STREAM_DRAW triggers an optimization in Chromium's GPU process where a cli
ent's vertex buffer |
| 20 // objects are implemented as client-side-arrays on tile-deferred architectures. | 20 // objects are implemented as client-side-arrays on tile-deferred architectures. |
| 21 #define DYNAMIC_USAGE_PARAM GR_GL_STREAM_DRAW | 21 #define DYNAMIC_USAGE_PARAM GR_GL_STREAM_DRAW |
| 22 | 22 |
| 23 GrGLBufferImpl::GrGLBufferImpl(GrGpuGL* gpu, const Desc& desc, GrGLenum bufferTy
pe) | 23 GrGLBufferImpl::GrGLBufferImpl(GrGpuGL* gpu, const Desc& desc, GrGLenum bufferTy
pe) |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 return true; | 156 return true; |
| 157 } | 157 } |
| 158 | 158 |
| 159 void GrGLBufferImpl::validate() const { | 159 void GrGLBufferImpl::validate() const { |
| 160 SkASSERT(GR_GL_ARRAY_BUFFER == fBufferType || GR_GL_ELEMENT_ARRAY_BUFFER ==
fBufferType); | 160 SkASSERT(GR_GL_ARRAY_BUFFER == fBufferType || GR_GL_ELEMENT_ARRAY_BUFFER ==
fBufferType); |
| 161 // The following assert isn't valid when the buffer has been abandoned: | 161 // The following assert isn't valid when the buffer has been abandoned: |
| 162 // SkASSERT((0 == fDesc.fID) == (NULL != fCPUData)); | 162 // SkASSERT((0 == fDesc.fID) == (NULL != fCPUData)); |
| 163 SkASSERT(0 != fDesc.fID || !fDesc.fIsWrapped); | 163 SkASSERT(0 != fDesc.fID || !fDesc.fIsWrapped); |
| 164 SkASSERT(NULL == fCPUData || NULL == fLockPtr || fCPUData == fLockPtr); | 164 SkASSERT(NULL == fCPUData || NULL == fLockPtr || fCPUData == fLockPtr); |
| 165 } | 165 } |
| OLD | NEW |