aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/batches/GrDefaultPathRenderer.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-12-09 20:02:08 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-09 20:02:22 +0000
commit073285c0595d46205d1482cc19af2d7d891bfeae (patch)
treef127dd2c03ef707cd47396be0bf1cbf911403849 /src/gpu/batches/GrDefaultPathRenderer.cpp
parent3944484020d98ff8f386378296106c321279482b (diff)
Revert "Reland "Remove antialiasing control from GrPaint.""
This reverts commit 3944484020d98ff8f386378296106c321279482b. Reason for revert: Merges badly with a recent change. Will rebase and reland. Original change's description: > Reland "Remove antialiasing control from GrPaint." > > This contains fixes for GLPrograms test and mixed samples rendering. > > This reverts commit 419d81eed4a010e6080db199795117cbedf9e6e4. > > BUG=skia: > > Change-Id: If8f002fbfaaaab6d1607403f2b15ccc7f1e17e87 > Reviewed-on: https://skia-review.googlesource.com/5763 > Commit-Queue: Brian Salomon <bsalomon@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org BUG=skia: NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Iff9657041e28604a845bc5a9acec7c9b248c53bd Reviewed-on: https://skia-review.googlesource.com/5772 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/batches/GrDefaultPathRenderer.cpp')
-rw-r--r--src/gpu/batches/GrDefaultPathRenderer.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gpu/batches/GrDefaultPathRenderer.cpp b/src/gpu/batches/GrDefaultPathRenderer.cpp
index 0b688c5305..f3f9e73155 100644
--- a/src/gpu/batches/GrDefaultPathRenderer.cpp
+++ b/src/gpu/batches/GrDefaultPathRenderer.cpp
@@ -424,13 +424,11 @@ private:
bool GrDefaultPathRenderer::internalDrawPath(GrRenderTargetContext* renderTargetContext,
const GrPaint& paint,
- GrAAType aaType,
const GrUserStencilSettings& userStencilSettings,
const GrClip& clip,
const SkMatrix& viewMatrix,
const GrShape& shape,
bool stencilOnly) {
- SkASSERT(GrAAType::kCoverage != aaType);
SkPath path;
shape.asPath(&path);
@@ -569,20 +567,23 @@ bool GrDefaultPathRenderer::internalDrawPath(GrRenderTargetContext* renderTarget
&localMatrix));
SkASSERT(GrDrawFace::kBoth == drawFace[p]);
- GrPipelineBuilder pipelineBuilder(paint, aaType);
+ GrPipelineBuilder pipelineBuilder(paint, renderTargetContext->mustUseHWAA(paint));
pipelineBuilder.setDrawFace(drawFace[p]);
pipelineBuilder.setUserStencil(passes[p]);
+
renderTargetContext->addDrawOp(pipelineBuilder, clip, batch.get());
} else {
sk_sp<GrDrawOp> batch(new DefaultPathBatch(paint.getColor(), path, srcSpaceTol,
newCoverage, viewMatrix, isHairline,
devBounds));
- GrPipelineBuilder pipelineBuilder(paint, aaType);
+
+ GrPipelineBuilder pipelineBuilder(paint, renderTargetContext->mustUseHWAA(paint));
pipelineBuilder.setDrawFace(drawFace[p]);
pipelineBuilder.setUserStencil(passes[p]);
if (passCount > 1) {
pipelineBuilder.setDisableColorXPFactory();
}
+
renderTargetContext->addDrawOp(pipelineBuilder, clip, batch.get());
}
}
@@ -590,8 +591,8 @@ bool GrDefaultPathRenderer::internalDrawPath(GrRenderTargetContext* renderTarget
}
bool GrDefaultPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
- // This can draw any path with any simple fill style but doesn't do coverage-based antialiasing.
- return GrAAType::kCoverage != args.fAAType &&
+ // this class can draw any path with any simple fill style but doesn't do any anti-aliasing.
+ return !args.fAntiAlias &&
(args.fShape->style().isSimpleFill() ||
IsStrokeHairlineOrEquivalent(args.fShape->style(), *args.fViewMatrix, nullptr));
}
@@ -601,7 +602,6 @@ bool GrDefaultPathRenderer::onDrawPath(const DrawPathArgs& args) {
"GrDefaultPathRenderer::onDrawPath");
return this->internalDrawPath(args.fRenderTargetContext,
*args.fPaint,
- args.fAAType,
*args.fUserStencilSettings,
*args.fClip,
*args.fViewMatrix,
@@ -616,10 +616,10 @@ void GrDefaultPathRenderer::onStencilPath(const StencilPathArgs& args) {
GrPaint paint;
paint.setXPFactory(GrDisableColorXPFactory::Make());
+ paint.setAntiAlias(args.fIsAA);
- this->internalDrawPath(args.fRenderTargetContext, paint, args.fAAType,
- GrUserStencilSettings::kUnused, *args.fClip, *args.fViewMatrix,
- *args.fShape, true);
+ this->internalDrawPath(args.fRenderTargetContext, paint, GrUserStencilSettings::kUnused,
+ *args.fClip, *args.fViewMatrix, *args.fShape, true);
}
///////////////////////////////////////////////////////////////////////////////////////////////////