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 "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 } else { | 556 } else { |
557 bounds = path.getBounds(); | 557 bounds = path.getBounds(); |
558 } | 558 } |
559 const SkMatrix& viewM = (reverse && viewMatrix.hasPerspective()) ? S
kMatrix::I() : | 559 const SkMatrix& viewM = (reverse && viewMatrix.hasPerspective()) ? S
kMatrix::I() : |
560 v
iewMatrix; | 560 v
iewMatrix; |
561 SkAutoTUnref<GrDrawBatch> batch( | 561 SkAutoTUnref<GrDrawBatch> batch( |
562 GrRectBatchFactory::CreateNonAAFill(color, viewM, bounds, nu
llptr, | 562 GrRectBatchFactory::CreateNonAAFill(color, viewM, bounds, nu
llptr, |
563 &localMatrix)); | 563 &localMatrix)); |
564 | 564 |
565 GrPipelineBuilder pipelineBuilder(paint, drawContext->isUnifiedMulti
sampled()); | 565 GrPipelineBuilder pipelineBuilder(paint, drawContext->isUnifiedMulti
sampled()); |
566 pipelineBuilder.setRenderTarget(drawContext->accessRenderTarget()); | |
567 pipelineBuilder.setDrawFace(drawFace[p]); | 566 pipelineBuilder.setDrawFace(drawFace[p]); |
568 if (passes[p]) { | 567 if (passes[p]) { |
569 pipelineBuilder.setUserStencil(passes[p]); | 568 pipelineBuilder.setUserStencil(passes[p]); |
570 } else { | 569 } else { |
571 pipelineBuilder.setUserStencil(userStencilSettings); | 570 pipelineBuilder.setUserStencil(userStencilSettings); |
572 } | 571 } |
573 | 572 |
574 drawContext->drawBatch(pipelineBuilder, clip, batch); | 573 drawContext->drawBatch(pipelineBuilder, clip, batch); |
575 } else { | 574 } else { |
576 DefaultPathBatch::Geometry geometry; | 575 DefaultPathBatch::Geometry geometry; |
577 geometry.fColor = color; | 576 geometry.fColor = color; |
578 geometry.fPath = path; | 577 geometry.fPath = path; |
579 geometry.fTolerance = srcSpaceTol; | 578 geometry.fTolerance = srcSpaceTol; |
580 | 579 |
581 SkAutoTUnref<GrDrawBatch> batch(DefaultPathBatch::Create(geometry, n
ewCoverage, | 580 SkAutoTUnref<GrDrawBatch> batch(DefaultPathBatch::Create(geometry, n
ewCoverage, |
582 viewMatrix,
isHairline, | 581 viewMatrix,
isHairline, |
583 devBounds))
; | 582 devBounds))
; |
584 | 583 |
585 GrPipelineBuilder pipelineBuilder(paint, drawContext->isUnifiedMulti
sampled()); | 584 GrPipelineBuilder pipelineBuilder(paint, drawContext->isUnifiedMulti
sampled()); |
586 pipelineBuilder.setRenderTarget(drawContext->accessRenderTarget()); | |
587 pipelineBuilder.setDrawFace(drawFace[p]); | 585 pipelineBuilder.setDrawFace(drawFace[p]); |
588 if (passes[p]) { | 586 if (passes[p]) { |
589 pipelineBuilder.setUserStencil(passes[p]); | 587 pipelineBuilder.setUserStencil(passes[p]); |
590 } else { | 588 } else { |
591 pipelineBuilder.setUserStencil(userStencilSettings); | 589 pipelineBuilder.setUserStencil(userStencilSettings); |
592 } | 590 } |
593 if (passCount > 1) { | 591 if (passCount > 1) { |
594 pipelineBuilder.setDisableColorXPFactory(); | 592 pipelineBuilder.setDisableColorXPFactory(); |
595 } | 593 } |
596 | 594 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 geometry.fColor = color; | 663 geometry.fColor = color; |
666 geometry.fPath = path; | 664 geometry.fPath = path; |
667 geometry.fTolerance = srcSpaceTol; | 665 geometry.fTolerance = srcSpaceTol; |
668 | 666 |
669 viewMatrix.mapRect(&bounds); | 667 viewMatrix.mapRect(&bounds); |
670 uint8_t coverage = GrRandomCoverage(random); | 668 uint8_t coverage = GrRandomCoverage(random); |
671 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); | 669 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); |
672 } | 670 } |
673 | 671 |
674 #endif | 672 #endif |
OLD | NEW |