| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 #include "GrDefaultPathRenderer.h" | 9 #include "GrDefaultPathRenderer.h" |
| 10 | 10 |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 drawState->setDrawFace(drawFace[p]); | 452 drawState->setDrawFace(drawFace[p]); |
| 453 if (NULL != passes[p]) { | 453 if (NULL != passes[p]) { |
| 454 *drawState->stencil() = *passes[p]; | 454 *drawState->stencil() = *passes[p]; |
| 455 } | 455 } |
| 456 | 456 |
| 457 if (lastPassIsBounds && (p == passCount-1)) { | 457 if (lastPassIsBounds && (p == passCount-1)) { |
| 458 if (!colorWritesWereDisabled) { | 458 if (!colorWritesWereDisabled) { |
| 459 drawState->disableState(GrDrawState::kNoColorWrites_StateBit); | 459 drawState->disableState(GrDrawState::kNoColorWrites_StateBit); |
| 460 } | 460 } |
| 461 GrRect bounds; | 461 GrRect bounds; |
| 462 GrDrawState::AutoDeviceCoordDraw adcd; | 462 GrDrawState::AutoViewMatrixRestore avmr; |
| 463 if (reverse) { | 463 if (reverse) { |
| 464 GrAssert(NULL != drawState->getRenderTarget()); | 464 GrAssert(NULL != drawState->getRenderTarget()); |
| 465 // draw over the dev bounds (which will be the whole dst surface
for inv fill). | 465 // draw over the dev bounds (which will be the whole dst surface
for inv fill). |
| 466 bounds = devBounds; | 466 bounds = devBounds; |
| 467 SkMatrix vmi; | 467 SkMatrix vmi; |
| 468 // mapRect through persp matrix may not be correct | 468 // mapRect through persp matrix may not be correct |
| 469 if (!drawState->getViewMatrix().hasPerspective() && | 469 if (!drawState->getViewMatrix().hasPerspective() && |
| 470 drawState->getViewInverse(&vmi)) { | 470 drawState->getViewInverse(&vmi)) { |
| 471 vmi.mapRect(&bounds); | 471 vmi.mapRect(&bounds); |
| 472 } else { | 472 } else { |
| 473 adcd.set(drawState); | 473 avmr.setIdentity(drawState); |
| 474 } | 474 } |
| 475 } else { | 475 } else { |
| 476 bounds = path.getBounds(); | 476 bounds = path.getBounds(); |
| 477 } | 477 } |
| 478 GrDrawTarget::AutoGeometryAndStatePush agasp(target, GrDrawTarget::k
Preserve_ASRInit); | 478 GrDrawTarget::AutoGeometryAndStatePush agasp(target, GrDrawTarget::k
Preserve_ASRInit); |
| 479 target->drawSimpleRect(bounds, NULL); | 479 target->drawSimpleRect(bounds, NULL); |
| 480 } else { | 480 } else { |
| 481 if (passCount > 1) { | 481 if (passCount > 1) { |
| 482 drawState->enableState(GrDrawState::kNoColorWrites_StateBit); | 482 drawState->enableState(GrDrawState::kNoColorWrites_StateBit); |
| 483 } | 483 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 510 false); | 510 false); |
| 511 } | 511 } |
| 512 | 512 |
| 513 void GrDefaultPathRenderer::onStencilPath(const SkPath& path, | 513 void GrDefaultPathRenderer::onStencilPath(const SkPath& path, |
| 514 const SkStrokeRec& stroke, | 514 const SkStrokeRec& stroke, |
| 515 GrDrawTarget* target) { | 515 GrDrawTarget* target) { |
| 516 GrAssert(SkPath::kInverseEvenOdd_FillType != path.getFillType()); | 516 GrAssert(SkPath::kInverseEvenOdd_FillType != path.getFillType()); |
| 517 GrAssert(SkPath::kInverseWinding_FillType != path.getFillType()); | 517 GrAssert(SkPath::kInverseWinding_FillType != path.getFillType()); |
| 518 this->internalDrawPath(path, stroke, target, true); | 518 this->internalDrawPath(path, stroke, target, true); |
| 519 } | 519 } |
| OLD | NEW |