diff options
Diffstat (limited to 'src/quick/scenegraph/qsgadaptationlayer.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgadaptationlayer.cpp | 113 |
1 files changed, 58 insertions, 55 deletions
diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp index 9d18868c58..9ce21d6b8f 100644 --- a/src/quick/scenegraph/qsgadaptationlayer.cpp +++ b/src/quick/scenegraph/qsgadaptationlayer.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtQuick module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2018 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qsgadaptationlayer_p.h" @@ -54,6 +18,13 @@ QT_BEGIN_NAMESPACE +Q_TRACE_POINT(qtquick, QSGDistanceFieldGlyphCache_update_entry, int count) +Q_TRACE_POINT(qtquick, QSGDistanceFieldGlyphCache_update_exit) +Q_TRACE_POINT(qtquick, QSGDistanceFieldGlyphCache_glyphRender_entry) +Q_TRACE_POINT(qtquick, QSGDistanceFieldGlyphCache_glyphRender_exit) +Q_TRACE_POINT(qtquick, QSGDistanceFieldGlyphCache_glyphStore_entry) +Q_TRACE_POINT(qtquick, QSGDistanceFieldGlyphCache_glyphStore_exit) + static QElapsedTimer qsg_render_timer; QSGDistanceFieldGlyphCache::Texture QSGDistanceFieldGlyphCache::s_emptyTexture; @@ -127,7 +98,7 @@ void QSGDistanceFieldGlyphCache::populate(const QVector<glyph_t> &glyphs) { QSet<glyph_t> referencedGlyphs; QSet<glyph_t> newGlyphs; - int count = glyphs.count(); + int count = glyphs.size(); for (int i = 0; i < count; ++i) { glyph_t glyphIndex = glyphs.at(i); if ((int) glyphIndex >= glyphCount() && glyphCount() > 0) { @@ -160,7 +131,7 @@ void QSGDistanceFieldGlyphCache::populate(const QVector<glyph_t> &glyphs) void QSGDistanceFieldGlyphCache::release(const QVector<glyph_t> &glyphs) { QSet<glyph_t> unusedGlyphs; - int count = glyphs.count(); + int count = glyphs.size(); for (int i = 0; i < count; ++i) { glyph_t glyphIndex = glyphs.at(i); GlyphData &gd = glyphData(glyphIndex); @@ -170,6 +141,11 @@ void QSGDistanceFieldGlyphCache::release(const QVector<glyph_t> &glyphs) releaseGlyphs(unusedGlyphs); } +bool QSGDistanceFieldGlyphCache::isActive() const +{ + return true; +} + void QSGDistanceFieldGlyphCache::update() { m_populatingGlyphs.clear(); @@ -211,7 +187,7 @@ void QSGDistanceFieldGlyphCache::update() storeGlyphs(distanceFields); #if defined(QSG_DISTANCEFIELD_CACHE_DEBUG) - for (Texture texture : qAsConst(m_textures)) + for (Texture texture : std::as_const(m_textures)) saveTexture(texture.texture, m_referenceFont.familyName()); #endif @@ -234,7 +210,7 @@ void QSGDistanceFieldGlyphCache::setGlyphsPosition(const QList<GlyphPosition> &g { QVector<quint32> invalidatedGlyphs; - int count = glyphs.count(); + int count = glyphs.size(); for (int i = 0; i < count; ++i) { GlyphPosition glyph = glyphs.at(i); GlyphData &gd = glyphData(glyph.glyph); @@ -257,16 +233,6 @@ void QSGDistanceFieldGlyphCache::setGlyphsPosition(const QList<GlyphPosition> &g } } -void QSGDistanceFieldGlyphCache::registerOwnerElement(QQuickItem *ownerElement) -{ - Q_UNUSED(ownerElement); -} - -void QSGDistanceFieldGlyphCache::unregisterOwnerElement(QQuickItem *ownerElement) -{ - Q_UNUSED(ownerElement); -} - void QSGDistanceFieldGlyphCache::processPendingGlyphs() { /* Intentionally empty */ @@ -285,7 +251,7 @@ void QSGDistanceFieldGlyphCache::setGlyphsTexture(const QVector<glyph_t> &glyphs QVector<quint32> invalidatedGlyphs; - int count = glyphs.count(); + int count = glyphs.size(); for (int j = 0; j < count; ++j) { glyph_t glyphIndex = glyphs.at(j); GlyphData &gd = glyphData(glyphIndex); @@ -303,14 +269,14 @@ void QSGDistanceFieldGlyphCache::setGlyphsTexture(const QVector<glyph_t> &glyphs void QSGDistanceFieldGlyphCache::markGlyphsToRender(const QVector<glyph_t> &glyphs) { - int count = glyphs.count(); + int count = glyphs.size(); for (int i = 0; i < count; ++i) m_pendingGlyphs.add(glyphs.at(i)); } void QSGDistanceFieldGlyphCache::updateRhiTexture(QRhiTexture *oldTex, QRhiTexture *newTex, const QSize &newTexSize) { - int count = m_textures.count(); + int count = m_textures.size(); for (int i = 0; i < count; ++i) { Texture &tex = m_textures[i]; if (tex.texture == oldTex) { @@ -321,6 +287,9 @@ void QSGDistanceFieldGlyphCache::updateRhiTexture(QRhiTexture *oldTex, QRhiTextu } } +QSGNodeVisitorEx::~QSGNodeVisitorEx() + = default; + void QSGNodeVisitorEx::visitChildren(QSGNode *node) { for (QSGNode *child = node->firstChild(); child; child = child->nextSibling()) { @@ -383,6 +352,18 @@ void QSGNodeVisitorEx::visitChildren(QSGNode *node) } } +QSGVisitableNode::~QSGVisitableNode() + = default; + +QSGInternalRectangleNode::~QSGInternalRectangleNode() + = default; + +QSGInternalImageNode::~QSGInternalImageNode() + = default; + +QSGPainterNode::~QSGPainterNode() + = default; + #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug debug, const QSGGuiThreadShaderEffectManager::ShaderInfo::Variable &v) { @@ -422,6 +403,28 @@ QSGLayer::QSGLayer(QSGTexturePrivate &dd) { } +QSGLayer::~QSGLayer() + = default; + +#if QT_CONFIG(quick_sprite) + +QSGSpriteNode::~QSGSpriteNode() + = default; + +#endif + +QSGGuiThreadShaderEffectManager::~QSGGuiThreadShaderEffectManager() + = default; + +QSGShaderEffectNode::~QSGShaderEffectNode() + = default; + +QSGGlyphNode::~QSGGlyphNode() + = default; + +QSGDistanceFieldGlyphConsumer::~QSGDistanceFieldGlyphConsumer() + = default; + QT_END_NAMESPACE #include "moc_qsgadaptationlayer_p.cpp" |