Move most of Ref's functionality in RefBase for reuse.

This will allow using the same logic for other kinds of smartpointers,
like NSRef<>

Bug: dawn:89
Change-Id: Idbe08208fdb38b236f52635bc913162e60baf0f0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/32160
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez
2020-11-12 11:47:59 +00:00
committed by Commit Bot service account
parent b70a5b02e9
commit 2089adc62a
6 changed files with 209 additions and 148 deletions

View File

@@ -483,7 +483,7 @@ namespace dawn_native { namespace vulkan {
Ref<Texture> texture =
AcquireRef(new Texture(device, descriptor, TextureState::OwnedExternal));
texture->InitializeForSwapChain(nativeImage);
return std::move(texture);
return texture;
}
MaybeError Texture::InitializeAsInternalTexture(VkImageUsageFlags extraUsages) {