OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 | 10 |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 | 465 |
466 if (devBounds) { | 466 if (devBounds) { |
467 info.setDevBounds(*devBounds); | 467 info.setDevBounds(*devBounds); |
468 } | 468 } |
469 | 469 |
470 // TODO: We should continue with incorrect blending. | 470 // TODO: We should continue with incorrect blending. |
471 GrDeviceCoordTexture dstCopy; | 471 GrDeviceCoordTexture dstCopy; |
472 if (!this->setupDstReadIfNecessary(ds, &dstCopy, devBounds)) { | 472 if (!this->setupDstReadIfNecessary(ds, &dstCopy, devBounds)) { |
473 return; | 473 return; |
474 } | 474 } |
475 this->setDrawBuffers(&info); | 475 this->setDrawBuffers(&info, ds->getVertexStride()); |
476 | 476 |
477 this->onDraw(*ds, info, scissorState, dstCopy.texture() ? &dstCopy : NUL
L); | 477 this->onDraw(*ds, info, scissorState, dstCopy.texture() ? &dstCopy : NUL
L); |
478 } | 478 } |
479 } | 479 } |
480 | 480 |
481 void GrDrawTarget::drawNonIndexed(GrDrawState* ds, | 481 void GrDrawTarget::drawNonIndexed(GrDrawState* ds, |
482 GrPrimitiveType type, | 482 GrPrimitiveType type, |
483 int startVertex, | 483 int startVertex, |
484 int vertexCount, | 484 int vertexCount, |
485 const SkRect* devBounds) { | 485 const SkRect* devBounds) { |
(...skipping 22 matching lines...) Expand all Loading... |
508 if (devBounds) { | 508 if (devBounds) { |
509 info.setDevBounds(*devBounds); | 509 info.setDevBounds(*devBounds); |
510 } | 510 } |
511 | 511 |
512 // TODO: We should continue with incorrect blending. | 512 // TODO: We should continue with incorrect blending. |
513 GrDeviceCoordTexture dstCopy; | 513 GrDeviceCoordTexture dstCopy; |
514 if (!this->setupDstReadIfNecessary(ds, &dstCopy, devBounds)) { | 514 if (!this->setupDstReadIfNecessary(ds, &dstCopy, devBounds)) { |
515 return; | 515 return; |
516 } | 516 } |
517 | 517 |
518 this->setDrawBuffers(&info); | 518 this->setDrawBuffers(&info, ds->getVertexStride()); |
519 | 519 |
520 this->onDraw(*ds, info, scissorState, dstCopy.texture() ? &dstCopy : NUL
L); | 520 this->onDraw(*ds, info, scissorState, dstCopy.texture() ? &dstCopy : NUL
L); |
521 } | 521 } |
522 } | 522 } |
523 | 523 |
524 static const GrStencilSettings& winding_path_stencil_settings() { | 524 static const GrStencilSettings& winding_path_stencil_settings() { |
525 GR_STATIC_CONST_SAME_STENCIL_STRUCT(gSettings, | 525 GR_STATIC_CONST_SAME_STENCIL_STRUCT(gSettings, |
526 kIncClamp_StencilOp, | 526 kIncClamp_StencilOp, |
527 kIncClamp_StencilOp, | 527 kIncClamp_StencilOp, |
528 kAlwaysIfInClip_StencilFunc, | 528 kAlwaysIfInClip_StencilFunc, |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 GrDeviceCoordTexture dstCopy; | 766 GrDeviceCoordTexture dstCopy; |
767 if (!this->setupDstReadIfNecessary(ds, &dstCopy, devBounds)) { | 767 if (!this->setupDstReadIfNecessary(ds, &dstCopy, devBounds)) { |
768 return; | 768 return; |
769 } | 769 } |
770 | 770 |
771 while (instanceCount) { | 771 while (instanceCount) { |
772 info.fInstanceCount = SkTMin(instanceCount, maxInstancesPerDraw); | 772 info.fInstanceCount = SkTMin(instanceCount, maxInstancesPerDraw); |
773 info.fVertexCount = info.fInstanceCount * verticesPerInstance; | 773 info.fVertexCount = info.fInstanceCount * verticesPerInstance; |
774 info.fIndexCount = info.fInstanceCount * indicesPerInstance; | 774 info.fIndexCount = info.fInstanceCount * indicesPerInstance; |
775 | 775 |
776 this->setDrawBuffers(&info); | |
777 | |
778 if (this->checkDraw(*ds, | 776 if (this->checkDraw(*ds, |
779 type, | 777 type, |
780 info.fStartVertex, | 778 info.fStartVertex, |
781 info.fStartIndex, | 779 info.fStartIndex, |
782 info.fVertexCount, | 780 info.fVertexCount, |
783 info.fIndexCount)) { | 781 info.fIndexCount)) { |
| 782 this->setDrawBuffers(&info, ds->getVertexStride()); |
784 this->onDraw(*ds, info, scissorState, dstCopy.texture() ? &dstCopy :
NULL); | 783 this->onDraw(*ds, info, scissorState, dstCopy.texture() ? &dstCopy :
NULL); |
785 } | 784 } |
786 info.fStartVertex += info.fVertexCount; | 785 info.fStartVertex += info.fVertexCount; |
787 instanceCount -= info.fInstanceCount; | 786 instanceCount -= info.fInstanceCount; |
788 } | 787 } |
789 } | 788 } |
790 | 789 |
791 //////////////////////////////////////////////////////////////////////////////// | 790 //////////////////////////////////////////////////////////////////////////////// |
792 | 791 |
793 GrDrawTarget::AutoReleaseGeometry::AutoReleaseGeometry( | 792 GrDrawTarget::AutoReleaseGeometry::AutoReleaseGeometry( |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 GrDrawState::AutoRestoreStencil* ars, | 1158 GrDrawState::AutoRestoreStencil* ars, |
1160 GrDrawState* ds, | 1159 GrDrawState* ds, |
1161 GrClipMaskManager::ScissorState* scissorState) { | 1160 GrClipMaskManager::ScissorState* scissorState) { |
1162 return fClipMaskManager.setupClipping(ds, | 1161 return fClipMaskManager.setupClipping(ds, |
1163 are, | 1162 are, |
1164 ars, | 1163 ars, |
1165 scissorState, | 1164 scissorState, |
1166 this->getClip(), | 1165 this->getClip(), |
1167 devBounds); | 1166 devBounds); |
1168 } | 1167 } |
OLD | NEW |