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" |
| 11 #include "GrDefaultGeoProcFactory.h" |
11 #include "GrDrawState.h" | 12 #include "GrDrawState.h" |
12 #include "GrPathUtils.h" | 13 #include "GrPathUtils.h" |
13 #include "SkString.h" | 14 #include "SkString.h" |
14 #include "SkStrokeRec.h" | 15 #include "SkStrokeRec.h" |
15 #include "SkTLazy.h" | 16 #include "SkTLazy.h" |
16 #include "SkTraceEvent.h" | 17 #include "SkTraceEvent.h" |
17 | 18 |
18 | 19 |
19 GrDefaultPathRenderer::GrDefaultPathRenderer(bool separateStencilSupport, | 20 GrDefaultPathRenderer::GrDefaultPathRenderer(bool separateStencilSupport, |
20 bool stencilWrapOpsSupport) | 21 bool stencilWrapOpsSupport) |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 } | 490 } |
490 } else { | 491 } else { |
491 bounds = path.getBounds(); | 492 bounds = path.getBounds(); |
492 } | 493 } |
493 GrDrawTarget::AutoGeometryAndStatePush agasp(target, GrDrawTarget::k
Preserve_ASRInit); | 494 GrDrawTarget::AutoGeometryAndStatePush agasp(target, GrDrawTarget::k
Preserve_ASRInit); |
494 target->drawSimpleRect(bounds); | 495 target->drawSimpleRect(bounds); |
495 } else { | 496 } else { |
496 if (passCount > 1) { | 497 if (passCount > 1) { |
497 drawState->enableState(GrDrawState::kNoColorWrites_StateBit); | 498 drawState->enableState(GrDrawState::kNoColorWrites_StateBit); |
498 } | 499 } |
| 500 GrDrawState::AutoRestoreEffects are(drawState); |
| 501 drawState->setGeometryProcessor(GrDefaultGeoProcFactory::Create(fals
e))->unref(); |
499 if (indexCnt) { | 502 if (indexCnt) { |
500 target->drawIndexed(primType, 0, 0, | 503 target->drawIndexed(primType, 0, 0, |
501 vertexCnt, indexCnt, &devBounds); | 504 vertexCnt, indexCnt, &devBounds); |
502 } else { | 505 } else { |
503 target->drawNonIndexed(primType, 0, vertexCnt, &devBounds); | 506 target->drawNonIndexed(primType, 0, vertexCnt, &devBounds); |
504 } | 507 } |
505 } | 508 } |
506 } | 509 } |
507 return true; | 510 return true; |
508 } | 511 } |
(...skipping 19 matching lines...) Expand all Loading... |
528 false); | 531 false); |
529 } | 532 } |
530 | 533 |
531 void GrDefaultPathRenderer::onStencilPath(const SkPath& path, | 534 void GrDefaultPathRenderer::onStencilPath(const SkPath& path, |
532 const SkStrokeRec& stroke, | 535 const SkStrokeRec& stroke, |
533 GrDrawTarget* target) { | 536 GrDrawTarget* target) { |
534 SkASSERT(SkPath::kInverseEvenOdd_FillType != path.getFillType()); | 537 SkASSERT(SkPath::kInverseEvenOdd_FillType != path.getFillType()); |
535 SkASSERT(SkPath::kInverseWinding_FillType != path.getFillType()); | 538 SkASSERT(SkPath::kInverseWinding_FillType != path.getFillType()); |
536 this->internalDrawPath(path, stroke, target, true); | 539 this->internalDrawPath(path, stroke, target, true); |
537 } | 540 } |
OLD | NEW |