OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
4 * | 3 * |
5 * 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 |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
8 | 7 |
9 #include "GrDefaultPathRenderer.h" | 8 #include "GrDefaultPathRenderer.h" |
10 | 9 |
11 #include "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 for (int p = 0; p < passCount; ++p) { | 453 for (int p = 0; p < passCount; ++p) { |
455 drawState->setDrawFace(drawFace[p]); | 454 drawState->setDrawFace(drawFace[p]); |
456 if (NULL != passes[p]) { | 455 if (NULL != passes[p]) { |
457 *drawState->stencil() = *passes[p]; | 456 *drawState->stencil() = *passes[p]; |
458 } | 457 } |
459 | 458 |
460 if (lastPassIsBounds && (p == passCount-1)) { | 459 if (lastPassIsBounds && (p == passCount-1)) { |
461 if (!colorWritesWereDisabled) { | 460 if (!colorWritesWereDisabled) { |
462 drawState->disableState(GrDrawState::kNoColorWrites_StateBit); | 461 drawState->disableState(GrDrawState::kNoColorWrites_StateBit); |
463 } | 462 } |
464 GrRect bounds; | 463 SkRect bounds; |
465 GrDrawState::AutoViewMatrixRestore avmr; | 464 GrDrawState::AutoViewMatrixRestore avmr; |
466 if (reverse) { | 465 if (reverse) { |
467 GrAssert(NULL != drawState->getRenderTarget()); | 466 GrAssert(NULL != drawState->getRenderTarget()); |
468 // draw over the dev bounds (which will be the whole dst surface
for inv fill). | 467 // draw over the dev bounds (which will be the whole dst surface
for inv fill). |
469 bounds = devBounds; | 468 bounds = devBounds; |
470 SkMatrix vmi; | 469 SkMatrix vmi; |
471 // mapRect through persp matrix may not be correct | 470 // mapRect through persp matrix may not be correct |
472 if (!drawState->getViewMatrix().hasPerspective() && | 471 if (!drawState->getViewMatrix().hasPerspective() && |
473 drawState->getViewInverse(&vmi)) { | 472 drawState->getViewInverse(&vmi)) { |
474 vmi.mapRect(&bounds); | 473 vmi.mapRect(&bounds); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 false); | 512 false); |
514 } | 513 } |
515 | 514 |
516 void GrDefaultPathRenderer::onStencilPath(const SkPath& path, | 515 void GrDefaultPathRenderer::onStencilPath(const SkPath& path, |
517 const SkStrokeRec& stroke, | 516 const SkStrokeRec& stroke, |
518 GrDrawTarget* target) { | 517 GrDrawTarget* target) { |
519 GrAssert(SkPath::kInverseEvenOdd_FillType != path.getFillType()); | 518 GrAssert(SkPath::kInverseEvenOdd_FillType != path.getFillType()); |
520 GrAssert(SkPath::kInverseWinding_FillType != path.getFillType()); | 519 GrAssert(SkPath::kInverseWinding_FillType != path.getFillType()); |
521 this->internalDrawPath(path, stroke, target, true); | 520 this->internalDrawPath(path, stroke, target, true); |
522 } | 521 } |
OLD | NEW |