Revert "converted AARectEffect to new FP system"
This reverts commit 222e275b0ab4c8a2af152c637bf9dbc28b4a097f.
Reason for revert: perf regression
Original change's description:
> converted AARectEffect to new FP system
>
> Bug: skia:
> Change-Id: I0e4141c7f547bab92c65a6abff120ed04d5c2c66
> Reviewed-on: https://skia-review.googlesource.com/c/153550
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
TBR=bsalomon@google.com,ethannicholas@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:
Change-Id: I3d7036a78d8582d6790c77b20a60e6e5257d1881
Reviewed-on: https://skia-review.googlesource.com/c/162283
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/tests/ClipStackTest.cpp b/tests/ClipStackTest.cpp
index 0f1966b..2cfeaae 100644
--- a/tests/ClipStackTest.cpp
+++ b/tests/ClipStackTest.cpp
@@ -1041,6 +1041,7 @@
}
auto context = GrContext::MakeMock(nullptr);
+ const GrCaps* caps = context->contextPriv().caps();
// Zero the memory we will new the GrReducedClip into. This ensures the elements gen ID
// will be kInvalidGenID if left uninitialized.
@@ -1051,8 +1052,7 @@
// Get the reduced version of the stack.
SkRect queryBounds = kBounds;
queryBounds.outset(kBounds.width() / 2, kBounds.height() / 2);
- const GrReducedClip* reduced = new (storage.get()) GrReducedClip(stack, queryBounds,
- context.get());
+ const GrReducedClip* reduced = new (storage.get()) GrReducedClip(stack, queryBounds, caps);
REPORTER_ASSERT(reporter,
reduced->maskElements().isEmpty() ||
@@ -1112,12 +1112,12 @@
SkRect bounds = SkRect::MakeXYWH(0, 0, 100, 100);
auto context = GrContext::MakeMock(nullptr);
+ const GrCaps* caps = context->contextPriv().caps();
SkAlignedSTStorage<1, GrReducedClip> storage;
memset(storage.get(), 0, sizeof(GrReducedClip));
GR_STATIC_ASSERT(0 == SkClipStack::kInvalidGenID);
- const GrReducedClip* reduced = new (storage.get()) GrReducedClip(stack, bounds,
- context.get());
+ const GrReducedClip* reduced = new (storage.get()) GrReducedClip(stack, bounds, caps);
REPORTER_ASSERT(reporter, reduced->maskElements().count() == 1);
// Clips will be cached based on the generation id. Make sure the gen id is valid.
@@ -1201,9 +1201,10 @@
#undef XYWH
#undef IXYWH
auto context = GrContext::MakeMock(nullptr);
+ const GrCaps* caps = context->contextPriv().caps();
for (size_t i = 0; i < SK_ARRAY_COUNT(testCases); ++i) {
- const GrReducedClip reduced(stack, testCases[i].testBounds, context.get());
+ const GrReducedClip reduced(stack, testCases[i].testBounds, caps);
REPORTER_ASSERT(reporter, reduced.maskElements().count() ==
testCases[i].reducedClipCount);
SkASSERT(reduced.maskElements().count() == testCases[i].reducedClipCount);
@@ -1228,9 +1229,10 @@
SkRect bounds = SkRect::MakeXYWH(0, 0, 100, 100);
auto context = GrContext::MakeMock(nullptr);
+ const GrCaps* caps = context->contextPriv().caps();
// At the time, this would crash.
- const GrReducedClip reduced(stack, bounds, context.get());
+ const GrReducedClip reduced(stack, bounds, caps);
REPORTER_ASSERT(reporter, reduced.maskElements().isEmpty());
}
@@ -1246,10 +1248,11 @@
const SkRect& preXformQuery, ClipMethod expectedMethod,
int numExpectedElems = 0) {
auto context = GrContext::MakeMock(nullptr);
+ const GrCaps* caps = context->contextPriv().caps();
SkRect queryBounds;
queryXform.mapRect(&queryBounds, preXformQuery);
- const GrReducedClip reduced(stack, queryBounds, context.get());
+ const GrReducedClip reduced(stack, queryBounds, caps);
SkClipStack::BoundsType stackBoundsType;
SkRect stackBounds;
@@ -1407,13 +1410,14 @@
pathStack.clipPath(clipPath, SkMatrix::I(), kIntersect_SkClipOp, true);
auto context = GrContext::MakeMock(nullptr);
+ const GrCaps* caps = context->contextPriv().caps();
for (const SkClipStack& stack : {rectStack, pathStack}) {
for (SkRect queryBounds : {SkRect::MakeXYWH(53, 60, GrClip::kBoundsTolerance, 1000),
SkRect::MakeXYWH(53, 60, GrClip::kBoundsTolerance/2, 1000),
SkRect::MakeXYWH(53, 160, 1000, GrClip::kBoundsTolerance),
SkRect::MakeXYWH(53, 160, 1000, GrClip::kBoundsTolerance/2)}) {
- const GrReducedClip reduced(stack, queryBounds, context.get());
+ const GrReducedClip reduced(stack, queryBounds, caps);
REPORTER_ASSERT(reporter, !reduced.hasScissor());
REPORTER_ASSERT(reporter, reduced.maskElements().isEmpty());
REPORTER_ASSERT(reporter,