add API for Op creation
Introduce three calls on GrOp: Make, MakeWithExtraMemory,
and MakeWithProcessorSet. Instead of returning
unique_ptr<GrOp>, they return a type of GrOp::OpOwner.
GrOp::OpOwner safely deletes the op when it goes out
of scope for either new/delete or GrOpMemoryPool
allocations.
In order to make the code easier to refactor, I
eliminated MakeArg from the helpers.
Change-Id: Icfd697906f3147a8734575d08bd7195e7517383a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323778
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Herb Derby <herb@google.com>
diff --git a/src/gpu/ops/GrTextureOp.h b/src/gpu/ops/GrTextureOp.h
index 1af1a6f..aee32b0 100644
--- a/src/gpu/ops/GrTextureOp.h
+++ b/src/gpu/ops/GrTextureOp.h
@@ -40,18 +40,18 @@
* deconstructed into the texture, filter, modulating color, and blend mode. When blend mode is
* src over, this will return a GrFillRectOp with a paint that samples the proxy.
*/
- static std::unique_ptr<GrDrawOp> Make(GrRecordingContext*,
- GrSurfaceProxyView,
- SkAlphaType srcAlphaType,
- sk_sp<GrColorSpaceXform>,
- GrSamplerState::Filter,
- GrSamplerState::MipmapMode,
- const SkPMColor4f&,
- Saturate,
- SkBlendMode,
- GrAAType,
- DrawQuad*,
- const SkRect* subset = nullptr);
+ static GrOp::Owner Make(GrRecordingContext*,
+ GrSurfaceProxyView,
+ SkAlphaType srcAlphaType,
+ sk_sp<GrColorSpaceXform>,
+ GrSamplerState::Filter,
+ GrSamplerState::MipmapMode,
+ const SkPMColor4f&,
+ Saturate,
+ SkBlendMode,
+ GrAAType,
+ DrawQuad*,
+ const SkRect* subset = nullptr);
// Automatically falls back to using one GrFillRectOp per entry if dynamic states are not
// supported, or if the blend mode is not src-over. 'cnt' is the size of the entry array.