aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrSoftwarePathRenderer.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-12-08 16:57:38 +0000
committerGravatar Brian Salomon <bsalomon@google.com>2016-12-08 17:11:46 +0000
commit419d81eed4a010e6080db199795117cbedf9e6e4 (patch)
tree7e11b85514db3fe6c7c7f43f8c07d2839eda7bed /src/gpu/GrSoftwarePathRenderer.cpp
parenta92c383e2f1ceb0323aef79fa444450e6a3e1c03 (diff)
Revert "Remove antialiasing control from GrPaint."
This reverts commit 9f549358b3ac9f61e78b194e39d6ac6eb322e35e. Reason for revert: hitting asserts Change-Id: I542d34edc05ecf72b7646263f25736a0950c78e7 Reviewed-on: https://skia-review.googlesource.com/5707 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrSoftwarePathRenderer.cpp')
-rw-r--r--src/gpu/GrSoftwarePathRenderer.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index a5f18d63ff..8b941ebaff 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -71,8 +71,9 @@ void GrSoftwarePathRenderer::DrawNonAARect(GrRenderTargetContext* renderTargetCo
viewMatrix, rect,
nullptr, &localMatrix));
- GrPipelineBuilder pipelineBuilder(paint, GrAAType::kNone);
+ GrPipelineBuilder pipelineBuilder(paint, renderTargetContext->mustUseHWAA(paint));
pipelineBuilder.setUserStencil(&userStencilSettings);
+
renderTargetContext->addDrawOp(pipelineBuilder, clip, batch.get());
}
@@ -134,7 +135,7 @@ bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) {
// To prevent overloading the cache with entries during animations we limit the cache of masks
// to cases where the matrix preserves axis alignment.
bool useCache = fAllowCaching && !inverseFilled && args.fViewMatrix->preservesAxisAlignment() &&
- args.fShape->hasUnstyledKey() && GrAAType::kCoverage == args.fAAType;
+ args.fShape->hasUnstyledKey() && args.fAntiAlias;
if (!get_shape_and_clip_bounds(args.fRenderTargetContext->width(),
args.fRenderTargetContext->height(),
@@ -192,8 +193,6 @@ bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) {
builder[3] = SkFloat2Bits(ky);
builder[4] = fracX | (fracY >> 8);
args.fShape->writeUnstyledKey(&builder[5]);
- // FIXME: Doesn't the key need to consider whether we're using AA or not? In practice that
- // should always be true, though.
}
sk_sp<GrTexture> texture;
@@ -201,24 +200,25 @@ bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) {
texture.reset(args.fResourceProvider->findAndRefTextureByUniqueKey(maskKey));
}
if (!texture) {
- GrSWMaskHelper::TextureType type = useCache ? GrSWMaskHelper::TextureType::kExactFit
- : GrSWMaskHelper::TextureType::kApproximateFit;
- GrAA aa = GrAAType::kCoverage == args.fAAType ? GrAA::kYes : GrAA::kNo;
- texture.reset(GrSWMaskHelper::DrawShapeMaskToTexture(fTexProvider, *args.fShape,
- *boundsForMask, aa,
- type, args.fViewMatrix));
- if (!texture) {
- return false;
- }
- if (useCache) {
- texture->resourcePriv().setUniqueKey(maskKey);
- }
+ GrSWMaskHelper::TextureType type = useCache ? GrSWMaskHelper::TextureType::kExactFit
+ : GrSWMaskHelper::TextureType::kApproximateFit;
+ texture.reset(GrSWMaskHelper::DrawShapeMaskToTexture(fTexProvider, *args.fShape,
+ *boundsForMask, args.fAntiAlias,
+ type, args.fViewMatrix));
+ if (!texture) {
+ return false;
+ }
+ if (useCache) {
+ texture->resourcePriv().setUniqueKey(maskKey);
+ }
}
+
GrSWMaskHelper::DrawToTargetWithShapeMask(texture.get(), args.fRenderTargetContext,
*args.fPaint, *args.fUserStencilSettings,
*args.fClip, *args.fViewMatrix,
SkIPoint {boundsForMask->fLeft, boundsForMask->fTop},
*boundsForMask);
+
if (inverseFilled) {
DrawAroundInvPath(args.fRenderTargetContext, *args.fPaint, *args.fUserStencilSettings,
*args.fClip,