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 "GrInOrderDrawBuffer.h" | 8 #include "GrInOrderDrawBuffer.h" |
9 | 9 |
10 #include "GrBufferAllocPool.h" | 10 #include "GrBufferAllocPool.h" |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 case kReserved_GeometrySrcType: // fallthrough | 379 case kReserved_GeometrySrcType: // fallthrough |
380 case kArray_GeometrySrcType: { | 380 case kArray_GeometrySrcType: { |
381 size_t vertexBytes = (info.vertexCount() + info.startVertex()) * | 381 size_t vertexBytes = (info.vertexCount() + info.startVertex()) * |
382 drawState.getVertexSize(); | 382 drawState.getVertexSize(); |
383 poolState.fUsedPoolVertexBytes = SkTMax(poolState.fUsedPoolVertexByt
es, vertexBytes); | 383 poolState.fUsedPoolVertexBytes = SkTMax(poolState.fUsedPoolVertexByt
es, vertexBytes); |
384 draw->fVertexBuffer = poolState.fPoolVertexBuffer; | 384 draw->fVertexBuffer = poolState.fPoolVertexBuffer; |
385 draw->adjustStartVertex(poolState.fPoolStartVertex); | 385 draw->adjustStartVertex(poolState.fPoolStartVertex); |
386 break; | 386 break; |
387 } | 387 } |
388 default: | 388 default: |
389 GrCrash("unknown geom src type"); | 389 SkFAIL("unknown geom src type"); |
390 } | 390 } |
391 draw->fVertexBuffer->ref(); | 391 draw->fVertexBuffer->ref(); |
392 | 392 |
393 if (info.isIndexed()) { | 393 if (info.isIndexed()) { |
394 switch (this->getGeomSrc().fIndexSrc) { | 394 switch (this->getGeomSrc().fIndexSrc) { |
395 case kBuffer_GeometrySrcType: | 395 case kBuffer_GeometrySrcType: |
396 draw->fIndexBuffer = this->getGeomSrc().fIndexBuffer; | 396 draw->fIndexBuffer = this->getGeomSrc().fIndexBuffer; |
397 break; | 397 break; |
398 case kReserved_GeometrySrcType: // fallthrough | 398 case kReserved_GeometrySrcType: // fallthrough |
399 case kArray_GeometrySrcType: { | 399 case kArray_GeometrySrcType: { |
400 size_t indexBytes = (info.indexCount() + info.startIndex()) * si
zeof(uint16_t); | 400 size_t indexBytes = (info.indexCount() + info.startIndex()) * si
zeof(uint16_t); |
401 poolState.fUsedPoolIndexBytes = SkTMax(poolState.fUsedPoolIndexB
ytes, indexBytes); | 401 poolState.fUsedPoolIndexBytes = SkTMax(poolState.fUsedPoolIndexB
ytes, indexBytes); |
402 draw->fIndexBuffer = poolState.fPoolIndexBuffer; | 402 draw->fIndexBuffer = poolState.fPoolIndexBuffer; |
403 draw->adjustStartIndex(poolState.fPoolStartIndex); | 403 draw->adjustStartIndex(poolState.fPoolStartIndex); |
404 break; | 404 break; |
405 } | 405 } |
406 default: | 406 default: |
407 GrCrash("unknown geom src type"); | 407 SkFAIL("unknown geom src type"); |
408 } | 408 } |
409 draw->fIndexBuffer->ref(); | 409 draw->fIndexBuffer->ref(); |
410 } else { | 410 } else { |
411 draw->fIndexBuffer = NULL; | 411 draw->fIndexBuffer = NULL; |
412 } | 412 } |
413 } | 413 } |
414 | 414 |
415 GrInOrderDrawBuffer::StencilPath::StencilPath() {} | 415 GrInOrderDrawBuffer::StencilPath::StencilPath() {} |
416 GrInOrderDrawBuffer::DrawPath::DrawPath() {} | 416 GrInOrderDrawBuffer::DrawPath::DrawPath() {} |
417 GrInOrderDrawBuffer::DrawPaths::DrawPaths() {} | 417 GrInOrderDrawBuffer::DrawPaths::DrawPaths() {} |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 this->addToCmdBuffer(kCopySurface_Cmd); | 982 this->addToCmdBuffer(kCopySurface_Cmd); |
983 return &fCopySurfaces.push_back(); | 983 return &fCopySurfaces.push_back(); |
984 } | 984 } |
985 | 985 |
986 | 986 |
987 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) { | 987 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) { |
988 INHERITED::clipWillBeSet(newClipData); | 988 INHERITED::clipWillBeSet(newClipData); |
989 fClipSet = true; | 989 fClipSet = true; |
990 fClipProxyState = kUnknown_ClipProxyState; | 990 fClipProxyState = kUnknown_ClipProxyState; |
991 } | 991 } |
OLD | NEW |