| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/scenegraph/util/qsgatlastexture_p.h |
| Switch to Source code | Preprocessed file |
| Line | Source | Count |
|---|---|---|
| 1 | - | |
| 2 | - | |
| 3 | - | |
| 4 | - | |
| 5 | - | |
| 6 | namespace QSGCompressedAtlasTexture { | - |
| 7 | class Atlas; | - |
| 8 | } | - |
| 9 | class QSGCompressedTextureFactory; | - |
| 10 | - | |
| 11 | namespace QSGAtlasTexture | - |
| 12 | { | - |
| 13 | - | |
| 14 | class Texture; | - |
| 15 | class TextureBase; | - |
| 16 | class Atlas; | - |
| 17 | - | |
| 18 | class 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 | - | |
| 30 | public: | - |
| 31 | Manager(); | - |
| 32 | ~Manager(); | - |
| 33 | - | |
| 34 | QSGTexture *create(const QImage &image, bool hasAlphaChannel); | - |
| 35 | QSGTexture *create(const QSGCompressedTextureFactory *factory); | - |
| 36 | void invalidate(); | - |
| 37 | - | |
| 38 | private: | - |
| 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 | - | |
| 47 | class 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 {}; | - |
| 58 | public: | - |
| 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: m_size;return m_size;Executed by:
executed 578 times by 8 tests: }return m_size;Executed by:
| 578 |
| 70 | - | |
| 71 | protected: | - |
| 72 | virtual void generateTexture() = 0; | - |
| 73 | virtual void uploadPendingTexture(int i) = 0; | - |
| 74 | - | |
| 75 | protected: | - |
| 76 | QSGAreaAllocator m_allocator; | - |
| 77 | unsigned int m_texture_id; | - |
| 78 | QSize m_size; | - |
| 79 | QList<TextureBase *> m_pending_uploads; | - |
| 80 | - | |
| 81 | private: | - |
| 82 | bool m_allocated; | - |
| 83 | }; | - |
| 84 | - | |
| 85 | class Atlas : public AtlasBase | - |
| 86 | { | - |
| 87 | public: | - |
| 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: m_internalFormat;return m_internalFormat;Executed by:
executed 2 times by 1 test: }return m_internalFormat;Executed by:
| 2 |
| 100 | uint externalFormat() const { return never executed: m_externalFormat;return m_externalFormat;never executed: }return m_externalFormat; | 0 |
| 101 | - | |
| 102 | private: | - |
| 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 | - | |
| 112 | class 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 {}; | - |
| 123 | public: | - |
| 124 | TextureBase(AtlasBase *atlas, const QRect &textureRect); | - |
| 125 | ~TextureBase(); | - |
| 126 | - | |
| 127 | int textureId() const override { return executed 86734 times by 3 tests: m_atlas->textureId();return m_atlas->textureId();Executed by:
executed 86734 times by 3 tests: }return m_atlas->textureId();Executed by:
| 86734 |
| 128 | bool isAtlasTexture() const override { return executed 23730 times by 8 tests: true;return true;Executed by:
executed 23730 times by 8 tests: }return true;Executed by:
| 23730 |
| 129 | - | |
| 130 | QRect atlasSubRect() const { return executed 289 times by 8 tests: m_allocated_rect;return m_allocated_rect;Executed by:
executed 289 times by 8 tests: }return m_allocated_rect;Executed by:
| 289 |
| 131 | - | |
| 132 | void bind() override; | - |
| 133 | - | |
| 134 | protected: | - |
| 135 | QRect m_allocated_rect; | - |
| 136 | AtlasBase *m_atlas; | - |
| 137 | }; | - |
| 138 | - | |
| 139 | class 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 {}; | - |
| 150 | public: | - |
| 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: atlasSubRectWithoutPadding().size();return atlasSubRectWithoutPadding().size();Executed by:
executed 263 times by 8 tests: }return atlasSubRectWithoutPadding().size();Executed by:
| 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: m_has_alpha;return m_has_alpha;Executed by:
executed 14979 times by 8 tests: }return m_has_alpha;Executed by:
| 14979 |
| 157 | bool hasMipmaps() const override { return executed 18789 times by 3 tests: false;return false;Executed by:
executed 18789 times by 3 tests: }return false;Executed by:
| 18789 |
| 158 | - | |
| 159 | QRectF normalizedTextureSubRect() const override { return executed 4999 times by 8 tests: m_texture_coords_rect;return m_texture_coords_rect;Executed by:
executed 4999 times by 8 tests: }return m_texture_coords_rect;Executed by:
| 4999 |
| 160 | - | |
| 161 | QRect atlasSubRect() const { return executed 263 times by 8 tests: m_allocated_rect;return m_allocated_rect;Executed by:
executed 263 times by 8 tests: }return m_allocated_rect;Executed by:
| 263 |
| 162 | QRect atlasSubRectWithoutPadding() const { return executed 554 times by 8 tests: m_allocated_rect.adjusted(1, 1, -1, -1);return m_allocated_rect.adjusted(1, 1, -1, -1);Executed by:
executed 554 times by 8 tests: }return m_allocated_rect.adjusted(1, 1, -1, -1);Executed by:
| 554 |
| 163 | - | |
| 164 | QSGTexture *removedFromAtlas() const override; | - |
| 165 | - | |
| 166 | void releaseImage() { m_image = QImage(); } executed 263 times by 8 tests: end of blockExecuted by:
| 263 |
| 167 | const QImage &image() const { return executed 263 times by 8 tests: m_image;return m_image;Executed by:
executed 263 times by 8 tests: }return m_image;Executed by:
| 263 |
| 168 | - | |
| 169 | private: | - |
| 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 code | Preprocessed file |