| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/scenegraph/qsgdefaultglyphnode_p_p.h |
| Source code | Switch to Preprocessed file |
| Line | Source | Count |
|---|---|---|
| 1 | /**************************************************************************** | - |
| 2 | ** | - |
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. | - |
| 4 | ** Contact: https://www.qt.io/licensing/ | - |
| 5 | ** | - |
| 6 | ** This file is part of the QtQuick module of the Qt Toolkit. | - |
| 7 | ** | - |
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ | - |
| 9 | ** Commercial License Usage | - |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | - |
| 11 | ** accordance with the commercial license agreement provided with the | - |
| 12 | ** Software or, alternatively, in accordance with the terms contained in | - |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | - |
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further | - |
| 15 | ** information use the contact form at https://www.qt.io/contact-us. | - |
| 16 | ** | - |
| 17 | ** GNU Lesser General Public License Usage | - |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - |
| 19 | ** General Public License version 3 as published by the Free Software | - |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | - |
| 21 | ** packaging of this file. Please review the following information to | - |
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements | - |
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | - |
| 24 | ** | - |
| 25 | ** GNU General Public License Usage | - |
| 26 | ** Alternatively, this file may be used under the terms of the GNU | - |
| 27 | ** General Public License version 2.0 or (at your option) the GNU General | - |
| 28 | ** Public license version 3 or any later version approved by the KDE Free | - |
| 29 | ** Qt Foundation. The licenses are as published by the Free Software | - |
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | - |
| 31 | ** included in the packaging of this file. Please review the following | - |
| 32 | ** information to ensure the GNU General Public License requirements will | - |
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | - |
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | - |
| 35 | ** | - |
| 36 | ** $QT_END_LICENSE$ | - |
| 37 | ** | - |
| 38 | ****************************************************************************/ | - |
| 39 | - | |
| 40 | #ifndef QSGDEFAULTGLYPHNODE_P_P_H | - |
| 41 | #define QSGDEFAULTGLYPHNODE_P_P_H | - |
| 42 | - | |
| 43 | // | - |
| 44 | // W A R N I N G | - |
| 45 | // ------------- | - |
| 46 | // | - |
| 47 | // This file is not part of the Qt API. It exists purely as an | - |
| 48 | // implementation detail. This header file may change from version to | - |
| 49 | // version without notice, or even be removed. | - |
| 50 | // | - |
| 51 | // We mean it. | - |
| 52 | // | - |
| 53 | - | |
| 54 | #include <qcolor.h> | - |
| 55 | #include <QtGui/private/qopengltextureglyphcache_p.h> | - |
| 56 | #include <QtQuick/qsgmaterial.h> | - |
| 57 | #include <QtQuick/qsgtexture.h> | - |
| 58 | #include <QtQuick/qsggeometry.h> | - |
| 59 | #include <qshareddata.h> | - |
| 60 | #include <QtQuick/private/qsgtexture_p.h> | - |
| 61 | #include <qrawfont.h> | - |
| 62 | #include <qmargins.h> | - |
| 63 | - | |
| 64 | QT_BEGIN_NAMESPACE | - |
| 65 | - | |
| 66 | class QFontEngine; | - |
| 67 | class Geometry; | - |
| 68 | class QSGTextMaskMaterial: public QSGMaterial | - |
| 69 | { | - |
| 70 | public: | - |
| 71 | QSGTextMaskMaterial(const QRawFont &font, QFontEngine::GlyphFormat glyphFormat = QFontEngine::Format_None); | - |
| 72 | virtual ~QSGTextMaskMaterial(); | - |
| 73 | - | |
| 74 | QSGMaterialType *type() const override; | - |
| 75 | QSGMaterialShader *createShader() const override; | - |
| 76 | int compare(const QSGMaterial *other) const override; | - |
| 77 | - | |
| 78 | void setColor(const QColor &c) { m_color = QVector4D(c.redF(), c.greenF(), c.blueF(), c.alphaF()); } executed 72 times by 1 test: end of blockExecuted by:
| 72 |
| 79 | void setColor(const QVector4D &color) { m_color = color; } never executed: end of block | 0 |
| 80 | const QVector4D &color() const { return m_color; } executed 216 times by 1 test: return m_color;Executed by:
| 216 |
| 81 | - | |
| 82 | QSGTexture *texture() const { return m_texture; } executed 432 times by 1 test: return m_texture;Executed by:
| 432 |
| 83 | - | |
| 84 | int cacheTextureWidth() const; | - |
| 85 | int cacheTextureHeight() const; | - |
| 86 | - | |
| 87 | bool ensureUpToDate(); | - |
| 88 | - | |
| 89 | QOpenGLTextureGlyphCache *glyphCache() const; | - |
| 90 | void populate(const QPointF &position, | - |
| 91 | const QVector<quint32> &glyphIndexes, const QVector<QPointF> &glyphPositions, | - |
| 92 | QSGGeometry *geometry, QRectF *boundingRect, QPointF *baseLine, | - |
| 93 | const QMargins &margins = QMargins(0, 0, 0, 0)); | - |
| 94 | - | |
| 95 | private: | - |
| 96 | void init(QFontEngine::GlyphFormat glyphFormat); | - |
| 97 | - | |
| 98 | QSGPlainTexture *m_texture; | - |
| 99 | QExplicitlySharedDataPointer<QFontEngineGlyphCache> m_glyphCache; | - |
| 100 | QRawFont m_font; | - |
| 101 | QVector4D m_color; | - |
| 102 | QSize m_size; | - |
| 103 | }; | - |
| 104 | - | |
| 105 | class QSGStyledTextMaterial : public QSGTextMaskMaterial | - |
| 106 | { | - |
| 107 | public: | - |
| 108 | QSGStyledTextMaterial(const QRawFont &font); | - |
| 109 | virtual ~QSGStyledTextMaterial() { } | - |
| 110 | - | |
| 111 | void setStyleShift(const QVector2D &shift) { m_styleShift = shift; } never executed: end of block | 0 |
| 112 | const QVector2D &styleShift() const { return m_styleShift; } never executed: return m_styleShift; | 0 |
| 113 | - | |
| 114 | void setStyleColor(const QColor &c) { m_styleColor = QVector4D(c.redF(), c.greenF(), c.blueF(), c.alphaF()); } never executed: end of block | 0 |
| 115 | void setStyleColor(const QVector4D &color) { m_styleColor = color; } never executed: end of block | 0 |
| 116 | const QVector4D &styleColor() const { return m_styleColor; } never executed: return m_styleColor; | 0 |
| 117 | - | |
| 118 | QSGMaterialType *type() const override; | - |
| 119 | QSGMaterialShader *createShader() const override; | - |
| 120 | - | |
| 121 | int compare(const QSGMaterial *other) const override; | - |
| 122 | - | |
| 123 | private: | - |
| 124 | QVector2D m_styleShift; | - |
| 125 | QVector4D m_styleColor; | - |
| 126 | }; | - |
| 127 | - | |
| 128 | class QSGOutlinedTextMaterial : public QSGStyledTextMaterial | - |
| 129 | { | - |
| 130 | public: | - |
| 131 | QSGOutlinedTextMaterial(const QRawFont &font); | - |
| 132 | ~QSGOutlinedTextMaterial() { } | - |
| 133 | - | |
| 134 | QSGMaterialType *type() const override; | - |
| 135 | QSGMaterialShader *createShader() const override; | - |
| 136 | }; | - |
| 137 | - | |
| 138 | QT_END_NAMESPACE | - |
| 139 | - | |
| 140 | #endif | - |
| Source code | Switch to Preprocessed file |