| 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 GrDeviceCoordTexture dstCopy; | 610 GrDeviceCoordTexture dstCopy; |
| 611 if (!this->setupDstReadIfNecessary(ds, &dstCopy, &devBounds)) { | 611 if (!this->setupDstReadIfNecessary(ds, &dstCopy, &devBounds)) { |
| 612 return; | 612 return; |
| 613 } | 613 } |
| 614 | 614 |
| 615 this->onDrawPath(*ds, path, scissorState, stencilSettings, dstCopy.texture()
? &dstCopy : NULL); | 615 this->onDrawPath(*ds, path, scissorState, stencilSettings, dstCopy.texture()
? &dstCopy : NULL); |
| 616 } | 616 } |
| 617 | 617 |
| 618 void GrDrawTarget::drawPaths(GrDrawState* ds, | 618 void GrDrawTarget::drawPaths(GrDrawState* ds, |
| 619 const GrPathRange* pathRange, | 619 const GrPathRange* pathRange, |
| 620 const uint32_t indices[], | 620 const void* indices, |
| 621 PathIndexType indexType, |
| 622 const float transformValues[], |
| 623 PathTransformType transformType, |
| 621 int count, | 624 int count, |
| 622 const float transforms[], | |
| 623 PathTransformType transformsType, | |
| 624 GrPathRendering::FillType fill) { | 625 GrPathRendering::FillType fill) { |
| 625 SkASSERT(this->caps()->pathRenderingSupport()); | 626 SkASSERT(this->caps()->pathRenderingSupport()); |
| 626 SkASSERT(pathRange); | 627 SkASSERT(pathRange); |
| 627 SkASSERT(indices); | 628 SkASSERT(indices); |
| 628 SkASSERT(transforms); | 629 SkASSERT(0 == reinterpret_cast<long>(indices) % GrPathRange::PathIndexSizeIn
Bytes(indexType)); |
| 630 SkASSERT(transformValues); |
| 629 SkASSERT(ds); | 631 SkASSERT(ds); |
| 630 | 632 |
| 631 // Setup clip | 633 // Setup clip |
| 632 GrClipMaskManager::ScissorState scissorState; | 634 GrClipMaskManager::ScissorState scissorState; |
| 633 GrDrawState::AutoRestoreEffects are; | 635 GrDrawState::AutoRestoreEffects are; |
| 634 GrDrawState::AutoRestoreStencil ars; | 636 GrDrawState::AutoRestoreStencil ars; |
| 635 | 637 |
| 636 if (!this->setupClip(NULL, &are, &ars, ds, &scissorState)) { | 638 if (!this->setupClip(NULL, &are, &ars, ds, &scissorState)) { |
| 637 return; | 639 return; |
| 638 } | 640 } |
| 639 | 641 |
| 640 // set stencil settings for path | 642 // set stencil settings for path |
| 641 GrStencilSettings stencilSettings; | 643 GrStencilSettings stencilSettings; |
| 642 this->getPathStencilSettingsForFilltype(fill, | 644 this->getPathStencilSettingsForFilltype(fill, |
| 643 ds->getRenderTarget()->getStencilBuf
fer(), | 645 ds->getRenderTarget()->getStencilBuf
fer(), |
| 644 &stencilSettings); | 646 &stencilSettings); |
| 645 | 647 |
| 646 // Don't compute a bounding box for setupDstReadIfNecessary(), we'll opt | 648 // Don't compute a bounding box for setupDstReadIfNecessary(), we'll opt |
| 647 // instead for it to just copy the entire dst. Realistically this is a moot | 649 // instead for it to just copy the entire dst. Realistically this is a moot |
| 648 // point, because any context that supports NV_path_rendering will also | 650 // point, because any context that supports NV_path_rendering will also |
| 649 // support NV_blend_equation_advanced. | 651 // support NV_blend_equation_advanced. |
| 650 GrDeviceCoordTexture dstCopy; | 652 GrDeviceCoordTexture dstCopy; |
| 651 if (!this->setupDstReadIfNecessary(ds, &dstCopy, NULL)) { | 653 if (!this->setupDstReadIfNecessary(ds, &dstCopy, NULL)) { |
| 652 return; | 654 return; |
| 653 } | 655 } |
| 654 | 656 |
| 655 this->onDrawPaths(*ds, pathRange, indices, count, transforms, transformsType
, scissorState, | 657 this->onDrawPaths(*ds, pathRange, indices, indexType, transformValues, trans
formType, count, |
| 656 stencilSettings, dstCopy.texture() ? &dstCopy : NULL); | 658 scissorState, stencilSettings, dstCopy.texture() ? &dstCop
y : NULL); |
| 657 } | 659 } |
| 658 | 660 |
| 659 void GrDrawTarget::clear(const SkIRect* rect, | 661 void GrDrawTarget::clear(const SkIRect* rect, |
| 660 GrColor color, | 662 GrColor color, |
| 661 bool canIgnoreRect, | 663 bool canIgnoreRect, |
| 662 GrRenderTarget* renderTarget) { | 664 GrRenderTarget* renderTarget) { |
| 663 if (fCaps->useDrawInsteadOfClear()) { | 665 if (fCaps->useDrawInsteadOfClear()) { |
| 664 // This works around a driver bug with clear by drawing a rect instead. | 666 // This works around a driver bug with clear by drawing a rect instead. |
| 665 // The driver will ignore a clear if it is the only thing rendered to a | 667 // The driver will ignore a clear if it is the only thing rendered to a |
| 666 // target before the target is read. | 668 // target before the target is read. |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1153 GrDrawState::AutoRestoreStencil* ars, | 1155 GrDrawState::AutoRestoreStencil* ars, |
| 1154 GrDrawState* ds, | 1156 GrDrawState* ds, |
| 1155 GrClipMaskManager::ScissorState* scissorState) { | 1157 GrClipMaskManager::ScissorState* scissorState) { |
| 1156 return fClipMaskManager.setupClipping(ds, | 1158 return fClipMaskManager.setupClipping(ds, |
| 1157 are, | 1159 are, |
| 1158 ars, | 1160 ars, |
| 1159 scissorState, | 1161 scissorState, |
| 1160 this->getClip(), | 1162 this->getClip(), |
| 1161 devBounds); | 1163 devBounds); |
| 1162 } | 1164 } |
| OLD | NEW |