aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickimage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items/qquickimage.cpp')
-rw-r--r--src/quick/items/qquickimage.cpp50
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)