OpenCoverage

qsgdefaultdistancefieldglyphcache_p.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4class QOpenGLSharedResourceGuard;-
5-
6class QOpenGLFunctions_3_2_Core;-
7-
8-
9class __attribute__((visibility("default"))) QSGDefaultDistanceFieldGlyphCache : public QSGDistanceFieldGlyphCache-
10{-
11public:-
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: return m_maxTextureCount;
m_maxTextureCount;
never executed: return m_maxTextureCount;
}
0
27-
28private:-
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 block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
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
i <= indexDescription
TRUEevaluated 1620 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 28812 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
; ++i) {
1620-28812
45 if (createFullSizeTextures()
createFullSizeTextures()Description
TRUEnever evaluated
FALSEevaluated 1620 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
)
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:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
1620
49 }-
50-
51 return
executed 28812 times by 24 tests: return &m_textures[index];
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
&m_textures[index];
executed 28812 times by 24 tests: return &m_textures[index];
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
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 block
Executed by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickgridview
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
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 codePreprocessed file

Generated by Squish Coco 4.2.0