summaryrefslogtreecommitdiff
path: root/src/imports
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-04-24 18:10:09 +0200
committerLiang Qi <liang.qi@qt.io>2020-04-27 05:59:07 +0000
commit00c8a79da0c80616f18329cdfc61338a2c1af7df (patch)
treef98fd3afe313790b606afcbb82ff4bae7c31cd94 /src/imports
parentb1a2f97b6ffa50f441ece32043bc2e8680b56816 (diff)
downloadqtwayland-00c8a79da0c80616f18329cdfc61338a2c1af7df.tar.gz
Adapt to new QSGTexture API
This aligns with 76f783c23f in qtdeclarative. As a precursor to removing the OpenGL specifics (such as, textureId(), bind(), etc.), QSGTexture now has a pure virtual comparisonKey(). Implement this in the two places where QSGTexture is subclassed. Further adaptation to the post-direct-OpenGL-world is left as a future exercise. Change-Id: I102dd0749659fe13347bf95d4b15515680aebbfa Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/texture-sharing/sharedtextureprovider.cpp5
-rw-r--r--src/imports/texture-sharing/sharedtextureprovider.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/imports/texture-sharing/sharedtextureprovider.cpp b/src/imports/texture-sharing/sharedtextureprovider.cpp
index 707e94ae..455899b6 100644
--- a/src/imports/texture-sharing/sharedtextureprovider.cpp
+++ b/src/imports/texture-sharing/sharedtextureprovider.cpp
@@ -71,6 +71,11 @@ int SharedTexture::textureId() const
return m_tex ? m_tex->textureId() : 0;
}
+int SharedTexture::comparisonKey() const
+{
+ return m_tex ? int(m_tex->textureId()) : int(qintptr(this));
+}
+
QSize SharedTexture::textureSize() const
{
updateGLTexture();
diff --git a/src/imports/texture-sharing/sharedtextureprovider.h b/src/imports/texture-sharing/sharedtextureprovider.h
index f25c7de9..61a1c701 100644
--- a/src/imports/texture-sharing/sharedtextureprovider.h
+++ b/src/imports/texture-sharing/sharedtextureprovider.h
@@ -100,6 +100,7 @@ public:
SharedTexture(QtWaylandClient::QWaylandServerBuffer *buffer);
int textureId() const override;
+ int comparisonKey() const override;
QSize textureSize() const override;
bool hasAlphaChannel() const override;
bool hasMipmaps() const override;