From f72f1058127d3da133b63ce1a3b29db3b2447b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 15 Oct 2020 12:49:29 +0200 Subject: Declare native interfaces using helpers Change-Id: I24c792fea1c5317466a155dcb3b050fac0f765b6 Reviewed-by: Laszlo Agocs --- src/quick/scenegraph/coreapi/qsgtexture.cpp | 21 +++------------------ src/quick/scenegraph/coreapi/qsgtexture_mac.mm | 7 +------ src/quick/scenegraph/coreapi/qsgtexture_platform.h | 20 ++++++++------------ 3 files changed, 12 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/quick/scenegraph/coreapi/qsgtexture.cpp b/src/quick/scenegraph/coreapi/qsgtexture.cpp index f04f0a096e..e415d7852e 100644 --- a/src/quick/scenegraph/coreapi/qsgtexture.cpp +++ b/src/quick/scenegraph/coreapi/qsgtexture.cpp @@ -732,12 +732,7 @@ namespace QNativeInterface { \return the OpenGL texture ID. */ -/*! - \internal - */ -QSGOpenGLTexture::~QSGOpenGLTexture() -{ -} +QT_DEFINE_NATIVE_INTERFACE(QSGOpenGLTexture); /*! Creates a new QSGTexture wrapping an existing OpenGL texture object. @@ -802,12 +797,7 @@ namespace QNativeInterface { \return the ID3D11Texture2D object. */ -/*! - \internal - */ -QSGD3D11Texture::~QSGD3D11Texture() -{ -} +QT_DEFINE_NATIVE_INTERFACE(QSGD3D11Texture); /*! Creates a new QSGTexture wrapping an existing Direct 3D 11 \a texture object. @@ -927,12 +917,7 @@ namespace QNativeInterface { \return the image layout. */ -/*! - \internal - */ -QSGVulkanTexture::~QSGVulkanTexture() -{ -} +QT_DEFINE_NATIVE_INTERFACE(QSGVulkanTexture); /*! Creates a new QSGTexture wrapping an existing Vulkan \a image object. diff --git a/src/quick/scenegraph/coreapi/qsgtexture_mac.mm b/src/quick/scenegraph/coreapi/qsgtexture_mac.mm index 55090d89df..9d009eb5cb 100644 --- a/src/quick/scenegraph/coreapi/qsgtexture_mac.mm +++ b/src/quick/scenegraph/coreapi/qsgtexture_mac.mm @@ -54,12 +54,7 @@ id QSGTexturePlatformMetal::nativeTexture() const namespace QNativeInterface { -/*! - \internal - */ -QSGMetalTexture::~QSGMetalTexture() -{ -} +QT_DEFINE_NATIVE_INTERFACE(QSGMetalTexture); QSGTexture *QSGMetalTexture::fromNative(id texture, QQuickWindow *window, diff --git a/src/quick/scenegraph/coreapi/qsgtexture_platform.h b/src/quick/scenegraph/coreapi/qsgtexture_platform.h index 0947e820ff..69011c2605 100644 --- a/src/quick/scenegraph/coreapi/qsgtexture_platform.h +++ b/src/quick/scenegraph/coreapi/qsgtexture_platform.h @@ -59,10 +59,9 @@ QT_BEGIN_NAMESPACE namespace QNativeInterface { #if QT_CONFIG(opengl) || defined(Q_CLANG_QDOC) -class Q_QUICK_EXPORT QSGOpenGLTexture +struct Q_QUICK_EXPORT QSGOpenGLTexture { -public: - virtual ~QSGOpenGLTexture(); + QT_DECLARE_NATIVE_INTERFACE(QSGOpenGLTexture) virtual GLuint nativeTexture() const = 0; static QSGTexture *fromNative(GLuint textureId, QQuickWindow *window, @@ -72,10 +71,9 @@ public: #endif #if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC) -class Q_QUICK_EXPORT QSGD3D11Texture +struct Q_QUICK_EXPORT QSGD3D11Texture { -public: - virtual ~QSGD3D11Texture(); + QT_DECLARE_NATIVE_INTERFACE(QSGD3D11Texture) virtual void *nativeTexture() const = 0; static QSGTexture *fromNative(void *texture, QQuickWindow *window, @@ -85,10 +83,9 @@ public: #endif #if defined(__OBJC__) || defined(Q_CLANG_QDOC) -class Q_QUICK_EXPORT QSGMetalTexture +struct Q_QUICK_EXPORT QSGMetalTexture { -public: - virtual ~QSGMetalTexture(); + QT_DECLARE_NATIVE_INTERFACE(QSGMetalTexture) virtual id nativeTexture() const = 0; static QSGTexture *fromNative(id texture, QQuickWindow *window, @@ -98,10 +95,9 @@ public: #endif #if QT_CONFIG(vulkan) || defined(Q_CLANG_QDOC) -class Q_QUICK_EXPORT QSGVulkanTexture +struct Q_QUICK_EXPORT QSGVulkanTexture { -public: - virtual ~QSGVulkanTexture(); + QT_DECLARE_NATIVE_INTERFACE(QSGVulkanTexture) virtual VkImage nativeImage() const = 0; virtual VkImageLayout nativeImageLayout() const = 0; static QSGTexture *fromNative(VkImage image, -- cgit v1.2.3