diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-05-27 17:44:49 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-05-28 17:53:32 +0200 |
commit | 56977990e04efa051b1ebd4ce9274d6b69c7bd0c (patch) | |
tree | eaa66635b67faaf94df7b0670fa9e0971268a936 /src/gui/rhi/qrhinull.cpp | |
parent | c991d87ee2c239fedb77f76f25936dddf5eb5982 (diff) |
rhi: Harmonize create-destroy API pattern with the rest of Qt
For historical reasons we use build and release instead of create and
destroy. This becomes confusing now that more modules in Qt start taking
QRhi into use. Migrate to the more familiar naming, so those who have
used QWindow or QOpenGLContext before will find it natural.
Change-Id: I05eb2243ce274c59b03a5f8bcbb2792a4f37120f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhinull.cpp')
-rw-r--r-- | src/gui/rhi/qrhinull.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/src/gui/rhi/qrhinull.cpp b/src/gui/rhi/qrhinull.cpp index b1ce9b7599..7511859d31 100644 --- a/src/gui/rhi/qrhinull.cpp +++ b/src/gui/rhi/qrhinull.cpp @@ -544,10 +544,10 @@ QNullBuffer::QNullBuffer(QRhiImplementation *rhi, Type type, UsageFlags usage, i QNullBuffer::~QNullBuffer() { - release(); + destroy(); } -void QNullBuffer::release() +void QNullBuffer::destroy() { data.clear(); @@ -555,7 +555,7 @@ void QNullBuffer::release() QRHI_PROF_F(releaseBuffer(this)); } -bool QNullBuffer::build() +bool QNullBuffer::create() { data.fill('\0', m_size); @@ -573,16 +573,16 @@ QNullRenderBuffer::QNullRenderBuffer(QRhiImplementation *rhi, Type type, const Q QNullRenderBuffer::~QNullRenderBuffer() { - release(); + destroy(); } -void QNullRenderBuffer::release() +void QNullRenderBuffer::destroy() { QRHI_PROF; QRHI_PROF_F(releaseRenderBuffer(this)); } -bool QNullRenderBuffer::build() +bool QNullRenderBuffer::create() { QRHI_PROF; QRHI_PROF_F(newRenderBuffer(this, false, false, 1)); @@ -602,16 +602,16 @@ QNullTexture::QNullTexture(QRhiImplementation *rhi, Format format, const QSize & QNullTexture::~QNullTexture() { - release(); + destroy(); } -void QNullTexture::release() +void QNullTexture::destroy() { QRHI_PROF; QRHI_PROF_F(releaseTexture(this)); } -bool QNullTexture::build() +bool QNullTexture::create() { QRHI_RES_RHI(QRhiNull); const bool isCube = m_flags.testFlag(CubeMap); @@ -635,7 +635,7 @@ bool QNullTexture::build() return true; } -bool QNullTexture::buildFrom(QRhiTexture::NativeTexture src) +bool QNullTexture::createFrom(QRhiTexture::NativeTexture src) { Q_UNUSED(src) QRHI_RES_RHI(QRhiNull); @@ -656,14 +656,14 @@ QNullSampler::QNullSampler(QRhiImplementation *rhi, Filter magFilter, Filter min QNullSampler::~QNullSampler() { - release(); + destroy(); } -void QNullSampler::release() +void QNullSampler::destroy() { } -bool QNullSampler::build() +bool QNullSampler::create() { return true; } @@ -675,10 +675,10 @@ QNullRenderPassDescriptor::QNullRenderPassDescriptor(QRhiImplementation *rhi) QNullRenderPassDescriptor::~QNullRenderPassDescriptor() { - release(); + destroy(); } -void QNullRenderPassDescriptor::release() +void QNullRenderPassDescriptor::destroy() { } @@ -696,10 +696,10 @@ QNullReferenceRenderTarget::QNullReferenceRenderTarget(QRhiImplementation *rhi) QNullReferenceRenderTarget::~QNullReferenceRenderTarget() { - release(); + destroy(); } -void QNullReferenceRenderTarget::release() +void QNullReferenceRenderTarget::destroy() { } @@ -728,10 +728,10 @@ QNullTextureRenderTarget::QNullTextureRenderTarget(QRhiImplementation *rhi, QNullTextureRenderTarget::~QNullTextureRenderTarget() { - release(); + destroy(); } -void QNullTextureRenderTarget::release() +void QNullTextureRenderTarget::destroy() { } @@ -740,7 +740,7 @@ QRhiRenderPassDescriptor *QNullTextureRenderTarget::newCompatibleRenderPassDescr return new QNullRenderPassDescriptor(m_rhi); } -bool QNullTextureRenderTarget::build() +bool QNullTextureRenderTarget::create() { QRHI_RES_RHI(QRhiNull); d.rp = QRHI_RES(QNullRenderPassDescriptor, m_renderPassDesc); @@ -779,14 +779,14 @@ QNullShaderResourceBindings::QNullShaderResourceBindings(QRhiImplementation *rhi QNullShaderResourceBindings::~QNullShaderResourceBindings() { - release(); + destroy(); } -void QNullShaderResourceBindings::release() +void QNullShaderResourceBindings::destroy() { } -bool QNullShaderResourceBindings::build() +bool QNullShaderResourceBindings::create() { return true; } @@ -798,14 +798,14 @@ QNullGraphicsPipeline::QNullGraphicsPipeline(QRhiImplementation *rhi) QNullGraphicsPipeline::~QNullGraphicsPipeline() { - release(); + destroy(); } -void QNullGraphicsPipeline::release() +void QNullGraphicsPipeline::destroy() { } -bool QNullGraphicsPipeline::build() +bool QNullGraphicsPipeline::create() { QRHI_RES_RHI(QRhiNull); if (!rhiD->sanityCheckGraphicsPipeline(this)) @@ -821,14 +821,14 @@ QNullComputePipeline::QNullComputePipeline(QRhiImplementation *rhi) QNullComputePipeline::~QNullComputePipeline() { - release(); + destroy(); } -void QNullComputePipeline::release() +void QNullComputePipeline::destroy() { } -bool QNullComputePipeline::build() +bool QNullComputePipeline::create() { return true; } @@ -840,10 +840,10 @@ QNullCommandBuffer::QNullCommandBuffer(QRhiImplementation *rhi) QNullCommandBuffer::~QNullCommandBuffer() { - release(); + destroy(); } -void QNullCommandBuffer::release() +void QNullCommandBuffer::destroy() { // nothing to do here } @@ -857,10 +857,10 @@ QNullSwapChain::QNullSwapChain(QRhiImplementation *rhi) QNullSwapChain::~QNullSwapChain() { - release(); + destroy(); } -void QNullSwapChain::release() +void QNullSwapChain::destroy() { QRHI_PROF; QRHI_PROF_F(releaseSwapChain(this)); @@ -886,7 +886,7 @@ QRhiRenderPassDescriptor *QNullSwapChain::newCompatibleRenderPassDescriptor() return new QNullRenderPassDescriptor(m_rhi); } -bool QNullSwapChain::buildOrResize() +bool QNullSwapChain::createOrResize() { m_currentPixelSize = surfacePixelSize(); rt.d.rp = QRHI_RES(QNullRenderPassDescriptor, m_renderPassDesc); |