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
diff --git a/include/gpu/GrDrawContext.h b/include/gpu/GrDrawContext.h
index 1a7580e..bf9a2fd 100644
--- a/include/gpu/GrDrawContext.h
+++ b/include/gpu/GrDrawContext.h
@@ -44,6 +44,7 @@
class SkRRect;
struct SkRSXform;
class SkTextBlob;
+struct GrUserStencilSettings;
/*
* A helper object to orchestrate draws
@@ -260,7 +261,8 @@
bool hasMixedSamples() const { return fRenderTarget->hasMixedSamples(); }
bool mustUseHWAA(const GrPaint& paint) const {
- return paint.isAntiAlias() && fRenderTarget->isUnifiedMultisampled();
+ return paint.isAntiAlias() &&
+ (fRenderTarget->isUnifiedMultisampled() || fRenderTarget->hasMixedSamples());
}
const GrSurfaceDesc& desc() const { return fRenderTarget->desc(); }
@@ -345,7 +347,8 @@
// This entry point allows the GrTextContext-derived classes to add their batches to
// the drawTarget.
- void drawBatch(const GrPipelineBuilder& pipelineBuilder, const GrClip&, GrDrawBatch* batch);
+ void drawBatch(const GrPaint&, const GrClip&, const GrUserStencilSettings&, GrDrawBatch* batch,
+ GrDrawFace = GrDrawFace::kBoth);
GrDrawTarget* getDrawTarget();
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index 40d9768..52f7fc0 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -297,9 +297,9 @@
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 @@
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 @@
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 @@
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 66d60ab..602e84f 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 @@
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 2728811..d6e1595 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 @@
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 @@
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 b0ddaeb..3208ead 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 @@
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 a9ba94d..d9f4569 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 @@
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 194c79e..dca4564 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 @@
*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 20d93d8..617fb3d 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 @@
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 f2b75be..b948fbc 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::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 @@
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 7954716..552f944 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 @@
&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 ec54f32..2372544 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 @@
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 @@
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 ad9bde1..f446e64 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 @@
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 02d74ff..52c9893 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 @@
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 @@
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 6dce9f7..3ef9a51 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 @@
*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 12f35a3..0bea086 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 @@
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 ebf735a..4d77b0e 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 @@
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) {