diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-01-11 15:41:39 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-01-14 10:12:13 +0100 |
commit | c2c180e4ee58f8cfc104207b3b56e83ddcb7e79a (patch) | |
tree | 9473794cc5d112ee383032380a48aaad6901c670 /src/quick/items/qquickwindow.cpp | |
parent | 653d5a4745ad2f20ae924527b7b31580eedc651b (diff) |
Enable importing OpenGL textures for the GL_TEXTURE_EXTERNAL_OES target
Introduce a QSGOpenGLTexture::fromNativeExternalOES() function
which internally passes in the flag QRhiTexture::ExternalOES
when creating the wrapping QRhiTexture.
Change-Id: I919e2539304d3aeaa6bc8e5953d96adc810abb12
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/items/qquickwindow.cpp')
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 37525d99d8..6a57553b21 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -4689,14 +4689,15 @@ QSGTexture *QQuickWindow::createTextureFromImage(const QImage &image, CreateText QSGTexture *QQuickWindowPrivate::createTextureFromNativeTexture(quint64 nativeObjectHandle, int nativeLayout, const QSize &size, - QQuickWindow::CreateTextureOptions options) const + QQuickWindow::CreateTextureOptions options, + TextureFromNativeTextureFlags flags) const { if (!rhi) return nullptr; QSGPlainTexture *texture = new QSGPlainTexture; texture->setTextureFromNativeTexture(rhi, nativeObjectHandle, nativeLayout, - size, options.testFlag(QQuickWindow::TextureHasMipmaps)); + size, options, flags); texture->setHasAlphaChannel(options & QQuickWindow::TextureHasAlphaChannel); // note that the QRhiTexture does not (and cannot) own the native object texture->setOwnsTexture(true); // texture meaning the QRhiTexture here, not the native object |