7#include <QtQuick/private/qsgdistancefieldglyphnode_p.h>
8#include <QtQuick/private/qsgcontext_p.h>
9#include <private/qrawfont_p.h>
10#include <QtGui/qguiapplication.h>
14#include <private/qquickprofiler_p.h>
15#include <QElapsedTimer>
17#include <qtquick_tracepoints_p.h>
23Q_TRACE_POINT(qtquick, QSGDistanceFieldGlyphCache_glyphRender_entry)
24Q_TRACE_POINT(qtquick, QSGDistanceFieldGlyphCache_glyphRender_exit)
25Q_TRACE_POINT(qtquick, QSGDistanceFieldGlyphCache_glyphStore_entry)
26Q_TRACE_POINT(qtquick, QSGDistanceFieldGlyphCache_glyphStore_exit)
33 : m_renderTypeQuality(renderTypeQuality)
43 m_referenceFont =
font;
70 if (
data == m_glyphsData.end()) {
76 scaleDown.
scale(scaleFactor, scaleFactor);
105 qWarning(
"Warning: distance-field glyph is not available with index %d", glyphIndex);
111 referencedGlyphs.
insert(glyphIndex);
116 m_populatingGlyphs.
insert(glyphIndex);
122 newGlyphs.
insert(glyphIndex);
139 unusedGlyphs.
insert(glyphIndex);
151 m_populatingGlyphs.
clear();
158 bool profileFrames = QSG_LOG_TIME_GLYPH().isDebugEnabled();
162 Q_TRACE(QSGDistanceFieldGlyphCache_glyphRender_entry);
165 const int pendingGlyphsSize = m_pendingGlyphs.
size();
166 distanceFields.
reserve(pendingGlyphsSize);
167 for (
int i = 0;
i < pendingGlyphsSize; ++
i) {
170 m_pendingGlyphs.
at(
i),
180 Q_TRACE(QSGDistanceFieldGlyphCache_glyphRender_exit);
182 QQuickProfiler::SceneGraphAdaptationLayerGlyphRender);
183 Q_TRACE(QSGDistanceFieldGlyphCache_glyphStore_entry);
185 m_pendingGlyphs.
reset();
189#if defined(QSG_DISTANCEFIELD_CACHE_DEBUG)
194 if (QSG_LOG_TIME_GLYPH().isDebugEnabled()) {
197 "distancefield: %d glyphs prepared in %dms, rendering=%d, upload=%d",
200 int(renderTime / 1000000),
201 int((
now - (renderTime / 1000000))));
203 Q_TRACE(QSGDistanceFieldGlyphCache_glyphStore_exit);
205 QQuickProfiler::SceneGraphAdaptationLayerGlyphStore,
229 if (!invalidatedGlyphs.
isEmpty()) {
230 for (QSGDistanceFieldGlyphConsumerList::iterator
iter = m_registeredNodes.
begin();
iter != m_registeredNodes.
end(); ++
iter) {
231 iter->invalidateGlyphs(invalidatedGlyphs);
253 int i = m_textures.indexOf(tex);
255 m_textures.append(tex);
256 i = m_textures.size() - 1;
258 m_textures[
i].size = tex.
size;
268 if (gd.
texture != &s_emptyTexture)
269 invalidatedGlyphs.
append(glyphIndex);
273 if (!invalidatedGlyphs.
isEmpty()) {
274 for (QSGDistanceFieldGlyphConsumerList::iterator
iter = m_registeredNodes.
begin();
iter != m_registeredNodes.
end(); ++
iter) {
275 iter->invalidateGlyphs(invalidatedGlyphs);
284 m_pendingGlyphs.
add(glyphs.
at(
i));
289 int count = m_textures.size();
294 tex.
size = newTexSize;
306 switch (
child->type()) {
377#ifndef QT_NO_DEBUG_STREAM
385 debug <<
"cvar" <<
"offset" <<
v.offset <<
"size" <<
v.size;
388 debug <<
"sampler" <<
"bindpoint" <<
v.bindPoint;
391 debug <<
"texture" <<
"bindpoint" <<
v.bindPoint;
419#if QT_CONFIG(quick_sprite)
421QSGSpriteNode::~QSGSpriteNode()
440#include "moc_qsgadaptationlayer_p.cpp"
qint64 elapsed() const noexcept
Returns the number of milliseconds since this QElapsedTimer was last started.
void start() noexcept
Starts this timer.
qint64 nsecsElapsed() const noexcept
virtual int glyphCount() const
void setPixelSize(int)
Sets the font size to pixelSize pixels, with a maxiumum size of an unsigned 16-bit integer.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the list.
iterator begin()
Returns an STL-style interator pointing to the first item in the list.
qsizetype size() const noexcept
bool isEmpty() const noexcept
const_reference at(qsizetype i) const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
QRectF boundingRect() const
Returns the bounding rectangle of this painter path as a rectangle with floating point precision.
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
static QRawFontPrivate * get(const QRawFont &font)
The QRawFont class provides access to a single physical instance of a font.
QString familyName() const
Returns the family name of this QRawFont.
QPainterPath pathForGlyph(quint32 glyphIndex) const
This function returns the shape of the glyph at a given glyphIndex in the underlying font if the QRaw...
constexpr bool isEmpty() const noexcept
Returns true if the rectangle is empty, otherwise returns false.
constexpr qreal y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr qreal x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
The QSGClipNode class implements the clipping functionality in the scene graph.
virtual void registerOwnerElement(QQuickItem *ownerElement)
Metrics glyphMetrics(glyph_t glyph, qreal pixelSize)
qreal fontScale(qreal pixelSize) const
void markGlyphsToRender(const QVector< glyph_t > &glyphs)
GlyphData & emptyData(glyph_t glyph)
void setGlyphsTexture(const QVector< glyph_t > &glyphs, const Texture &tex)
void populate(const QVector< glyph_t > &glyphs)
virtual bool isActive() const
void setGlyphsPosition(const QList< GlyphPosition > &glyphs)
virtual void releaseGlyphs(const QSet< glyph_t > &glyphs)=0
void release(const QVector< glyph_t > &glyphs)
virtual void unregisterOwnerElement(QQuickItem *ownerElement)
virtual void storeGlyphs(const QList< QDistanceField > &glyphs)=0
bool m_doubleGlyphResolution
void updateRhiTexture(QRhiTexture *oldTex, QRhiTexture *newTex, const QSize &newTexSize)
GlyphData & glyphData(glyph_t glyph)
virtual ~QSGDistanceFieldGlyphCache()
virtual void referenceGlyphs(const QSet< glyph_t > &glyphs)=0
virtual void processPendingGlyphs()
virtual void requestGlyphs(const QSet< glyph_t > &glyphs)=0
virtual ~QSGDistanceFieldGlyphConsumer()
The QSGDynamicTexture class serves as a baseclass for dynamically changing textures,...
The QSGGeometryNode class is used for all rendered content in the scene graph.
~QSGGuiThreadShaderEffectManager() override
~QSGInternalImageNode() override
~QSGInternalRectangleNode() override
QSGLayer(QSGTexturePrivate &dd)
virtual ~QSGNodeVisitorEx()
virtual void endVisit(QSGTransformNode *)=0
void visitChildren(QSGNode *node)
virtual bool visit(QSGTransformNode *)=0
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
QSGNode * firstChild() const
Returns the first child of this node.
The QSGOpacityNode class is used to change opacity of nodes.
~QSGPainterNode() override
The QSGRenderNode class represents a set of custom rendering commands targeting the graphics API that...
The QSGRootNode is the toplevel root of any scene graph.
~QSGShaderEffectNode() override
~QSGVisitableNode() override
virtual void accept(QSGNodeVisitorEx *)=0
bool contains(const T &value) const
iterator insert(const T &value)
QSet< QString >::iterator it
Combined button and popup list for selecting options.
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter * iter
int QT_DISTANCEFIELD_HIGHGLYPHCOUNT()
bool qt_fontHasNarrowOutlines(QFontEngine *fontEngine)
int QT_DISTANCEFIELD_RADIUS(bool narrowOutlineFont)
int QT_DISTANCEFIELD_SCALE(bool narrowOutlineFont)
int QT_DISTANCEFIELD_BASEFONTSIZE(bool narrowOutlineFont)
#define qCDebug(category,...)
GLsizei const GLfloat * v
[13]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLenum GLenum GLenum scale
#define Q_QUICK_SG_PROFILE_RECORD(Type, position)
#define Q_QUICK_SG_PROFILE_END_WITH_PAYLOAD(Type, position, Payload)
#define Q_QUICK_SG_PROFILE_START(Type)
QDebug operator<<(QDebug debug, const QSGGuiThreadShaderEffectManager::ShaderInfo::Variable &v)
static QT_BEGIN_NAMESPACE QElapsedTimer qsg_render_timer
#define Q_TRACE_SCOPE(x,...)
#define Q_TRACE_POINT(provider, tracepoint,...)
unsigned long long quint64