OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * 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 |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrDefaultPathRenderer.h" | 8 #include "GrDefaultPathRenderer.h" |
9 | 9 |
10 #include "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 } else { | 491 } else { |
492 bounds = path.getBounds(); | 492 bounds = path.getBounds(); |
493 } | 493 } |
494 GrDrawTarget::AutoGeometryPush agp(target); | 494 GrDrawTarget::AutoGeometryPush agp(target); |
495 target->drawSimpleRect(drawState, color, bounds); | 495 target->drawSimpleRect(drawState, color, bounds); |
496 } else { | 496 } else { |
497 if (passCount > 1) { | 497 if (passCount > 1) { |
498 drawState->enableState(GrDrawState::kNoColorWrites_StateBit); | 498 drawState->enableState(GrDrawState::kNoColorWrites_StateBit); |
499 } | 499 } |
500 GrDrawState::AutoRestoreEffects are(drawState); | 500 GrDrawState::AutoRestoreEffects are(drawState); |
501 drawState->setGeometryProcessor( | 501 SkAutoTUnref<const GrGeometryProcessor> gp( |
502 GrDefaultGeoProcFactory::Create(color, | 502 GrDefaultGeoProcFactory::Create(color, |
503 GrDefaultGeoProcFactory::kPo
sition_GPType, | 503 GrDefaultGeoProcFactory::kPo
sition_GPType, |
504 newCoverage))->unref(); | 504 newCoverage)); |
505 if (indexCnt) { | 505 if (indexCnt) { |
506 target->drawIndexed(drawState, | 506 target->drawIndexed(drawState, |
| 507 gp, |
507 primType, | 508 primType, |
508 0, | 509 0, |
509 0, | 510 0, |
510 vertexCnt, | 511 vertexCnt, |
511 indexCnt, | 512 indexCnt, |
512 &devBounds); | 513 &devBounds); |
513 } else { | 514 } else { |
514 target->drawNonIndexed(drawState, primType, 0, vertexCnt, &devBo
unds); | 515 target->drawNonIndexed(drawState, gp, primType, 0, vertexCnt, &d
evBounds); |
515 } | 516 } |
516 } | 517 } |
517 } | 518 } |
518 return true; | 519 return true; |
519 } | 520 } |
520 | 521 |
521 bool GrDefaultPathRenderer::canDrawPath(const GrDrawTarget* target, | 522 bool GrDefaultPathRenderer::canDrawPath(const GrDrawTarget* target, |
522 const GrDrawState* drawState, | 523 const GrDrawState* drawState, |
523 const SkPath& path, | 524 const SkPath& path, |
524 const SkStrokeRec& stroke, | 525 const SkStrokeRec& stroke, |
(...skipping 20 matching lines...) Expand all Loading... |
545 } | 546 } |
546 | 547 |
547 void GrDefaultPathRenderer::onStencilPath(GrDrawTarget* target, | 548 void GrDefaultPathRenderer::onStencilPath(GrDrawTarget* target, |
548 GrDrawState* drawState, | 549 GrDrawState* drawState, |
549 const SkPath& path, | 550 const SkPath& path, |
550 const SkStrokeRec& stroke) { | 551 const SkStrokeRec& stroke) { |
551 SkASSERT(SkPath::kInverseEvenOdd_FillType != path.getFillType()); | 552 SkASSERT(SkPath::kInverseEvenOdd_FillType != path.getFillType()); |
552 SkASSERT(SkPath::kInverseWinding_FillType != path.getFillType()); | 553 SkASSERT(SkPath::kInverseWinding_FillType != path.getFillType()); |
553 this->internalDrawPath(target, drawState, GrColor_WHITE, path, stroke, true)
; | 554 this->internalDrawPath(target, drawState, GrColor_WHITE, path, stroke, true)
; |
554 } | 555 } |
OLD | NEW |