diff options
author | 2016-07-22 07:10:19 -0700 | |
---|---|---|
committer | 2016-07-22 07:10:20 -0700 | |
commit | bb24383abb724c516e472af4eec68f2c3f17a6d0 (patch) | |
tree | c5c2225167f7a2441a9a8fef1a53c5a93546cde1 /src/gpu | |
parent | 396fcdba14a0101ed43dcc3863585bf50c4ed6cc (diff) |
Revert of Retract PipelineBuilder some more (patchset #9 id:160001 of https://codereview.chromium.org/2092893003/ )
Reason for revert:
skbug.com/5559
Original issue's description:
> 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
>
> Committed: https://skia.googlesource.com/skia/+/2895eeb11a9f0d9c0018d49dd4bc45f6c6fc062c
TBR=robertphillips@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review-Url: https://codereview.chromium.org/2175573004
Diffstat (limited to 'src/gpu')
-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, 107 insertions, 53 deletions
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp index 9a647c0eab..48242e278f 100644 --- a/src/gpu/GrDrawContext.cpp +++ b/src/gpu/GrDrawContext.cpp @@ -299,9 +299,9 @@ static bool should_apply_coverage_aa(const GrPaint& paint, GrRenderTarget* rt, return false; } else { if (useHWAA) { - *useHWAA = rt->isUnifiedMultisampled() || rt->hasMixedSamples(); + *useHWAA = rt->isUnifiedMultisampled(); } - return !rt->isUnifiedMultisampled() && !rt->hasMixedSamples(); + return !rt->isUnifiedMultisampled(); } } @@ -623,8 +623,8 @@ void GrDrawContext::fillRectToRect(const GrClip& clip, batch.reset(ir->recordRect(croppedRect, viewMatrix, paint.getColor(), croppedLocalRect, paint.isAntiAlias(), fInstancedPipelineInfo, &useHWAA)); if (batch) { - SkASSERT(useHWAA == this->mustUseHWAA(paint)); - this->drawBatch(paint, clip, GrUserStencilSettings::kUnused, batch); + GrPipelineBuilder pipelineBuilder(paint, useHWAA); + this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); return; } } @@ -634,13 +634,15 @@ void GrDrawContext::fillRectToRect(const GrClip& clip, batch.reset(GrAAFillRectBatch::CreateWithLocalRect(paint.getColor(), viewMatrix, croppedRect, croppedLocalRect)); if (batch) { - SkASSERT(useHWAA == this->mustUseHWAA(paint)); - this->drawBatch(paint, clip, GrUserStencilSettings::kUnused, batch); + GrPipelineBuilder pipelineBuilder(paint, useHWAA); + this->drawBatch(pipelineBuilder, clip, batch); + return; } } else { this->drawNonAAFilledRect(clip, paint, viewMatrix, croppedRect, &croppedLocalRect, nullptr, nullptr); } + } void GrDrawContext::fillRectWithLocalMatrix(const GrClip& clip, @@ -1240,19 +1242,12 @@ void GrDrawContext::internalDrawPath(const GrClip& clip, pr->drawPath(args); } -void GrDrawContext::drawBatch(const GrPaint& paint, - const GrClip& clip, - const GrUserStencilSettings& userStencilSettings, - GrDrawBatch* batch, - GrDrawFace drawFace) { +void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const GrClip& clip, + GrDrawBatch* batch) { 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 602e84fbbd..66d60ab956 100644 --- a/src/gpu/GrSWMaskHelper.cpp +++ b/src/gpu/GrSWMaskHelper.cpp @@ -11,6 +11,7 @@ #include "GrContext.h" #include "batches/GrDrawBatch.h" #include "GrDrawContext.h" +#include "GrPipelineBuilder.h" #include "GrShape.h" #include "SkDistanceFieldGen.h" @@ -180,17 +181,18 @@ void GrSWMaskHelper::DrawToTargetWithShapeMask(GrTexture* texture, maskMatrix.setIDiv(texture->width(), texture->height()); maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop)); - SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(paint.getColor(), - SkMatrix::I(), - dstRect, nullptr, &invert)); + GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint)); + pipelineBuilder.setUserStencil(&userStencilSettings); - GrPaint newPaint(paint); - newPaint.addCoverageFragmentProcessor( + pipelineBuilder.addCoverageFragmentProcessor( GrSimpleTextureEffect::Make(texture, nullptr, maskMatrix, GrTextureParams::kNone_FilterMode, kDevice_GrCoordSet)); - drawContext->drawBatch(newPaint, clip, userStencilSettings, batch); + SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(paint.getColor(), + SkMatrix::I(), + dstRect, nullptr, &invert)); + drawContext->drawBatch(pipelineBuilder, clip, batch); } diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp index d6e1595ba2..2728811bc9 100644 --- a/src/gpu/GrSoftwarePathRenderer.cpp +++ b/src/gpu/GrSoftwarePathRenderer.cpp @@ -8,6 +8,7 @@ #include "GrSoftwarePathRenderer.h" #include "GrAuditTrail.h" #include "GrClip.h" +#include "GrPipelineBuilder.h" #include "GrSWMaskHelper.h" #include "GrTextureProvider.h" #include "batches/GrRectBatchFactory.h" @@ -72,7 +73,10 @@ void GrSoftwarePathRenderer::DrawNonAARect(GrDrawContext* drawContext, viewMatrix, rect, nullptr, &localMatrix)); - drawContext->drawBatch(paint, clip, userStencilSettings, batch); + GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint)); + pipelineBuilder.setUserStencil(&userStencilSettings); + + drawContext->drawBatch(pipelineBuilder, clip, batch); } void GrSoftwarePathRenderer::DrawAroundInvPath(GrDrawContext* drawContext, @@ -137,6 +141,7 @@ 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 3208eadb47..b0ddaeb65c 100644 --- a/src/gpu/batches/GrAAConvexPathRenderer.cpp +++ b/src/gpu/batches/GrAAConvexPathRenderer.cpp @@ -17,6 +17,7 @@ #include "GrInvariantOutput.h" #include "GrPathUtils.h" #include "GrProcessor.h" +#include "GrPipelineBuilder.h" #include "SkGeometry.h" #include "SkPathPriv.h" #include "SkString.h" @@ -1000,7 +1001,10 @@ bool GrAAConvexPathRenderer::onDrawPath(const DrawPathArgs& args) { SkAutoTUnref<GrDrawBatch> batch(new AAConvexPathBatch(args.fPaint->getColor(), *args.fViewMatrix, path)); - args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, *args.fUserStencilSettings, batch); + GrPipelineBuilder pipelineBuilder(*args.fPaint); + pipelineBuilder.setUserStencil(args.fUserStencilSettings); + + args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); return true; diff --git a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp index d9f456926a..a9ba94da40 100644 --- a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp +++ b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp @@ -11,6 +11,7 @@ #include "GrBatchTest.h" #include "GrBuffer.h" #include "GrContext.h" +#include "GrPipelineBuilder.h" #include "GrResourceProvider.h" #include "GrSurfacePriv.h" #include "GrSWMaskHelper.h" @@ -532,7 +533,10 @@ bool GrAADistanceFieldPathRenderer::onDrawPath(const DrawPathArgs& args) { fAtlas, &fShapeCache, &fShapeList, args.fGammaCorrect)); - args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, *args.fUserStencilSettings, batch); + GrPipelineBuilder pipelineBuilder(*args.fPaint); + pipelineBuilder.setUserStencil(args.fUserStencilSettings); + + args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); return true; } diff --git a/src/gpu/batches/GrAAHairLinePathRenderer.cpp b/src/gpu/batches/GrAAHairLinePathRenderer.cpp index dca4564c84..194c79e41e 100644 --- a/src/gpu/batches/GrAAHairLinePathRenderer.cpp +++ b/src/gpu/batches/GrAAHairLinePathRenderer.cpp @@ -14,6 +14,7 @@ #include "GrContext.h" #include "GrDefaultGeoProcFactory.h" #include "GrPathUtils.h" +#include "GrPipelineBuilder.h" #include "GrProcessor.h" #include "GrResourceProvider.h" #include "SkGeometry.h" @@ -966,7 +967,10 @@ bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) { *args.fViewMatrix, path, args.fShape->style(), devClipBounds)); - args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, *args.fUserStencilSettings, batch); + GrPipelineBuilder pipelineBuilder(*args.fPaint); + pipelineBuilder.setUserStencil(args.fUserStencilSettings); + args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); + return true; } diff --git a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp index 617fb3dd7d..20d93d8e90 100644 --- a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp +++ b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp @@ -16,6 +16,7 @@ #include "GrInvariantOutput.h" #include "GrPathUtils.h" #include "GrProcessor.h" +#include "GrPipelineBuilder.h" #include "GrStyle.h" #include "SkGeometry.h" #include "SkString.h" @@ -337,7 +338,11 @@ bool GrAALinearizingConvexPathRenderer::onDrawPath(const DrawPathArgs& args) { path, strokeWidth, join, miterLimit)); - args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, *args.fUserStencilSettings, batch); + GrPipelineBuilder pipelineBuilder(*args.fPaint); + pipelineBuilder.setUserStencil(args.fUserStencilSettings); + + args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); + return true; } diff --git a/src/gpu/batches/GrDashLinePathRenderer.cpp b/src/gpu/batches/GrDashLinePathRenderer.cpp index b948fbcd94..f2b75be108 100644 --- a/src/gpu/batches/GrDashLinePathRenderer.cpp +++ b/src/gpu/batches/GrDashLinePathRenderer.cpp @@ -9,6 +9,7 @@ #include "GrAuditTrail.h" #include "GrGpu.h" +#include "GrPipelineBuilder.h" #include "effects/GrDashingEffect.h" bool GrDashLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { @@ -25,15 +26,9 @@ 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; @@ -53,7 +48,9 @@ bool GrDashLinePathRenderer::onDrawPath(const DrawPathArgs& args) { return false; } - SkASSERT(args.fDrawContext->mustUseHWAA(*paint) == useHWAA); - args.fDrawContext->drawBatch(*paint, *args.fClip, *args.fUserStencilSettings, batch); + GrPipelineBuilder pipelineBuilder(*args.fPaint, useHWAA); + pipelineBuilder.setUserStencil(args.fUserStencilSettings); + + args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); return true; } diff --git a/src/gpu/batches/GrDefaultPathRenderer.cpp b/src/gpu/batches/GrDefaultPathRenderer.cpp index 552f944cbe..7954716059 100644 --- a/src/gpu/batches/GrDefaultPathRenderer.cpp +++ b/src/gpu/batches/GrDefaultPathRenderer.cpp @@ -13,6 +13,7 @@ #include "GrDefaultGeoProcFactory.h" #include "GrMesh.h" #include "GrPathUtils.h" +#include "GrPipelineBuilder.h" #include "SkGeometry.h" #include "SkString.h" #include "SkStrokeRec.h" @@ -554,19 +555,25 @@ bool GrDefaultPathRenderer::internalDrawPath(GrDrawContext* drawContext, &localMatrix)); SkASSERT(GrDrawFace::kBoth == drawFace[p]); - drawContext->drawBatch(paint, clip, *passes[p], batch, drawFace[p]); + GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint)); + pipelineBuilder.setDrawFace(drawFace[p]); + pipelineBuilder.setUserStencil(passes[p]); + + drawContext->drawBatch(pipelineBuilder, clip, batch); } else { SkAutoTUnref<GrDrawBatch> batch(new DefaultPathBatch(paint.getColor(), path, srcSpaceTol, newCoverage, viewMatrix, isHairline, devBounds)); - SkTCopyOnFirstWrite<GrPaint> newPaint(paint); + GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint)); + pipelineBuilder.setDrawFace(drawFace[p]); + pipelineBuilder.setUserStencil(passes[p]); if (passCount > 1) { - newPaint.writable()->setXPFactory(GrDisableColorXPFactory::Make()); + pipelineBuilder.setDisableColorXPFactory(); } - drawContext->drawBatch(*newPaint, clip, *passes[p], batch, drawFace[p]); + drawContext->drawBatch(pipelineBuilder, clip, batch); } } return true; diff --git a/src/gpu/batches/GrMSAAPathRenderer.cpp b/src/gpu/batches/GrMSAAPathRenderer.cpp index 2372544697..ec54f320de 100644 --- a/src/gpu/batches/GrMSAAPathRenderer.cpp +++ b/src/gpu/batches/GrMSAAPathRenderer.cpp @@ -13,6 +13,7 @@ #include "GrDefaultGeoProcFactory.h" #include "GrPathStencilSettings.h" #include "GrPathUtils.h" +#include "GrPipelineBuilder.h" #include "GrMesh.h" #include "SkGeometry.h" #include "SkTraceEvent.h" @@ -656,7 +657,10 @@ bool GrMSAAPathRenderer::internalDrawPath(GrDrawContext* drawContext, GrRectBatchFactory::CreateNonAAFill(paint.getColor(), viewM, bounds, nullptr, &localMatrix)); - drawContext->drawBatch(paint, clip, *passes[p], batch); + GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint)); + pipelineBuilder.setUserStencil(passes[p]); + + drawContext->drawBatch(pipelineBuilder, clip, batch); } else { SkAutoTUnref<MSAAPathBatch> batch(new MSAAPathBatch(paint.getColor(), path, viewMatrix, devBounds)); @@ -664,12 +668,13 @@ bool GrMSAAPathRenderer::internalDrawPath(GrDrawContext* drawContext, return false; } - SkTCopyOnFirstWrite<GrPaint> newPaint(paint); + GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint)); + pipelineBuilder.setUserStencil(passes[p]); if (passCount > 1) { - newPaint.writable()->setXPFactory(GrDisableColorXPFactory::Make()); + pipelineBuilder.setDisableColorXPFactory(); } - drawContext->drawBatch(*newPaint, clip, *passes[p], batch); + drawContext->drawBatch(pipelineBuilder, clip, batch); } } return true; diff --git a/src/gpu/batches/GrPLSPathRenderer.cpp b/src/gpu/batches/GrPLSPathRenderer.cpp index f446e642e2..ad9bde1cfb 100644 --- a/src/gpu/batches/GrPLSPathRenderer.cpp +++ b/src/gpu/batches/GrPLSPathRenderer.cpp @@ -22,6 +22,7 @@ #include "GrInvariantOutput.h" #include "GrPathUtils.h" #include "GrProcessor.h" +#include "GrPipelineBuilder.h" #include "GrStyle.h" #include "GrTessellator.h" #include "batches/GrVertexBatch.h" @@ -950,7 +951,10 @@ bool GrPLSPathRenderer::onDrawPath(const DrawPathArgs& args) { SkAutoTUnref<GrDrawBatch> batch(new PLSPathBatch(args.fPaint->getColor(), path, *args.fViewMatrix)); - args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, *args.fUserStencilSettings, batch); + GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->mustUseHWAA(*args.fPaint)); + pipelineBuilder.setUserStencil(args.fUserStencilSettings); + + args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); SkDEBUGCODE(inPLSDraw = false;) return true; diff --git a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp index 52c98930b8..02d74fff6e 100644 --- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp +++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp @@ -13,6 +13,7 @@ #include "GrDrawPathBatch.h" #include "GrGpu.h" #include "GrPath.h" +#include "GrPipelineBuilder.h" #include "GrRenderTarget.h" #include "GrResourceProvider.h" #include "GrStencilPathBatch.h" @@ -136,9 +137,14 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) { GrRectBatchFactory::CreateNonAAFill(args.fPaint->getColor(), viewM, bounds, nullptr, &invert)); - SkASSERT(args.fDrawContext->mustUseHWAA(*args.fPaint) == - (args.fPaint->isAntiAlias() && !args.fDrawContext->hasMixedSamples())); - args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, kInvertedCoverPass, coverBatch); + { + GrPipelineBuilder pipelineBuilder(*args.fPaint, + args.fPaint->isAntiAlias() && + !args.fDrawContext->hasMixedSamples()); + pipelineBuilder.setUserStencil(&kInvertedCoverPass); + + args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, coverBatch); + } } else { static constexpr GrUserStencilSettings kCoverPass( GrUserStencilSettings::StaticInit< @@ -153,9 +159,14 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) { SkAutoTUnref<GrDrawBatch> batch( GrDrawPathBatch::Create(viewMatrix, args.fPaint->getColor(), p->getFillType(), p)); - SkASSERT(args.fDrawContext->mustUseHWAA(*args.fPaint) == - (args.fPaint->isAntiAlias() || args.fAntiAlias)); - args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, kCoverPass, batch); + 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); } return true; diff --git a/src/gpu/batches/GrTessellatingPathRenderer.cpp b/src/gpu/batches/GrTessellatingPathRenderer.cpp index 3ef9a5184a..6dce9f73c8 100644 --- a/src/gpu/batches/GrTessellatingPathRenderer.cpp +++ b/src/gpu/batches/GrTessellatingPathRenderer.cpp @@ -14,6 +14,7 @@ #include "GrDefaultGeoProcFactory.h" #include "GrMesh.h" #include "GrPathUtils.h" +#include "GrPipelineBuilder.h" #include "GrResourceCache.h" #include "GrResourceProvider.h" #include "GrTessellator.h" @@ -271,7 +272,10 @@ bool GrTessellatingPathRenderer::onDrawPath(const DrawPathArgs& args) { *args.fShape, *args.fViewMatrix, clipBounds)); - args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, *args.fUserStencilSettings, batch); + GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->mustUseHWAA(*args.fPaint)); + pipelineBuilder.setUserStencil(args.fUserStencilSettings); + + args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); return true; } diff --git a/src/gpu/text/GrAtlasTextBlob.cpp b/src/gpu/text/GrAtlasTextBlob.cpp index 0bea086869..12f35a38c8 100644 --- a/src/gpu/text/GrAtlasTextBlob.cpp +++ b/src/gpu/text/GrAtlasTextBlob.cpp @@ -10,6 +10,7 @@ #include "GrBlurUtils.h" #include "GrContext.h" #include "GrDrawContext.h" +#include "GrPipelineBuilder.h" #include "GrTextUtils.h" #include "SkColorFilter.h" #include "SkDrawFilter.h" @@ -323,7 +324,9 @@ void GrAtlasTextBlob::flushRun(GrDrawContext* dc, const GrPaint& grPaint, distanceAdjustTable, dc->isGammaCorrect(), cache)); - dc->drawBatch(grPaint, clip, GrUserStencilSettings::kUnused, batch); + GrPipelineBuilder pipelineBuilder(grPaint, dc->mustUseHWAA(grPaint)); + + dc->drawBatch(pipelineBuilder, clip, batch); } } diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp index 4d77b0e1a2..ebf735a55e 100644 --- a/src/gpu/text/GrStencilAndCoverTextContext.cpp +++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp @@ -11,6 +11,7 @@ #include "GrDrawContext.h" #include "GrPath.h" #include "GrPathRange.h" +#include "GrPipelineBuilder.h" #include "GrResourceProvider.h" #include "GrTextUtils.h" #include "SkAutoKern.h" @@ -642,8 +643,11 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx, GrPathRendering::kWinding_FillType, glyphs, fInstanceData, bounds)); - SkASSERT(drawContext->mustUseHWAA(grPaint) == grPaint.isAntiAlias()); - drawContext->drawBatch(grPaint, clip, kCoverPass, batch); + GrPipelineBuilder pipelineBuilder(grPaint); + pipelineBuilder.setState(GrPipelineBuilder::kHWAntialias_Flag, grPaint.isAntiAlias()); + pipelineBuilder.setUserStencil(&kCoverPass); + + drawContext->drawBatch(pipelineBuilder, clip, batch); } if (fFallbackTextBlob) { |