GraphiteDawn: Store texture's raw pointers in BackendTexture.
Previously, we store wgpu::Texture & wgpu::TextureView in
BackendTexture's union. This didn't work well because wgpu:: are
automatic reference counted pointers and union doesn't work well with
non-trivial objects. For example, when union is constructed, its
members' constructors won't be called properly. Leaving the wgpu::
pointers in an invalid state.
This CL changes the union to contain raw pointers: WGPUTexture &
WGPUTextureView instead. It follows the same convention as other
backends (metal, vulkan) that BackendTexture is a non-owning container.
The client must keep the references valid until they are no longer using
the BackendTexture.
Bug: b/274001762
Change-Id: I36aa58a03400274fc5695b56159932a8143f1ea3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/661616
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
8 files changed