| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "GrGpuGL.h" | 8 #include "GrGpuGL.h" |
| 9 | 9 |
| 10 #include "GrEffect.h" | 10 #include "GrEffect.h" |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 vbuf = (GrGLVertexBuffer*) this->getGeomSrc().fVertexBuffer; | 302 vbuf = (GrGLVertexBuffer*) this->getGeomSrc().fVertexBuffer; |
| 303 break; | 303 break; |
| 304 case kArray_GeometrySrcType: | 304 case kArray_GeometrySrcType: |
| 305 case kReserved_GeometrySrcType: | 305 case kReserved_GeometrySrcType: |
| 306 this->finalizeReservedVertices(); | 306 this->finalizeReservedVertices(); |
| 307 vertexOffsetInBytes += geoPoolState.fPoolStartVertex * this->getGeom
Src().fVertexSize; | 307 vertexOffsetInBytes += geoPoolState.fPoolStartVertex * this->getGeom
Src().fVertexSize; |
| 308 vbuf = (GrGLVertexBuffer*) geoPoolState.fPoolVertexBuffer; | 308 vbuf = (GrGLVertexBuffer*) geoPoolState.fPoolVertexBuffer; |
| 309 break; | 309 break; |
| 310 default: | 310 default: |
| 311 vbuf = NULL; // suppress warning | 311 vbuf = NULL; // suppress warning |
| 312 GrCrash("Unknown geometry src type!"); | 312 SkFAIL("Unknown geometry src type!"); |
| 313 } | 313 } |
| 314 | 314 |
| 315 SkASSERT(NULL != vbuf); | 315 SkASSERT(NULL != vbuf); |
| 316 SkASSERT(!vbuf->isLocked()); | 316 SkASSERT(!vbuf->isLocked()); |
| 317 vertexOffsetInBytes += vbuf->baseOffset(); | 317 vertexOffsetInBytes += vbuf->baseOffset(); |
| 318 | 318 |
| 319 GrGLIndexBuffer* ibuf = NULL; | 319 GrGLIndexBuffer* ibuf = NULL; |
| 320 if (info.isIndexed()) { | 320 if (info.isIndexed()) { |
| 321 SkASSERT(NULL != indexOffsetInBytes); | 321 SkASSERT(NULL != indexOffsetInBytes); |
| 322 | 322 |
| 323 switch (this->getGeomSrc().fIndexSrc) { | 323 switch (this->getGeomSrc().fIndexSrc) { |
| 324 case kBuffer_GeometrySrcType: | 324 case kBuffer_GeometrySrcType: |
| 325 *indexOffsetInBytes = 0; | 325 *indexOffsetInBytes = 0; |
| 326 ibuf = (GrGLIndexBuffer*)this->getGeomSrc().fIndexBuffer; | 326 ibuf = (GrGLIndexBuffer*)this->getGeomSrc().fIndexBuffer; |
| 327 break; | 327 break; |
| 328 case kArray_GeometrySrcType: | 328 case kArray_GeometrySrcType: |
| 329 case kReserved_GeometrySrcType: | 329 case kReserved_GeometrySrcType: |
| 330 this->finalizeReservedIndices(); | 330 this->finalizeReservedIndices(); |
| 331 *indexOffsetInBytes = geoPoolState.fPoolStartIndex * sizeof(GrGLusho
rt); | 331 *indexOffsetInBytes = geoPoolState.fPoolStartIndex * sizeof(GrGLusho
rt); |
| 332 ibuf = (GrGLIndexBuffer*) geoPoolState.fPoolIndexBuffer; | 332 ibuf = (GrGLIndexBuffer*) geoPoolState.fPoolIndexBuffer; |
| 333 break; | 333 break; |
| 334 default: | 334 default: |
| 335 ibuf = NULL; // suppress warning | 335 ibuf = NULL; // suppress warning |
| 336 GrCrash("Unknown geometry src type!"); | 336 SkFAIL("Unknown geometry src type!"); |
| 337 } | 337 } |
| 338 | 338 |
| 339 SkASSERT(NULL != ibuf); | 339 SkASSERT(NULL != ibuf); |
| 340 SkASSERT(!ibuf->isLocked()); | 340 SkASSERT(!ibuf->isLocked()); |
| 341 *indexOffsetInBytes += ibuf->baseOffset(); | 341 *indexOffsetInBytes += ibuf->baseOffset(); |
| 342 } | 342 } |
| 343 GrGLAttribArrayState* attribState = | 343 GrGLAttribArrayState* attribState = |
| 344 fHWGeometryState.bindArrayAndBuffersToDraw(this, vbuf, ibuf); | 344 fHWGeometryState.bindArrayAndBuffersToDraw(this, vbuf, ibuf); |
| 345 | 345 |
| 346 if (fCurrentProgram->hasVertexShader()) { | 346 if (fCurrentProgram->hasVertexShader()) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 359 GrGLAttribTypeToLayout(attribType).fCount, | 359 GrGLAttribTypeToLayout(attribType).fCount, |
| 360 GrGLAttribTypeToLayout(attribType).fType, | 360 GrGLAttribTypeToLayout(attribType).fType, |
| 361 GrGLAttribTypeToLayout(attribType).fNormalized, | 361 GrGLAttribTypeToLayout(attribType).fNormalized, |
| 362 stride, | 362 stride, |
| 363 reinterpret_cast<GrGLvoid*>( | 363 reinterpret_cast<GrGLvoid*>( |
| 364 vertexOffsetInBytes + vertexAttrib->fOffset)); | 364 vertexOffsetInBytes + vertexAttrib->fOffset)); |
| 365 } | 365 } |
| 366 attribState->disableUnusedArrays(this, usedAttribArraysMask); | 366 attribState->disableUnusedArrays(this, usedAttribArraysMask); |
| 367 } | 367 } |
| 368 } | 368 } |
| OLD | NEW |