mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 02:39:11 +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
@@ -159,8 +159,8 @@ namespace dawn_native { namespace null {
|
||||
const SwapChainDescriptor* descriptor) {
|
||||
return new SwapChain(this, surface, previousSwapChain, descriptor);
|
||||
}
|
||||
ResultOrError<TextureBase*> Device::CreateTextureImpl(const TextureDescriptor* descriptor) {
|
||||
return new Texture(this, descriptor, TextureBase::TextureState::OwnedInternal);
|
||||
ResultOrError<Ref<TextureBase>> Device::CreateTextureImpl(const TextureDescriptor* descriptor) {
|
||||
return AcquireRef(new Texture(this, descriptor, TextureBase::TextureState::OwnedInternal));
|
||||
}
|
||||
ResultOrError<TextureViewBase*> Device::CreateTextureViewImpl(
|
||||
TextureBase* texture,
|
||||
|
||||
@@ -132,7 +132,8 @@ namespace dawn_native { namespace null {
|
||||
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