diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-08-29 12:27:59 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-08-29 15:09:21 +0200 |
commit | 54f31a64d01a138e72f79b9585cb90004bbe1e4a (patch) | |
tree | 3c3f11c21b766ee9ea0b4b48a245fde673eed5d0 /src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | |
parent | 0aada37644762d4757f9f9b2a76e31389aa91b27 (diff) |
Avoid introducing rhiTexture() in the public API of QSGTexture
There is no need for this. The few internal users can get it via
QSGTexturePrivate.
The original thinking was based on QRhi* being a public API, but that
is not the case in the near future. So avoid introducing a public API
relying on QRhiTexture.
This of course makes it impossible to retrieve the native object under
a QSGTexture (as textureId() is not used anymore when rendering with the
RHI). For that, an alternative approach will be introduced later on.
Change-Id: I0099b23424cafa4958f78c03300b0c934b60d92c
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultglyphnode_p.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp index db889c3102..8fc8c711c6 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp @@ -451,7 +451,9 @@ bool QSGTextMaskRhiShader::updateUniformData(const RenderState &state, changed = true; } - if (updated || !oldMat || oldMat->texture()->rhiTexture() != mat->texture()->rhiTexture()) { + QRhiTexture *oldRtex = oldMat ? QSGTexturePrivate::get(oldMat->texture())->rhiTexture() : nullptr; + QRhiTexture *newRtex = QSGTexturePrivate::get(mat->texture())->rhiTexture(); + if (updated || !oldMat || oldRtex != newRtex) { const QVector2D textureScale = QVector2D(1.0f / mat->rhiGlyphCache()->width(), 1.0f / mat->rhiGlyphCache()->height()); memcpy(buf->data() + 64 + 16, &textureScale, 8); |