diff options
Diffstat (limited to 'src/gpu/GrClipStackClip.cpp')
-rw-r--r-- | src/gpu/GrClipStackClip.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp index e2ce0464f0..1172bc6a7b 100644 --- a/src/gpu/GrClipStackClip.cpp +++ b/src/gpu/GrClipStackClip.cpp @@ -42,7 +42,7 @@ bool GrClipStackClip::quickContains(const SkRRect& rrect) const { SkIntToScalar(fOrigin.fY))); } -bool GrClipStackClip::isRRect(const SkRect& origRTBounds, SkRRect* rr, bool* aa) const { +bool GrClipStackClip::isRRect(const SkRect& origRTBounds, SkRRect* rr, GrAA* aa) const { if (!fStack) { return false; } @@ -54,7 +54,9 @@ bool GrClipStackClip::isRRect(const SkRect& origRTBounds, SkRRect* rr, bool* aa) tempRTBounds.offset(SkIntToScalar(fOrigin.fX), SkIntToScalar(fOrigin.fY)); rtBounds = &tempRTBounds; } - if (fStack->isRRect(*rtBounds, rr, aa)) { + bool isAA; + if (fStack->isRRect(*rtBounds, rr, &isAA)) { + *aa = GrBoolToAA(isAA); if (origin) { rr->offset(-SkIntToScalar(fOrigin.fX), -SkIntToScalar(fOrigin.fY)); } @@ -132,9 +134,16 @@ bool GrClipStackClip::PathNeedsSWRenderer(GrContext* context, canDrawArgs.fShaderCaps = context->caps()->shaderCaps(); canDrawArgs.fViewMatrix = &viewMatrix; canDrawArgs.fShape = &shape; - canDrawArgs.fAntiAlias = element->isAA(); + if (!element->isAA()) { + canDrawArgs.fAAType = GrAAType::kNone; + } else if (renderTargetContext->isUnifiedMultisampled()) { + canDrawArgs.fAAType = GrAAType::kMSAA; + } else if (renderTargetContext->isStencilBufferMultisampled()){ + canDrawArgs.fAAType = GrAAType::kMixedSamples; + } else { + canDrawArgs.fAAType = GrAAType::kCoverage; + } canDrawArgs.fHasUserStencilSettings = hasUserStencilSettings; - canDrawArgs.fIsStencilBufferMSAA = renderTargetContext->isStencilBufferMultisampled(); // the 'false' parameter disallows use of the SW path renderer GrPathRenderer* pr = @@ -450,6 +459,7 @@ sk_sp<GrTexture> GrClipStackClip::CreateSoftwareClipMask(GrTextureProvider* texP for (ElementList::Iter iter(reducedClip.elements()); iter.get(); iter.next()) { const Element* element = iter.get(); SkClipOp op = element->getOp(); + GrAA aa = GrBoolToAA(element->isAA()); if (kIntersect_SkClipOp == op || kReverseDifference_SkClipOp == op) { // Intersect and reverse difference require modifying pixels outside of the geometry @@ -459,25 +469,25 @@ sk_sp<GrTexture> GrClipStackClip::CreateSoftwareClipMask(GrTextureProvider* texP if (kReverseDifference_SkClipOp == op) { SkRect temp = SkRect::Make(reducedClip.ibounds()); // invert the entire scene - helper.drawRect(temp, SkRegion::kXOR_Op, false, 0xFF); + helper.drawRect(temp, SkRegion::kXOR_Op, GrAA::kNo, 0xFF); } SkPath clipPath; element->asPath(&clipPath); clipPath.toggleInverseFillType(); GrShape shape(clipPath, GrStyle::SimpleFill()); - helper.drawShape(shape, SkRegion::kReplace_Op, element->isAA(), 0x00); + helper.drawShape(shape, SkRegion::kReplace_Op, aa, 0x00); continue; } // The other ops (union, xor, diff) only affect pixels inside // the geometry so they can just be drawn normally if (Element::kRect_Type == element->getType()) { - helper.drawRect(element->getRect(), (SkRegion::Op)op, element->isAA(), 0xFF); + helper.drawRect(element->getRect(), (SkRegion::Op)op, aa, 0xFF); } else { SkPath path; element->asPath(&path); GrShape shape(path, GrStyle::SimpleFill()); - helper.drawShape(shape, (SkRegion::Op)op, element->isAA(), 0xFF); + helper.drawShape(shape, (SkRegion::Op)op, aa, 0xFF); } } |