OpenCoverage

qsgatlastexture_p.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/scenegraph/util/qsgatlastexture_p.h
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6namespace QSGCompressedAtlasTexture {-
7 class Atlas;-
8}-
9class QSGCompressedTextureFactory;-
10-
11namespace QSGAtlasTexture-
12{-
13-
14class Texture;-
15class TextureBase;-
16class Atlas;-
17-
18class Manager : public QObject-
19{-
20 public:-
21#pragma GCC diagnostic push-
22 -
23#pragma GCC diagnostic ignored "-Wsuggest-override"-
24 static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private:-
25#pragma GCC diagnostic ignored "-Wattributes"-
26 __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);-
27#pragma GCC diagnostic pop-
28 struct QPrivateSignal {};-
29-
30public:-
31 Manager();-
32 ~Manager();-
33-
34 QSGTexture *create(const QImage &image, bool hasAlphaChannel);-
35 QSGTexture *create(const QSGCompressedTextureFactory *factory);-
36 void invalidate();-
37-
38private:-
39 Atlas *m_atlas;-
40-
41 QHash<unsigned int, QSGCompressedAtlasTexture::Atlas*> m_atlases;-
42-
43 QSize m_atlas_size;-
44 int m_atlas_size_limit;-
45};-
46-
47class AtlasBase : public QObject-
48{-
49 public:-
50#pragma GCC diagnostic push-
51 -
52#pragma GCC diagnostic ignored "-Wsuggest-override"-
53 static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private:-
54#pragma GCC diagnostic ignored "-Wattributes"-
55 __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);-
56#pragma GCC diagnostic pop-
57 struct QPrivateSignal {};-
58public:-
59 AtlasBase(const QSize &size);-
60 ~AtlasBase();-
61-
62 void invalidate();-
63-
64 int textureId() const;-
65 void bind(QSGTexture::Filtering filtering);-
66-
67 void remove(TextureBase *t);-
68-
69 QSize size() const { return
executed 578 times by 8 tests: return m_size;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
m_size;
executed 578 times by 8 tests: return m_size;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
}
578
70-
71protected:-
72 virtual void generateTexture() = 0;-
73 virtual void uploadPendingTexture(int i) = 0;-
74-
75protected:-
76 QSGAreaAllocator m_allocator;-
77 unsigned int m_texture_id;-
78 QSize m_size;-
79 QList<TextureBase *> m_pending_uploads;-
80-
81private:-
82 bool m_allocated;-
83};-
84-
85class Atlas : public AtlasBase-
86{-
87public:-
88 Atlas(const QSize &size);-
89 ~Atlas();-
90-
91 void generateTexture() override;-
92 void uploadPendingTexture(int i) override;-
93-
94 void upload(Texture *texture);-
95 void uploadBgra(Texture *texture);-
96-
97 Texture *create(const QImage &image);-
98-
99 uint internalFormat() const { return
executed 2 times by 1 test: return m_internalFormat;
Executed by:
  • tst_qquickborderimage
m_internalFormat;
executed 2 times by 1 test: return m_internalFormat;
Executed by:
  • tst_qquickborderimage
}
2
100 uint externalFormat() const { return
never executed: return m_externalFormat;
m_externalFormat;
never executed: return m_externalFormat;
}
0
101-
102private:-
103 uint m_internalFormat;-
104 uint m_externalFormat;-
105-
106 int m_atlas_transient_image_threshold;-
107-
108 uint m_use_bgra_fallback: 1;-
109 uint m_debug_overlay : 1;-
110};-
111-
112class TextureBase : public QSGTexture-
113{-
114 public:-
115#pragma GCC diagnostic push-
116 -
117#pragma GCC diagnostic ignored "-Wsuggest-override"-
118 static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private:-
119#pragma GCC diagnostic ignored "-Wattributes"-
120 __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);-
121#pragma GCC diagnostic pop-
122 struct QPrivateSignal {};-
123public:-
124 TextureBase(AtlasBase *atlas, const QRect &textureRect);-
125 ~TextureBase();-
126-
127 int textureId() const override { return
executed 86734 times by 3 tests: return m_atlas->textureId();
Executed by:
  • tst_examples
  • tst_qquickitemparticle
  • tst_scenegraph
m_atlas->textureId();
executed 86734 times by 3 tests: return m_atlas->textureId();
Executed by:
  • tst_examples
  • tst_qquickitemparticle
  • tst_scenegraph
}
86734
128 bool isAtlasTexture() const override { return
executed 23730 times by 8 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
true;
executed 23730 times by 8 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
}
23730
129-
130 QRect atlasSubRect() const { return
executed 289 times by 8 tests: return m_allocated_rect;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
m_allocated_rect;
executed 289 times by 8 tests: return m_allocated_rect;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
}
289
131-
132 void bind() override;-
133-
134protected:-
135 QRect m_allocated_rect;-
136 AtlasBase *m_atlas;-
137};-
138-
139class Texture : public TextureBase-
140{-
141 public:-
142#pragma GCC diagnostic push-
143 -
144#pragma GCC diagnostic ignored "-Wsuggest-override"-
145 static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private:-
146#pragma GCC diagnostic ignored "-Wattributes"-
147 __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);-
148#pragma GCC diagnostic pop-
149 struct QPrivateSignal {};-
150public:-
151 Texture(Atlas *atlas, const QRect &textureRect, const QImage &image);-
152 ~Texture();-
153-
154 QSize textureSize() const override { return
executed 263 times by 8 tests: return atlasSubRectWithoutPadding().size();
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
atlasSubRectWithoutPadding().size();
executed 263 times by 8 tests: return atlasSubRectWithoutPadding().size();
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
}
263
155 void setHasAlphaChannel(bool alpha) { m_has_alpha = alpha; }
never executed: end of block
0
156 bool hasAlphaChannel() const override { return
executed 14979 times by 8 tests: return m_has_alpha;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
m_has_alpha;
executed 14979 times by 8 tests: return m_has_alpha;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
}
14979
157 bool hasMipmaps() const override { return
executed 18789 times by 3 tests: return false;
Executed by:
  • tst_examples
  • tst_qquickitemparticle
  • tst_scenegraph
false;
executed 18789 times by 3 tests: return false;
Executed by:
  • tst_examples
  • tst_qquickitemparticle
  • tst_scenegraph
}
18789
158-
159 QRectF normalizedTextureSubRect() const override { return
executed 4999 times by 8 tests: return m_texture_coords_rect;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
m_texture_coords_rect;
executed 4999 times by 8 tests: return m_texture_coords_rect;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
}
4999
160-
161 QRect atlasSubRect() const { return
executed 263 times by 8 tests: return m_allocated_rect;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
m_allocated_rect;
executed 263 times by 8 tests: return m_allocated_rect;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
}
263
162 QRect atlasSubRectWithoutPadding() const { return
executed 554 times by 8 tests: return m_allocated_rect.adjusted(1, 1, -1, -1);
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
m_allocated_rect.adjusted(1, 1, -1, -1);
executed 554 times by 8 tests: return m_allocated_rect.adjusted(1, 1, -1, -1);
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
}
554
163-
164 QSGTexture *removedFromAtlas() const override;-
165-
166 void releaseImage() { m_image = QImage(); }
executed 263 times by 8 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
263
167 const QImage &image() const { return
executed 263 times by 8 tests: return m_image;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
m_image;
executed 263 times by 8 tests: return m_image;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickimage
  • tst_qquickitemparticle
  • tst_qquickshadereffect
  • tst_scenegraph
}
263
168-
169private:-
170 QRectF m_texture_coords_rect;-
171 QImage m_image;-
172 mutable QSGPlainTexture *m_nonatlas_texture;-
173 bool m_has_alpha;-
174};-
175-
176}-
177-
178-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0