diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-08-04 13:10:34 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-08-04 14:29:30 +0200 |
commit | 28005c0c037626d5601192e2a412633656d52b39 (patch) | |
tree | a95aef6661149a95285d18736620051b8d16ce8a /src/quick/scenegraph/coreapi/qsgtexture.cpp | |
parent | fb96109bbc2ec5d83171a70d6c164d79695d2ddd (diff) |
Switch to MTLTexture protocol in QSGTexture native access
Now only available from ObjC code.
Change-Id: I88df6c8839fc660ffd2b8e88a789ca73a9d4accd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgtexture.cpp')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgtexture.cpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgtexture.cpp b/src/quick/scenegraph/coreapi/qsgtexture.cpp index 2400095125..66ba477990 100644 --- a/src/quick/scenegraph/coreapi/qsgtexture.cpp +++ b/src/quick/scenegraph/coreapi/qsgtexture.cpp @@ -119,7 +119,7 @@ QSGTexturePrivate::QSGTexturePrivate(QSGTexture *t) #ifdef Q_OS_WIN , m_d3d11TextureAccessor(t) #endif -#if defined(Q_OS_MACOS) || defined(Q_OS_IOS) +#if defined(__OBJC__) , m_metalTextureAccessor(t) #endif #if QT_CONFIG(vulkan) @@ -857,7 +857,7 @@ QPlatformInterface::QSGD3D11Texture *QSGTexture::platformInterface<QPlatformInte } #endif // win -#if defined(Q_OS_MACOS) || defined(Q_OS_IOS) || defined(Q_CLANG_QDOC) +#if defined(__OBJC__) || defined(Q_CLANG_QDOC) namespace QPlatformInterface { /*! \class QPlatformInterface::QSGMetalTexture @@ -867,19 +867,12 @@ namespace QPlatformInterface { */ /*! - \fn MTLTexture *QPlatformInterface::QSGMetalTexture::nativeTexture() const + \fn id<MTLTexture> QPlatformInterface::QSGMetalTexture::nativeTexture() const \return the Metal texture object. */ /*! - \internal - */ -QSGMetalTexture::~QSGMetalTexture() -{ -} - -/*! - \fn QSGTexture *QPlatformInterface::QSGMetalTexture::fromNative(MTLTexture *texture, QQuickWindow *window, const QSize &size, QQuickWindow::CreateTextureOptions options) + \fn QSGTexture *QPlatformInterface::QSGMetalTexture::fromNative(id<MTLTexture> texture, QQuickWindow *window, const QSize &size, QQuickWindow::CreateTextureOptions options) Creates a new QSGTexture wrapping an existing Metal \a texture object. @@ -907,13 +900,6 @@ QSGMetalTexture::~QSGMetalTexture() } // QPlatformInterface -MTLTexture *QSGTexturePlatformMetal::nativeTexture() const -{ - if (auto *tex = m_texture->rhiTexture()) - return (MTLTexture *) quintptr(tex->nativeTexture().object); - return 0; -} - template<> Q_QUICK_EXPORT QPlatformInterface::QSGMetalTexture *QSGTexture::platformInterface<QPlatformInterface::QSGMetalTexture>() { |