| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | class QOpenGLSharedResourceGuard; | - | ||||||
| 5 | - | |||||||
| 6 | class QOpenGLFunctions_3_2_Core; | - | ||||||
| 7 | - | |||||||
| 8 | - | |||||||
| 9 | class __attribute__((visibility("default"))) QSGDefaultDistanceFieldGlyphCache : public QSGDistanceFieldGlyphCache | - | ||||||
| 10 | { | - | ||||||
| 11 | public: | - | ||||||
| 12 | QSGDefaultDistanceFieldGlyphCache(QOpenGLContext *c, const QRawFont &font); | - | ||||||
| 13 | virtual ~QSGDefaultDistanceFieldGlyphCache(); | - | ||||||
| 14 | - | |||||||
| 15 | void requestGlyphs(const QSet<glyph_t> &glyphs) override; | - | ||||||
| 16 | void storeGlyphs(const QList<QDistanceField> &glyphs) override; | - | ||||||
| 17 | void referenceGlyphs(const QSet<glyph_t> &glyphs) override; | - | ||||||
| 18 | void releaseGlyphs(const QSet<glyph_t> &glyphs) override; | - | ||||||
| 19 | - | |||||||
| 20 | bool useTextureResizeWorkaround() const; | - | ||||||
| 21 | bool useTextureUploadWorkaround() const; | - | ||||||
| 22 | bool createFullSizeTextures() const; | - | ||||||
| 23 | int maxTextureSize() const; | - | ||||||
| 24 | - | |||||||
| 25 | void setMaxTextureCount(int max) { m_maxTextureCount = max; } never executed: end of block | 0 | ||||||
| 26 | int maxTextureCount() const { return never executed: m_maxTextureCount;return m_maxTextureCount;never executed: }return m_maxTextureCount; | 0 | ||||||
| 27 | - | |||||||
| 28 | private: | - | ||||||
| 29 | struct TextureInfo { | - | ||||||
| 30 | GLuint texture; | - | ||||||
| 31 | QSize size; | - | ||||||
| 32 | QRect allocatedArea; | - | ||||||
| 33 | QDistanceField image; | - | ||||||
| 34 | int padding = -1; | - | ||||||
| 35 | - | |||||||
| 36 | TextureInfo(const QRect &preallocRect = QRect()) : texture(0), allocatedArea(preallocRect) { } executed 1620 times by 24 tests: end of blockExecuted by:
| 1620 | ||||||
| 37 | }; | - | ||||||
| 38 | - | |||||||
| 39 | void createTexture(TextureInfo * texInfo, int width, int height); | - | ||||||
| 40 | void resizeTexture(TextureInfo * texInfo, int width, int height); | - | ||||||
| 41 | - | |||||||
| 42 | TextureInfo *textureInfo(int index) | - | ||||||
| 43 | { | - | ||||||
| 44 | for (int i = m_textures.count(); i <= index
| 1620-28812 | ||||||
| 45 | if (createFullSizeTextures()
| 0-1620 | ||||||
| 46 | m_textures.append(QRect(0, 0, maxTextureSize(), maxTextureSize())); never executed: m_textures.append(QRect(0, 0, maxTextureSize(), maxTextureSize())); | 0 | ||||||
| 47 | else | - | ||||||
| 48 | m_textures.append(TextureInfo()); executed 1620 times by 24 tests: m_textures.append(TextureInfo());Executed by:
| 1620 | ||||||
| 49 | } | - | ||||||
| 50 | - | |||||||
| 51 | return executed 28812 times by 24 tests: &m_textures[index];return &m_textures[index];Executed by:
executed 28812 times by 24 tests: return &m_textures[index];Executed by:
| 28812 | ||||||
| 52 | } | - | ||||||
| 53 | - | |||||||
| 54 | void createBlitProgram() | - | ||||||
| 55 | { | - | ||||||
| 56 | m_blitProgram = new QOpenGLShaderProgram; | - | ||||||
| 57 | { | - | ||||||
| 58 | const QString source = QLatin1String(qopenglslMainWithTexCoordsVertexShader) | - | ||||||
| 59 | + QLatin1String(qopenglslUntransformedPositionVertexShader); | - | ||||||
| 60 | - | |||||||
| 61 | m_blitProgram->addCacheableShaderFromSourceCode(QOpenGLShader::Vertex, source); | - | ||||||
| 62 | } | - | ||||||
| 63 | { | - | ||||||
| 64 | const QString source = QLatin1String(qopenglslMainFragmentShader) | - | ||||||
| 65 | + QLatin1String(qopenglslImageSrcFragmentShader); | - | ||||||
| 66 | - | |||||||
| 67 | m_blitProgram->addCacheableShaderFromSourceCode(QOpenGLShader::Fragment, source); | - | ||||||
| 68 | } | - | ||||||
| 69 | m_blitProgram->bindAttributeLocation("vertexCoordsArray", QT_VERTEX_COORDS_ATTR); | - | ||||||
| 70 | m_blitProgram->bindAttributeLocation("textureCoordArray", QT_TEXTURE_COORDS_ATTR); | - | ||||||
| 71 | m_blitProgram->link(); | - | ||||||
| 72 | } executed 453 times by 11 tests: end of blockExecuted by:
| 453 | ||||||
| 73 | - | |||||||
| 74 | mutable int m_maxTextureSize; | - | ||||||
| 75 | int m_maxTextureCount; | - | ||||||
| 76 | - | |||||||
| 77 | QList<TextureInfo> m_textures; | - | ||||||
| 78 | QHash<glyph_t, TextureInfo *> m_glyphsTexture; | - | ||||||
| 79 | QSet<glyph_t> m_unusedGlyphs; | - | ||||||
| 80 | - | |||||||
| 81 | QSGAreaAllocator *m_areaAllocator; | - | ||||||
| 82 | - | |||||||
| 83 | QOpenGLShaderProgram *m_blitProgram; | - | ||||||
| 84 | QOpenGLBuffer m_blitBuffer; | - | ||||||
| 85 | QOpenGLVertexArrayObject m_vao; | - | ||||||
| 86 | - | |||||||
| 87 | QOpenGLSharedResourceGuard *m_fboGuard; | - | ||||||
| 88 | QOpenGLFunctions *m_funcs; | - | ||||||
| 89 | - | |||||||
| 90 | QOpenGLFunctions_3_2_Core *m_coreFuncs; | - | ||||||
| 91 | - | |||||||
| 92 | }; | - | ||||||
| 93 | - | |||||||
| 94 | - | |||||||
| Switch to Source code | Preprocessed file |