Reland "Remove GrAAType from GrFillRRectOp"
This is a reland of 43e73df990cfb7edf7df9639689dabc44b4fadad
Original change's description:
> Remove GrAAType from GrFillRRectOp
>
> Replaces it with GrAA. This op always uses analytic coverage,
> regardless of MSAA state.
>
> Bug: skia:11396
> Change-Id: I75174a00bdb3b1f62319de5970aac7f1bbae8e10
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/383418
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:11396
Change-Id: I2589a8f81a43f05329b91b6a136bebf723a5dd03
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384298
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/ops/GrFillRRectOp.cpp b/src/gpu/ops/GrFillRRectOp.cpp
index 59da7f1..ac55987 100644
--- a/src/gpu/ops/GrFillRRectOp.cpp
+++ b/src/gpu/ops/GrFillRRectOp.cpp
@@ -35,7 +35,7 @@
GrPaint&&,
const SkMatrix& viewMatrix,
const SkRRect&,
- GrAAType);
+ GrAA);
const char* name() const final { return "GrFillRRectOp"; }
@@ -142,7 +142,7 @@
GrPaint&& paint,
const SkMatrix& viewMatrix,
const SkRRect& rrect,
- GrAAType aaType) {
+ GrAA aa) {
using Helper = GrSimpleMeshDrawOpHelper;
const GrCaps* caps = ctx->priv().caps();
@@ -163,7 +163,7 @@
// coverage mode. We use them as long as the approximation will be accurate enough.
flags |= ProcessorFlags::kUseHWDerivatives;
}
- if (aaType == GrAAType::kNone) {
+ if (aa == GrAA::kNo) {
flags |= ProcessorFlags::kFakeNonAA;
}
@@ -204,7 +204,8 @@
ProcessorFlags::kMSAAEnabled)) {
// FillRRectOp::Make fails if there is perspective.
SkASSERT(!totalShapeMatrix.hasPerspective());
- this->setBounds(devBounds, GrOp::HasAABloat::kYes, GrOp::IsHairline::kNo);
+ this->setBounds(devBounds, GrOp::HasAABloat(!(processorFlags & ProcessorFlags::kFakeNonAA)),
+ GrOp::IsHairline::kNo);
// Write the matrix attribs.
const SkMatrix& m = totalShapeMatrix;
@@ -765,8 +766,8 @@
GrPaint&& paint,
const SkMatrix& viewMatrix,
const SkRRect& rrect,
- GrAAType aaType) {
- return FillRRectOp::Make(ctx, std::move(paint), viewMatrix, rrect, aaType);
+ GrAA aa) {
+ return FillRRectOp::Make(ctx, std::move(paint), viewMatrix, rrect, aa);
}
#if GR_TEST_UTILS
@@ -775,10 +776,7 @@
GR_DRAW_OP_TEST_DEFINE(FillRRectOp) {
SkMatrix viewMatrix = GrTest::TestMatrix(random);
- GrAAType aaType = GrAAType::kNone;
- if (random->nextBool()) {
- aaType = (numSamples > 1) ? GrAAType::kMSAA : GrAAType::kCoverage;
- }
+ GrAA aa = GrAA(random->nextBool());
SkRect rect = GrTest::TestRect(random);
float w = rect.width();
@@ -792,7 +790,7 @@
std::move(paint),
viewMatrix,
rrect,
- aaType);
+ aa);
}
#endif