| 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 } | 368 } |
| 369 for (int s = 0; s < drawState.numCoverageStages(); ++s) { | 369 for (int s = 0; s < drawState.numCoverageStages(); ++s) { |
| 370 const GrProcessor* effect = drawState.getCoverageStage(s).getProcessor()
; | 370 const GrProcessor* effect = drawState.getCoverageStage(s).getProcessor()
; |
| 371 int numTextures = effect->numTextures(); | 371 int numTextures = effect->numTextures(); |
| 372 for (int t = 0; t < numTextures; ++t) { | 372 for (int t = 0; t < numTextures; ++t) { |
| 373 GrTexture* texture = effect->texture(t); | 373 GrTexture* texture = effect->texture(t); |
| 374 SkASSERT(texture->asRenderTarget() != drawState.getRenderTarget()); | 374 SkASSERT(texture->asRenderTarget() != drawState.getRenderTarget()); |
| 375 } | 375 } |
| 376 } | 376 } |
| 377 | 377 |
| 378 SkASSERT(drawState.validateVertexAttribs()); | |
| 379 #endif | 378 #endif |
| 380 if (NULL == drawState.getRenderTarget()) { | 379 if (NULL == drawState.getRenderTarget()) { |
| 381 return false; | 380 return false; |
| 382 } | 381 } |
| 383 return true; | 382 return true; |
| 384 } | 383 } |
| 385 | 384 |
| 386 bool GrDrawTarget::setupDstReadIfNecessary(GrDrawState* ds, | 385 bool GrDrawTarget::setupDstReadIfNecessary(GrDrawState* ds, |
| 387 GrDeviceCoordTexture* dstCopy, | 386 GrDeviceCoordTexture* dstCopy, |
| 388 const SkRect* drawBounds) { | 387 const SkRect* drawBounds) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 | 464 |
| 466 if (devBounds) { | 465 if (devBounds) { |
| 467 info.setDevBounds(*devBounds); | 466 info.setDevBounds(*devBounds); |
| 468 } | 467 } |
| 469 | 468 |
| 470 // TODO: We should continue with incorrect blending. | 469 // TODO: We should continue with incorrect blending. |
| 471 GrDeviceCoordTexture dstCopy; | 470 GrDeviceCoordTexture dstCopy; |
| 472 if (!this->setupDstReadIfNecessary(ds, &dstCopy, devBounds)) { | 471 if (!this->setupDstReadIfNecessary(ds, &dstCopy, devBounds)) { |
| 473 return; | 472 return; |
| 474 } | 473 } |
| 475 this->setDrawBuffers(&info, ds->getVertexStride()); | 474 this->setDrawBuffers(&info, ds->getGeometryProcessor()->getVertexStride(
)); |
| 476 | 475 |
| 477 this->onDraw(*ds, info, scissorState, dstCopy.texture() ? &dstCopy : NUL
L); | 476 this->onDraw(*ds, info, scissorState, dstCopy.texture() ? &dstCopy : NUL
L); |
| 478 } | 477 } |
| 479 } | 478 } |
| 480 | 479 |
| 481 void GrDrawTarget::drawNonIndexed(GrDrawState* ds, | 480 void GrDrawTarget::drawNonIndexed(GrDrawState* ds, |
| 482 GrPrimitiveType type, | 481 GrPrimitiveType type, |
| 483 int startVertex, | 482 int startVertex, |
| 484 int vertexCount, | 483 int vertexCount, |
| 485 const SkRect* devBounds) { | 484 const SkRect* devBounds) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 508 if (devBounds) { | 507 if (devBounds) { |
| 509 info.setDevBounds(*devBounds); | 508 info.setDevBounds(*devBounds); |
| 510 } | 509 } |
| 511 | 510 |
| 512 // TODO: We should continue with incorrect blending. | 511 // TODO: We should continue with incorrect blending. |
| 513 GrDeviceCoordTexture dstCopy; | 512 GrDeviceCoordTexture dstCopy; |
| 514 if (!this->setupDstReadIfNecessary(ds, &dstCopy, devBounds)) { | 513 if (!this->setupDstReadIfNecessary(ds, &dstCopy, devBounds)) { |
| 515 return; | 514 return; |
| 516 } | 515 } |
| 517 | 516 |
| 518 this->setDrawBuffers(&info, ds->getVertexStride()); | 517 this->setDrawBuffers(&info, ds->getGeometryProcessor()->getVertexStride(
)); |
| 519 | 518 |
| 520 this->onDraw(*ds, info, scissorState, dstCopy.texture() ? &dstCopy : NUL
L); | 519 this->onDraw(*ds, info, scissorState, dstCopy.texture() ? &dstCopy : NUL
L); |
| 521 } | 520 } |
| 522 } | 521 } |
| 523 | 522 |
| 524 static const GrStencilSettings& winding_path_stencil_settings() { | 523 static const GrStencilSettings& winding_path_stencil_settings() { |
| 525 GR_STATIC_CONST_SAME_STENCIL_STRUCT(gSettings, | 524 GR_STATIC_CONST_SAME_STENCIL_STRUCT(gSettings, |
| 526 kIncClamp_StencilOp, | 525 kIncClamp_StencilOp, |
| 527 kIncClamp_StencilOp, | 526 kIncClamp_StencilOp, |
| 528 kAlwaysIfInClip_StencilFunc, | 527 kAlwaysIfInClip_StencilFunc, |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 info.fInstanceCount = SkTMin(instanceCount, maxInstancesPerDraw); | 771 info.fInstanceCount = SkTMin(instanceCount, maxInstancesPerDraw); |
| 773 info.fVertexCount = info.fInstanceCount * verticesPerInstance; | 772 info.fVertexCount = info.fInstanceCount * verticesPerInstance; |
| 774 info.fIndexCount = info.fInstanceCount * indicesPerInstance; | 773 info.fIndexCount = info.fInstanceCount * indicesPerInstance; |
| 775 | 774 |
| 776 if (this->checkDraw(*ds, | 775 if (this->checkDraw(*ds, |
| 777 type, | 776 type, |
| 778 info.fStartVertex, | 777 info.fStartVertex, |
| 779 info.fStartIndex, | 778 info.fStartIndex, |
| 780 info.fVertexCount, | 779 info.fVertexCount, |
| 781 info.fIndexCount)) { | 780 info.fIndexCount)) { |
| 782 this->setDrawBuffers(&info, ds->getVertexStride()); | 781 this->setDrawBuffers(&info, ds->getGeometryProcessor()->getVertexStr
ide()); |
| 783 this->onDraw(*ds, info, scissorState, dstCopy.texture() ? &dstCopy :
NULL); | 782 this->onDraw(*ds, info, scissorState, dstCopy.texture() ? &dstCopy :
NULL); |
| 784 } | 783 } |
| 785 info.fStartVertex += info.fVertexCount; | 784 info.fStartVertex += info.fVertexCount; |
| 786 instanceCount -= info.fInstanceCount; | 785 instanceCount -= info.fInstanceCount; |
| 787 } | 786 } |
| 788 } | 787 } |
| 789 | 788 |
| 790 //////////////////////////////////////////////////////////////////////////////// | 789 //////////////////////////////////////////////////////////////////////////////// |
| 791 | 790 |
| 792 GrDrawTarget::AutoReleaseGeometry::AutoReleaseGeometry( | 791 GrDrawTarget::AutoReleaseGeometry::AutoReleaseGeometry( |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 GrDrawState::AutoRestoreStencil* ars, | 1157 GrDrawState::AutoRestoreStencil* ars, |
| 1159 GrDrawState* ds, | 1158 GrDrawState* ds, |
| 1160 GrClipMaskManager::ScissorState* scissorState) { | 1159 GrClipMaskManager::ScissorState* scissorState) { |
| 1161 return fClipMaskManager.setupClipping(ds, | 1160 return fClipMaskManager.setupClipping(ds, |
| 1162 are, | 1161 are, |
| 1163 ars, | 1162 ars, |
| 1164 scissorState, | 1163 scissorState, |
| 1165 this->getClip(), | 1164 this->getClip(), |
| 1166 devBounds); | 1165 devBounds); |
| 1167 } | 1166 } |
| OLD | NEW |