Revert "Remove GrAAType from GrFillRRectOp"
This reverts commit 43e73df990cfb7edf7df9639689dabc44b4fadad.
Reason for revert: Changed msaa behavior for non-aa
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>
TBR=robertphillips@google.com,csmartdalton@google.com
Change-Id: I780e46b58a2af1512d17e9db0b53d205f6df51d4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11396
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/383857
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/ops/GrFillRRectOp.cpp b/src/gpu/ops/GrFillRRectOp.cpp
index ac55987..59da7f1 100644
--- a/src/gpu/ops/GrFillRRectOp.cpp
+++ b/src/gpu/ops/GrFillRRectOp.cpp
@@ -35,7 +35,7 @@
GrPaint&&,
const SkMatrix& viewMatrix,
const SkRRect&,
- GrAA);
+ GrAAType);
const char* name() const final { return "GrFillRRectOp"; }
@@ -142,7 +142,7 @@
GrPaint&& paint,
const SkMatrix& viewMatrix,
const SkRRect& rrect,
- GrAA aa) {
+ GrAAType aaType) {
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 (aa == GrAA::kNo) {
+ if (aaType == GrAAType::kNone) {
flags |= ProcessorFlags::kFakeNonAA;
}
@@ -204,8 +204,7 @@
ProcessorFlags::kMSAAEnabled)) {
// FillRRectOp::Make fails if there is perspective.
SkASSERT(!totalShapeMatrix.hasPerspective());
- this->setBounds(devBounds, GrOp::HasAABloat(!(processorFlags & ProcessorFlags::kFakeNonAA)),
- GrOp::IsHairline::kNo);
+ this->setBounds(devBounds, GrOp::HasAABloat::kYes, GrOp::IsHairline::kNo);
// Write the matrix attribs.
const SkMatrix& m = totalShapeMatrix;
@@ -766,8 +765,8 @@
GrPaint&& paint,
const SkMatrix& viewMatrix,
const SkRRect& rrect,
- GrAA aa) {
- return FillRRectOp::Make(ctx, std::move(paint), viewMatrix, rrect, aa);
+ GrAAType aaType) {
+ return FillRRectOp::Make(ctx, std::move(paint), viewMatrix, rrect, aaType);
}
#if GR_TEST_UTILS
@@ -776,7 +775,10 @@
GR_DRAW_OP_TEST_DEFINE(FillRRectOp) {
SkMatrix viewMatrix = GrTest::TestMatrix(random);
- GrAA aa = GrAA(random->nextBool());
+ GrAAType aaType = GrAAType::kNone;
+ if (random->nextBool()) {
+ aaType = (numSamples > 1) ? GrAAType::kMSAA : GrAAType::kCoverage;
+ }
SkRect rect = GrTest::TestRect(random);
float w = rect.width();
@@ -790,7 +792,7 @@
std::move(paint),
viewMatrix,
rrect,
- aa);
+ aaType);
}
#endif