Revert "put an arena on GrSurfaceDrawContext"
This reverts commit 5a2de5e72f24d1bfbdc532252be3dcdefa7b75a2.
Reason for revert: Upon further investigation this still leaks
Original change's description:
> put an arena on GrSurfaceDrawContext
>
> This is part one of two CLs. In this CL, I put a
> sk_sp<GrArenas> on GrSurfaceFillContext where GrArenas wraps
> a SkArenaAlloc to add ref counting. Creating
> a GrOpsTask shares the GrArenas with the ops task. New plumbing
> was added to GR_DRAW_OP_TEST_DEFINE to allow a proper
> GrSurfaceDrawContext to be passed to GrAtlasTextOp's
> GR_DRAW_OP_TEST_DEFINE so the arena will have a proper lifetime.
>
> The second CL will work on replacing GrOpsTask's fAllocators
> system with the shared arena.
>
> Change-Id: Ife3be0ab265441cbffab360f2808f5eed86db8b3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/392936
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
TBR=bsalomon@google.com,herb@google.com
Change-Id: I9ca5c8b1e16b468003788cd3126eda1d40ff93ed
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/393177
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
diff --git a/tools/gpu/GrTest.cpp b/tools/gpu/GrTest.cpp
index ac03100..85f25cb 100644
--- a/tools/gpu/GrTest.cpp
+++ b/tools/gpu/GrTest.cpp
@@ -53,7 +53,7 @@
#define DRAW_OP_TEST_EXTERN(Op) \
extern GrOp::Owner Op##__Test(GrPaint&&, SkRandom*, \
- GrRecordingContext*, GrSurfaceDrawContext*, int)
+ GrRecordingContext*, int numSamples)
#define DRAW_OP_TEST_ENTRY(Op) Op##__Test
DRAW_OP_TEST_EXTERN(AAConvexPathOp);
@@ -81,7 +81,7 @@
void GrDrawRandomOp(SkRandom* random, GrSurfaceDrawContext* surfaceDrawContext, GrPaint&& paint) {
auto context = surfaceDrawContext->recordingContext();
using MakeDrawOpFn = GrOp::Owner (GrPaint&&, SkRandom*,
- GrRecordingContext*, GrSurfaceDrawContext*, int numSamples);
+ GrRecordingContext*, int numSamples);
static constexpr MakeDrawOpFn* gFactories[] = {
DRAW_OP_TEST_ENTRY(AAConvexPathOp),
DRAW_OP_TEST_ENTRY(AAFlatteningConvexPathOp),
@@ -108,11 +108,8 @@
static constexpr size_t kTotal = SK_ARRAY_COUNT(gFactories);
uint32_t index = random->nextULessThan(static_cast<uint32_t>(kTotal));
- auto op = gFactories[index](std::move(paint),
- random,
- context,
- surfaceDrawContext,
- surfaceDrawContext->numSamples());
+ auto op = gFactories[index](
+ std::move(paint), random, context, surfaceDrawContext->numSamples());
// Creating a GrAtlasTextOp my not produce an op if for example, it is totally outside the
// render target context.