| 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 SkAutoTUnref<const GrGeometryProcessor> gp( | 501 drawState->setGeometryProcessor( |
| 502 GrDefaultGeoProcFactory::Create(color, | 502 GrDefaultGeoProcFactory::Create(color, |
| 503 GrDefaultGeoProcFactory::kPo
sition_GPType, | 503 GrDefaultGeoProcFactory::kPo
sition_GPType, |
| 504 newCoverage)); | 504 newCoverage))->unref(); |
| 505 if (indexCnt) { | 505 if (indexCnt) { |
| 506 target->drawIndexed(drawState, | 506 target->drawIndexed(drawState, |
| 507 gp, | |
| 508 primType, | 507 primType, |
| 509 0, | 508 0, |
| 510 0, | 509 0, |
| 511 vertexCnt, | 510 vertexCnt, |
| 512 indexCnt, | 511 indexCnt, |
| 513 &devBounds); | 512 &devBounds); |
| 514 } else { | 513 } else { |
| 515 target->drawNonIndexed(drawState, gp, primType, 0, vertexCnt, &d
evBounds); | 514 target->drawNonIndexed(drawState, primType, 0, vertexCnt, &devBo
unds); |
| 516 } | 515 } |
| 517 } | 516 } |
| 518 } | 517 } |
| 519 return true; | 518 return true; |
| 520 } | 519 } |
| 521 | 520 |
| 522 bool GrDefaultPathRenderer::canDrawPath(const GrDrawTarget* target, | 521 bool GrDefaultPathRenderer::canDrawPath(const GrDrawTarget* target, |
| 523 const GrDrawState* drawState, | 522 const GrDrawState* drawState, |
| 524 const SkPath& path, | 523 const SkPath& path, |
| 525 const SkStrokeRec& stroke, | 524 const SkStrokeRec& stroke, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 546 } | 545 } |
| 547 | 546 |
| 548 void GrDefaultPathRenderer::onStencilPath(GrDrawTarget* target, | 547 void GrDefaultPathRenderer::onStencilPath(GrDrawTarget* target, |
| 549 GrDrawState* drawState, | 548 GrDrawState* drawState, |
| 550 const SkPath& path, | 549 const SkPath& path, |
| 551 const SkStrokeRec& stroke) { | 550 const SkStrokeRec& stroke) { |
| 552 SkASSERT(SkPath::kInverseEvenOdd_FillType != path.getFillType()); | 551 SkASSERT(SkPath::kInverseEvenOdd_FillType != path.getFillType()); |
| 553 SkASSERT(SkPath::kInverseWinding_FillType != path.getFillType()); | 552 SkASSERT(SkPath::kInverseWinding_FillType != path.getFillType()); |
| 554 this->internalDrawPath(target, drawState, GrColor_WHITE, path, stroke, true)
; | 553 this->internalDrawPath(target, drawState, GrColor_WHITE, path, stroke, true)
; |
| 555 } | 554 } |
| OLD | NEW |