SkAnySubclass: Holds any subclass of a given type that fits in a given size
Intentionally not-too-magic. Think of this less like std::any, and more
like a single-allocation arena with automatic destruction.
I started with a version that could hold *any* type fitting in Size, but
the use-case for this (backend-specific data in public GPU structures)
constrained the problem further, so I went with the extremely targeted
solution.
Bug: b/293490566
Change-Id: Ic77575534525b315a93976affc58c9c02f630cd7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/738102
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
4 files changed