diff options
author | robertphillips <robertphillips@google.com> | 2016-07-21 12:04:08 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-21 12:04:08 -0700 |
commit | 2895eeb11a9f0d9c0018d49dd4bc45f6c6fc062c (patch) | |
tree | 3509c01c16bd72405503e587553820e379b534c5 /src | |
parent | f25bff95db388554027c78df709f78f8278fffed (diff) |
Retract PipelineBuilder some more
The main part of this CL is widening SkDrawContext::drawBatch's API to accept the userStencilSettings & drawFace
There is some ancillary spookiness related to expanding the should_apply_coverage_aa & mustUseHWAA methods to encompass mixedSamples
Calved off:
https://codereview.chromium.org/2165283002/ (Remove DrawFace enum from GrPipelineBuilder)
https://codereview.chromium.org/2167183002/ (Minor change to Ganesh path renderers)
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2092893003
Review-Url: https://codereview.chromium.org/2092893003
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrDrawContext.cpp | 25 | ||||
-rw-r--r-- | src/gpu/GrSWMaskHelper.cpp | 14 | ||||
-rw-r--r-- | src/gpu/GrSoftwarePathRenderer.cpp | 7 | ||||
-rw-r--r-- | src/gpu/batches/GrAAConvexPathRenderer.cpp | 6 | ||||
-rw-r--r-- | src/gpu/batches/GrAADistanceFieldPathRenderer.cpp | 6 | ||||
-rw-r--r-- | src/gpu/batches/GrAAHairLinePathRenderer.cpp | 6 | ||||
-rw-r--r-- | src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp | 7 | ||||
-rw-r--r-- | src/gpu/batches/GrDashLinePathRenderer.cpp | 13 | ||||
-rw-r--r-- | src/gpu/batches/GrDefaultPathRenderer.cpp | 15 | ||||
-rw-r--r-- | src/gpu/batches/GrMSAAPathRenderer.cpp | 13 | ||||
-rw-r--r-- | src/gpu/batches/GrPLSPathRenderer.cpp | 6 | ||||
-rw-r--r-- | src/gpu/batches/GrStencilAndCoverPathRenderer.cpp | 23 | ||||
-rw-r--r-- | src/gpu/batches/GrTessellatingPathRenderer.cpp | 6 | ||||
-rw-r--r-- | src/gpu/text/GrAtlasTextBlob.cpp | 5 | ||||
-rw-r--r-- | src/gpu/text/GrStencilAndCoverTextContext.cpp | 8 |
15 files changed, 53 insertions, 107 deletions
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp index 40d976869b..52f7fc0a35 100644 --- a/src/gpu/GrDrawContext.cpp +++ b/src/gpu/GrDrawContext.cpp @@ -297,9 +297,9 @@ static bool should_apply_coverage_aa(const GrPaint& paint, GrRenderTarget* rt, return false; } else { if (useHWAA) { - *useHWAA = rt->isUnifiedMultisampled(); + *useHWAA = rt->isUnifiedMultisampled() || rt->hasMixedSamples(); } - return !rt->isUnifiedMultisampled(); + return !rt->isUnifiedMultisampled() && !rt->hasMixedSamples(); } } @@ -621,8 +621,8 @@ void GrDrawContext::fillRectToRect(const GrClip& clip, batch.reset(ir->recordRect(croppedRect, viewMatrix, paint.getColor(), croppedLocalRect, paint.isAntiAlias(), fInstancedPipelineInfo, &useHWAA)); if (batch) { - GrPipelineBuilder pipelineBuilder(paint, useHWAA); - this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); + SkASSERT(useHWAA == this->mustUseHWAA(paint)); + this->drawBatch(paint, clip, GrUserStencilSettings::kUnused, batch); return; } } @@ -632,15 +632,13 @@ void GrDrawContext::fillRectToRect(const GrClip& clip, batch.reset(GrAAFillRectBatch::CreateWithLocalRect(paint.getColor(), viewMatrix, croppedRect, croppedLocalRect)); if (batch) { - GrPipelineBuilder pipelineBuilder(paint, useHWAA); - this->drawBatch(pipelineBuilder, clip, batch); - return; + SkASSERT(useHWAA == this->mustUseHWAA(paint)); + this->drawBatch(paint, clip, GrUserStencilSettings::kUnused, batch); } } else { this->drawNonAAFilledRect(clip, paint, viewMatrix, croppedRect, &croppedLocalRect, nullptr, nullptr); } - } void GrDrawContext::fillRectWithLocalMatrix(const GrClip& clip, @@ -1240,12 +1238,19 @@ void GrDrawContext::internalDrawPath(const GrClip& clip, pr->drawPath(args); } -void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const GrClip& clip, - GrDrawBatch* batch) { +void GrDrawContext::drawBatch(const GrPaint& paint, + const GrClip& clip, + const GrUserStencilSettings& userStencilSettings, + GrDrawBatch* batch, + GrDrawFace drawFace) { ASSERT_SINGLE_OWNER RETURN_IF_ABANDONED SkDEBUGCODE(this->validate();) GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); + GrPipelineBuilder pipelineBuilder(paint, this->mustUseHWAA(paint)); + pipelineBuilder.setUserStencil(&userStencilSettings); + pipelineBuilder.setDrawFace(drawFace); + this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); } diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp index 66d60ab956..602e84fbbd 100644 --- a/src/gpu/GrSWMaskHelper.cpp +++ b/src/gpu/GrSWMaskHelper.cpp @@ -11,7 +11,6 @@ #include "GrContext.h" #include "batches/GrDrawBatch.h" #include "GrDrawContext.h" -#include "GrPipelineBuilder.h" #include "GrShape.h" #include "SkDistanceFieldGen.h" @@ -181,18 +180,17 @@ void GrSWMaskHelper::DrawToTargetWithShapeMask(GrTexture* texture, maskMatrix.setIDiv(texture->width(), texture->height()); maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop)); - GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint)); - pipelineBuilder.setUserStencil(&userStencilSettings); + SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(paint.getColor(), + SkMatrix::I(), + dstRect, nullptr, &invert)); - pipelineBuilder.addCoverageFragmentProcessor( + GrPaint newPaint(paint); + newPaint.addCoverageFragmentProcessor( GrSimpleTextureEffect::Make(texture, nullptr, maskMatrix, GrTextureParams::kNone_FilterMode, kDevice_GrCoordSet)); - SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(paint.getColor(), - SkMatrix::I(), - dstRect, nullptr, &invert)); - drawContext->drawBatch(pipelineBuilder, clip, batch); + drawContext->drawBatch(newPaint, clip, userStencilSettings, batch); } diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp index 2728811bc9..d6e1595ba2 100644 --- a/src/gpu/GrSoftwarePathRenderer.cpp +++ b/src/gpu/GrSoftwarePathRenderer.cpp @@ -8,7 +8,6 @@ #include "GrSoftwarePathRenderer.h" #include "GrAuditTrail.h" #include "GrClip.h" -#include "GrPipelineBuilder.h" #include "GrSWMaskHelper.h" #include "GrTextureProvider.h" #include "batches/GrRectBatchFactory.h" @@ -73,10 +72,7 @@ void GrSoftwarePathRenderer::DrawNonAARect(GrDrawContext* drawContext, viewMatrix, rect, nullptr, &localMatrix)); - GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint)); - pipelineBuilder.setUserStencil(&userStencilSettings); - - drawContext->drawBatch(pipelineBuilder, clip, batch); + drawContext->drawBatch(paint, clip, userStencilSettings, batch); } void GrSoftwarePathRenderer::DrawAroundInvPath(GrDrawContext* drawContext, @@ -141,7 +137,6 @@ bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) { DrawAroundInvPath(args.fDrawContext, *args.fPaint, *args.fUserStencilSettings, *args.fClip, *args.fViewMatrix, devClipBounds, devShapeBounds); - } return true; } diff --git a/src/gpu/batches/GrAAConvexPathRenderer.cpp b/src/gpu/batches/GrAAConvexPathRenderer.cpp index b0ddaeb65c..3208eadb47 100644 --- a/src/gpu/batches/GrAAConvexPathRenderer.cpp +++ b/src/gpu/batches/GrAAConvexPathRenderer.cpp @@ -17,7 +17,6 @@ #include "GrInvariantOutput.h" #include "GrPathUtils.h" #include "GrProcessor.h" -#include "GrPipelineBuilder.h" #include "SkGeometry.h" #include "SkPathPriv.h" #include "SkString.h" @@ -1001,10 +1000,7 @@ bool GrAAConvexPathRenderer::onDrawPath(const DrawPathArgs& args) { SkAutoTUnref<GrDrawBatch> batch(new AAConvexPathBatch(args.fPaint->getColor(), *args.fViewMatrix, path)); - GrPipelineBuilder pipelineBuilder(*args.fPaint); - pipelineBuilder.setUserStencil(args.fUserStencilSettings); - - args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); + args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, *args.fUserStencilSettings, batch); return true; diff --git a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp index a9ba94da40..d9f456926a 100644 --- a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp +++ b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp @@ -11,7 +11,6 @@ #include "GrBatchTest.h" #include "GrBuffer.h" #include "GrContext.h" -#include "GrPipelineBuilder.h" #include "GrResourceProvider.h" #include "GrSurfacePriv.h" #include "GrSWMaskHelper.h" @@ -533,10 +532,7 @@ bool GrAADistanceFieldPathRenderer::onDrawPath(const DrawPathArgs& args) { fAtlas, &fShapeCache, &fShapeList, args.fGammaCorrect)); - GrPipelineBuilder pipelineBuilder(*args.fPaint); - pipelineBuilder.setUserStencil(args.fUserStencilSettings); - - args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); + args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, *args.fUserStencilSettings, batch); return true; } diff --git a/src/gpu/batches/GrAAHairLinePathRenderer.cpp b/src/gpu/batches/GrAAHairLinePathRenderer.cpp index 194c79e41e..dca4564c84 100644 --- a/src/gpu/batches/GrAAHairLinePathRenderer.cpp +++ b/src/gpu/batches/GrAAHairLinePathRenderer.cpp @@ -14,7 +14,6 @@ #include "GrContext.h" #include "GrDefaultGeoProcFactory.h" #include "GrPathUtils.h" -#include "GrPipelineBuilder.h" #include "GrProcessor.h" #include "GrResourceProvider.h" #include "SkGeometry.h" @@ -967,10 +966,7 @@ bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) { *args.fViewMatrix, path, args.fShape->style(), devClipBounds)); - GrPipelineBuilder pipelineBuilder(*args.fPaint); - pipelineBuilder.setUserStencil(args.fUserStencilSettings); - args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); - + args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, *args.fUserStencilSettings, batch); return true; } diff --git a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp index 20d93d8e90..617fb3dd7d 100644 --- a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp +++ b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp @@ -16,7 +16,6 @@ #include "GrInvariantOutput.h" #include "GrPathUtils.h" #include "GrProcessor.h" -#include "GrPipelineBuilder.h" #include "GrStyle.h" #include "SkGeometry.h" #include "SkString.h" @@ -338,11 +337,7 @@ bool GrAALinearizingConvexPathRenderer::onDrawPath(const DrawPathArgs& args) { path, strokeWidth, join, miterLimit)); - GrPipelineBuilder pipelineBuilder(*args.fPaint); - pipelineBuilder.setUserStencil(args.fUserStencilSettings); - - args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); - + args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, *args.fUserStencilSettings, batch); return true; } diff --git a/src/gpu/batches/GrDashLinePathRenderer.cpp b/src/gpu/batches/GrDashLinePathRenderer.cpp index f2b75be108..b948fbcd94 100644 --- a/src/gpu/batches/GrDashLinePathRenderer.cpp +++ b/src/gpu/batches/GrDashLinePathRenderer.cpp @@ -9,7 +9,6 @@ #include "GrAuditTrail.h" #include "GrGpu.h" -#include "GrPipelineBuilder.h" #include "effects/GrDashingEffect.h" bool GrDashLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { @@ -26,9 +25,15 @@ bool GrDashLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { bool GrDashLinePathRenderer::onDrawPath(const DrawPathArgs& args) { GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(), "GrDashLinePathRenderer::onDrawPath"); + + SkTCopyOnFirstWrite<GrPaint> paint(*args.fPaint); + bool useHWAA = args.fDrawContext->isUnifiedMultisampled(); GrDashingEffect::AAMode aaMode; if (useHWAA) { + if (!paint->isAntiAlias()) { + paint.writable()->setAntiAlias(true); + } // We ignore args.fAntiAlias here and force anti aliasing when using MSAA. Otherwise, // we can wind up with external edges antialiased and internal edges unantialiased. aaMode = GrDashingEffect::AAMode::kCoverageWithMSAA; @@ -48,9 +53,7 @@ bool GrDashLinePathRenderer::onDrawPath(const DrawPathArgs& args) { return false; } - GrPipelineBuilder pipelineBuilder(*args.fPaint, useHWAA); - pipelineBuilder.setUserStencil(args.fUserStencilSettings); - - args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); + SkASSERT(args.fDrawContext->mustUseHWAA(*paint) == useHWAA); + args.fDrawContext->drawBatch(*paint, *args.fClip, *args.fUserStencilSettings, batch); return true; } diff --git a/src/gpu/batches/GrDefaultPathRenderer.cpp b/src/gpu/batches/GrDefaultPathRenderer.cpp index 7954716059..552f944cbe 100644 --- a/src/gpu/batches/GrDefaultPathRenderer.cpp +++ b/src/gpu/batches/GrDefaultPathRenderer.cpp @@ -13,7 +13,6 @@ #include "GrDefaultGeoProcFactory.h" #include "GrMesh.h" #include "GrPathUtils.h" -#include "GrPipelineBuilder.h" #include "SkGeometry.h" #include "SkString.h" #include "SkStrokeRec.h" @@ -555,25 +554,19 @@ bool GrDefaultPathRenderer::internalDrawPath(GrDrawContext* drawContext, &localMatrix)); SkASSERT(GrDrawFace::kBoth == drawFace[p]); - GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint)); - pipelineBuilder.setDrawFace(drawFace[p]); - pipelineBuilder.setUserStencil(passes[p]); - - drawContext->drawBatch(pipelineBuilder, clip, batch); + drawContext->drawBatch(paint, clip, *passes[p], batch, drawFace[p]); } else { SkAutoTUnref<GrDrawBatch> batch(new DefaultPathBatch(paint.getColor(), path, srcSpaceTol, newCoverage, viewMatrix, isHairline, devBounds)); - GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint)); - pipelineBuilder.setDrawFace(drawFace[p]); - pipelineBuilder.setUserStencil(passes[p]); + SkTCopyOnFirstWrite<GrPaint> newPaint(paint); if (passCount > 1) { - pipelineBuilder.setDisableColorXPFactory(); + newPaint.writable()->setXPFactory(GrDisableColorXPFactory::Make()); } - drawContext->drawBatch(pipelineBuilder, clip, batch); + drawContext->drawBatch(*newPaint, clip, *passes[p], batch, drawFace[p]); } } return true; diff --git a/src/gpu/batches/GrMSAAPathRenderer.cpp b/src/gpu/batches/GrMSAAPathRenderer.cpp index ec54f320de..2372544697 100644 --- a/src/gpu/batches/GrMSAAPathRenderer.cpp +++ b/src/gpu/batches/GrMSAAPathRenderer.cpp @@ -13,7 +13,6 @@ #include "GrDefaultGeoProcFactory.h" #include "GrPathStencilSettings.h" #include "GrPathUtils.h" -#include "GrPipelineBuilder.h" #include "GrMesh.h" #include "SkGeometry.h" #include "SkTraceEvent.h" @@ -657,10 +656,7 @@ bool GrMSAAPathRenderer::internalDrawPath(GrDrawContext* drawContext, GrRectBatchFactory::CreateNonAAFill(paint.getColor(), viewM, bounds, nullptr, &localMatrix)); - GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint)); - pipelineBuilder.setUserStencil(passes[p]); - - drawContext->drawBatch(pipelineBuilder, clip, batch); + drawContext->drawBatch(paint, clip, *passes[p], batch); } else { SkAutoTUnref<MSAAPathBatch> batch(new MSAAPathBatch(paint.getColor(), path, viewMatrix, devBounds)); @@ -668,13 +664,12 @@ bool GrMSAAPathRenderer::internalDrawPath(GrDrawContext* drawContext, return false; } - GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint)); - pipelineBuilder.setUserStencil(passes[p]); + SkTCopyOnFirstWrite<GrPaint> newPaint(paint); if (passCount > 1) { - pipelineBuilder.setDisableColorXPFactory(); + newPaint.writable()->setXPFactory(GrDisableColorXPFactory::Make()); } - drawContext->drawBatch(pipelineBuilder, clip, batch); + drawContext->drawBatch(*newPaint, clip, *passes[p], batch); } } return true; diff --git a/src/gpu/batches/GrPLSPathRenderer.cpp b/src/gpu/batches/GrPLSPathRenderer.cpp index ad9bde1cfb..f446e642e2 100644 --- a/src/gpu/batches/GrPLSPathRenderer.cpp +++ b/src/gpu/batches/GrPLSPathRenderer.cpp @@ -22,7 +22,6 @@ #include "GrInvariantOutput.h" #include "GrPathUtils.h" #include "GrProcessor.h" -#include "GrPipelineBuilder.h" #include "GrStyle.h" #include "GrTessellator.h" #include "batches/GrVertexBatch.h" @@ -951,10 +950,7 @@ bool GrPLSPathRenderer::onDrawPath(const DrawPathArgs& args) { SkAutoTUnref<GrDrawBatch> batch(new PLSPathBatch(args.fPaint->getColor(), path, *args.fViewMatrix)); - GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->mustUseHWAA(*args.fPaint)); - pipelineBuilder.setUserStencil(args.fUserStencilSettings); - - args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); + args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, *args.fUserStencilSettings, batch); SkDEBUGCODE(inPLSDraw = false;) return true; diff --git a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp index 02d74fff6e..52c98930b8 100644 --- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp +++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp @@ -13,7 +13,6 @@ #include "GrDrawPathBatch.h" #include "GrGpu.h" #include "GrPath.h" -#include "GrPipelineBuilder.h" #include "GrRenderTarget.h" #include "GrResourceProvider.h" #include "GrStencilPathBatch.h" @@ -137,14 +136,9 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) { GrRectBatchFactory::CreateNonAAFill(args.fPaint->getColor(), viewM, bounds, nullptr, &invert)); - { - GrPipelineBuilder pipelineBuilder(*args.fPaint, - args.fPaint->isAntiAlias() && - !args.fDrawContext->hasMixedSamples()); - pipelineBuilder.setUserStencil(&kInvertedCoverPass); - - args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, coverBatch); - } + SkASSERT(args.fDrawContext->mustUseHWAA(*args.fPaint) == + (args.fPaint->isAntiAlias() && !args.fDrawContext->hasMixedSamples())); + args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, kInvertedCoverPass, coverBatch); } else { static constexpr GrUserStencilSettings kCoverPass( GrUserStencilSettings::StaticInit< @@ -159,14 +153,9 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) { SkAutoTUnref<GrDrawBatch> batch( GrDrawPathBatch::Create(viewMatrix, args.fPaint->getColor(), p->getFillType(), p)); - GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fPaint->isAntiAlias()); - pipelineBuilder.setUserStencil(&kCoverPass); - if (args.fAntiAlias) { - SkASSERT(args.fDrawContext->isStencilBufferMultisampled()); - pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag); - } - - args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); + SkASSERT(args.fDrawContext->mustUseHWAA(*args.fPaint) == + (args.fPaint->isAntiAlias() || args.fAntiAlias)); + args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, kCoverPass, batch); } return true; diff --git a/src/gpu/batches/GrTessellatingPathRenderer.cpp b/src/gpu/batches/GrTessellatingPathRenderer.cpp index 6dce9f73c8..3ef9a5184a 100644 --- a/src/gpu/batches/GrTessellatingPathRenderer.cpp +++ b/src/gpu/batches/GrTessellatingPathRenderer.cpp @@ -14,7 +14,6 @@ #include "GrDefaultGeoProcFactory.h" #include "GrMesh.h" #include "GrPathUtils.h" -#include "GrPipelineBuilder.h" #include "GrResourceCache.h" #include "GrResourceProvider.h" #include "GrTessellator.h" @@ -272,10 +271,7 @@ bool GrTessellatingPathRenderer::onDrawPath(const DrawPathArgs& args) { *args.fShape, *args.fViewMatrix, clipBounds)); - GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->mustUseHWAA(*args.fPaint)); - pipelineBuilder.setUserStencil(args.fUserStencilSettings); - - args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); + args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, *args.fUserStencilSettings, batch); return true; } diff --git a/src/gpu/text/GrAtlasTextBlob.cpp b/src/gpu/text/GrAtlasTextBlob.cpp index 12f35a38c8..0bea086869 100644 --- a/src/gpu/text/GrAtlasTextBlob.cpp +++ b/src/gpu/text/GrAtlasTextBlob.cpp @@ -10,7 +10,6 @@ #include "GrBlurUtils.h" #include "GrContext.h" #include "GrDrawContext.h" -#include "GrPipelineBuilder.h" #include "GrTextUtils.h" #include "SkColorFilter.h" #include "SkDrawFilter.h" @@ -324,9 +323,7 @@ void GrAtlasTextBlob::flushRun(GrDrawContext* dc, const GrPaint& grPaint, distanceAdjustTable, dc->isGammaCorrect(), cache)); - GrPipelineBuilder pipelineBuilder(grPaint, dc->mustUseHWAA(grPaint)); - - dc->drawBatch(pipelineBuilder, clip, batch); + dc->drawBatch(grPaint, clip, GrUserStencilSettings::kUnused, batch); } } diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp index ebf735a55e..4d77b0e1a2 100644 --- a/src/gpu/text/GrStencilAndCoverTextContext.cpp +++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp @@ -11,7 +11,6 @@ #include "GrDrawContext.h" #include "GrPath.h" #include "GrPathRange.h" -#include "GrPipelineBuilder.h" #include "GrResourceProvider.h" #include "GrTextUtils.h" #include "SkAutoKern.h" @@ -643,11 +642,8 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx, GrPathRendering::kWinding_FillType, glyphs, fInstanceData, bounds)); - GrPipelineBuilder pipelineBuilder(grPaint); - pipelineBuilder.setState(GrPipelineBuilder::kHWAntialias_Flag, grPaint.isAntiAlias()); - pipelineBuilder.setUserStencil(&kCoverPass); - - drawContext->drawBatch(pipelineBuilder, clip, batch); + SkASSERT(drawContext->mustUseHWAA(grPaint) == grPaint.isAntiAlias()); + drawContext->drawBatch(grPaint, clip, kCoverPass, batch); } if (fFallbackTextBlob) { |