mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
Use Ref<TextureBase> instead of TextureBase* in more places
To avoid accidental memory leaks on account of using raw pointers, use Ref<TextureBase> as method return type except at Dawn interface boundaries. Change-Id: I6459062ee28984de2cb1d5a2059bc70cf82b2faf Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19580 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
This commit is contained in:
committed by
Commit Bot service account
parent
c9e28b1463
commit
0e9320b5b5
@@ -136,8 +136,8 @@ namespace dawn_native { namespace opengl {
|
||||
const SwapChainDescriptor* descriptor) {
|
||||
return DAWN_VALIDATION_ERROR("New swapchains not implemented.");
|
||||
}
|
||||
ResultOrError<TextureBase*> Device::CreateTextureImpl(const TextureDescriptor* descriptor) {
|
||||
return new Texture(this, descriptor);
|
||||
ResultOrError<Ref<TextureBase>> Device::CreateTextureImpl(const TextureDescriptor* descriptor) {
|
||||
return AcquireRef(new Texture(this, descriptor));
|
||||
}
|
||||
ResultOrError<TextureViewBase*> Device::CreateTextureViewImpl(
|
||||
TextureBase* texture,
|
||||
|
||||
@@ -89,7 +89,8 @@ namespace dawn_native { namespace opengl {
|
||||
Surface* surface,
|
||||
NewSwapChainBase* previousSwapChain,
|
||||
const SwapChainDescriptor* descriptor) override;
|
||||
ResultOrError<TextureBase*> CreateTextureImpl(const TextureDescriptor* descriptor) override;
|
||||
ResultOrError<Ref<TextureBase>> CreateTextureImpl(
|
||||
const TextureDescriptor* descriptor) override;
|
||||
ResultOrError<TextureViewBase*> CreateTextureViewImpl(
|
||||
TextureBase* texture,
|
||||
const TextureViewDescriptor* descriptor) override;
|
||||
|
||||
Reference in New Issue
Block a user