Remove most modifiers of processors on GrPipelineBuilder
Change-Id: I2fc12a97d694e5c0d86c9a4e0818a058905c8cf0
Reviewed-on: https://skia-review.googlesource.com/6993
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/ops/GrMSAAPathRenderer.cpp b/src/gpu/ops/GrMSAAPathRenderer.cpp
index 5c1c110..26fdf5d 100644
--- a/src/gpu/ops/GrMSAAPathRenderer.cpp
+++ b/src/gpu/ops/GrMSAAPathRenderer.cpp
@@ -613,20 +613,25 @@
SkRect devBounds;
GetPathDevBounds(path, renderTargetContext->width(), renderTargetContext->height(), viewMatrix,
&devBounds);
- SkASSERT(passes[0]);
- std::unique_ptr<GrDrawOp> op = MSAAPathOp::Make(paint.getColor(), path, viewMatrix, devBounds);
- if (!op) {
- return false;
+ SkASSERT(passes[0]);
+ { // First pass
+ std::unique_ptr<GrDrawOp> op =
+ MSAAPathOp::Make(paint.getColor(), path, viewMatrix, devBounds);
+ if (!op) {
+ return false;
+ }
+ bool firstPassIsStencil = stencilOnly || passes[1];
+ // If we have a cover pass then we ignore the paint in the first pass and apply it in the
+ // second.
+ GrPaint::MoveOrNew firstPassPaint(paint, firstPassIsStencil);
+ if (firstPassIsStencil) {
+ firstPassPaint.paint().setXPFactory(GrDisableColorXPFactory::Get());
+ }
+ GrPipelineBuilder pipelineBuilder(std::move(firstPassPaint), aaType);
+ pipelineBuilder.setUserStencil(passes[0]);
+ renderTargetContext->addDrawOp(pipelineBuilder, clip, std::move(op));
}
- // If we have a cover pass then we ignore the paint in the first pass and apply it in the
- // second.
- GrPipelineBuilder pipelineBuilder(GrPaint::MoveOrNew(paint, passes[1]), aaType);
- pipelineBuilder.setUserStencil(passes[0]);
- if (passes[1]) {
- pipelineBuilder.setDisableColorXPFactory();
- }
- renderTargetContext->addDrawOp(pipelineBuilder, clip, std::move(op));
if (passes[1]) {
SkRect bounds;