mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-14 17:16:01 +00:00
TextureBase: Make the constructor/destructor protected.
Bug: dawn:1451 Change-Id: Iff38001768c6e135512ab310f6fa935fccdf9d1c Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92660 Reviewed-by: Loko Kung <lokokung@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
25c8d51657
commit
4ef134c19d
@ -47,9 +47,6 @@ class TextureBase : public ApiObjectBase {
|
|||||||
enum class TextureState { OwnedInternal, OwnedExternal, Destroyed };
|
enum class TextureState { OwnedInternal, OwnedExternal, Destroyed };
|
||||||
enum class ClearValue { Zero, NonZero };
|
enum class ClearValue { Zero, NonZero };
|
||||||
|
|
||||||
TextureBase(DeviceBase* device, const TextureDescriptor* descriptor, TextureState state);
|
|
||||||
~TextureBase() override;
|
|
||||||
|
|
||||||
static TextureBase* MakeError(DeviceBase* device);
|
static TextureBase* MakeError(DeviceBase* device);
|
||||||
|
|
||||||
ObjectType GetType() const override;
|
ObjectType GetType() const override;
|
||||||
@ -101,8 +98,11 @@ class TextureBase : public ApiObjectBase {
|
|||||||
void APIDestroy();
|
void APIDestroy();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
TextureBase(DeviceBase* device, const TextureDescriptor* descriptor, TextureState state);
|
||||||
// Constructor used only for mocking and testing.
|
// Constructor used only for mocking and testing.
|
||||||
TextureBase(DeviceBase* device, TextureState state);
|
TextureBase(DeviceBase* device, TextureState state);
|
||||||
|
~TextureBase() override;
|
||||||
|
|
||||||
void DestroyImpl() override;
|
void DestroyImpl() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -506,4 +506,7 @@ float Device::GetTimestampPeriodInNS() const {
|
|||||||
return 1.0f;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Texture::Texture(DeviceBase* device, const TextureDescriptor* descriptor, TextureState state)
|
||||||
|
: TextureBase(device, descriptor, state) {}
|
||||||
|
|
||||||
} // namespace dawn::native::null
|
} // namespace dawn::native::null
|
||||||
|
@ -55,7 +55,7 @@ class RenderPipeline;
|
|||||||
using Sampler = SamplerBase;
|
using Sampler = SamplerBase;
|
||||||
class ShaderModule;
|
class ShaderModule;
|
||||||
class SwapChain;
|
class SwapChain;
|
||||||
using Texture = TextureBase;
|
class Texture;
|
||||||
using TextureView = TextureViewBase;
|
using TextureView = TextureViewBase;
|
||||||
|
|
||||||
struct NullBackendTraits {
|
struct NullBackendTraits {
|
||||||
@ -335,6 +335,11 @@ class StagingBuffer : public StagingBufferBase {
|
|||||||
std::unique_ptr<uint8_t[]> mBuffer;
|
std::unique_ptr<uint8_t[]> mBuffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Texture : public TextureBase {
|
||||||
|
public:
|
||||||
|
Texture(DeviceBase* device, const TextureDescriptor* descriptor, TextureState state);
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace dawn::native::null
|
} // namespace dawn::native::null
|
||||||
|
|
||||||
#endif // SRC_DAWN_NATIVE_NULL_DEVICENULL_H_
|
#endif // SRC_DAWN_NATIVE_NULL_DEVICENULL_H_
|
||||||
|
Loading…
x
Reference in New Issue
Block a user