diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-12-18 20:45:11 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2019-01-15 19:44:20 +0000 |
commit | 749e6295712eb1dbdcd9becce0f0de8bfe136345 (patch) | |
tree | 7f56ea708ee23f6436add8c32ce75650ffb64cb0 /src/quick/items/qquickimage.cpp | |
parent | f3919f5d94510cc049a438ba2267f9db4a252970 (diff) |
Privately export QQuickImageTextureProvider, QSGTextureMaterialShader
Without this, it becomes very difficult to reimplement
updatePaintNode when subclassing QQuickImage
Change-Id: Ib5decca3584c89ea4ab793367b63ca70a4267c87
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquickimage.cpp')
-rw-r--r-- | src/quick/items/qquickimage.cpp | 50 |
1 files changed, 18 insertions, 32 deletions
diff --git a/src/quick/items/qquickimage.cpp b/src/quick/items/qquickimage.cpp index 49e5b7b1fa..2b71ad5f52 100644 --- a/src/quick/items/qquickimage.cpp +++ b/src/quick/items/qquickimage.cpp @@ -52,42 +52,28 @@ QT_BEGIN_NAMESPACE -class QQuickImageTextureProvider : public QSGTextureProvider +QQuickImageTextureProvider::QQuickImageTextureProvider() + : m_texture(nullptr) + , m_smooth(false) { - Q_OBJECT -public: - QQuickImageTextureProvider() - : m_texture(nullptr) - , m_smooth(false) - { - } +} - void updateTexture(QSGTexture *texture) { - if (m_texture == texture) - return; - m_texture = texture; - emit textureChanged(); - } +void QQuickImageTextureProvider::updateTexture(QSGTexture *texture) { + if (m_texture == texture) + return; + m_texture = texture; + emit textureChanged(); +} - QSGTexture *texture() const override { - if (m_texture) { - m_texture->setFiltering(m_smooth ? QSGTexture::Linear : QSGTexture::Nearest); - m_texture->setMipmapFiltering(m_mipmap ? QSGTexture::Linear : QSGTexture::None); - m_texture->setHorizontalWrapMode(QSGTexture::ClampToEdge); - m_texture->setVerticalWrapMode(QSGTexture::ClampToEdge); - } - return m_texture; +QSGTexture *QQuickImageTextureProvider::texture() const { + if (m_texture) { + m_texture->setFiltering(m_smooth ? QSGTexture::Linear : QSGTexture::Nearest); + m_texture->setMipmapFiltering(m_mipmap ? QSGTexture::Linear : QSGTexture::None); + m_texture->setHorizontalWrapMode(QSGTexture::ClampToEdge); + m_texture->setVerticalWrapMode(QSGTexture::ClampToEdge); } - - friend class QQuickImage; - - QSGTexture *m_texture; - bool m_smooth; - bool m_mipmap; -}; - -#include "qquickimage.moc" -#include "moc_qquickimage_p.cpp" + return m_texture; +} QQuickImagePrivate::QQuickImagePrivate() : fillMode(QQuickImage::Stretch) |