Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/image/qimagepixmapcleanuphooks.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | namespace { namespace Q_QGS_qt_image_and_pixmap_cleanup_hooks { typedef QImagePixmapCleanupHooks Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
never executed: }guard.store(QtGlobalStatic::Destroyed); never executed: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of block never executed: &holder.value;return &holder.value; never executed: } } } static QGlobalStatic<QImagePixmapCleanupHooks, Q_QGS_qt_image_and_pixmap_cleanup_hooks::innerFunction, Q_QGS_qt_image_and_pixmap_cleanup_hooks::guard> qt_image_and_pixmap_cleanup_hooks;return &holder.value; | 0 | ||||||
6 | - | |||||||
7 | QImagePixmapCleanupHooks *QImagePixmapCleanupHooks::instance() | - | ||||||
8 | { | - | ||||||
9 | return never executed: qt_image_and_pixmap_cleanup_hooks();return qt_image_and_pixmap_cleanup_hooks(); never executed: return qt_image_and_pixmap_cleanup_hooks(); | 0 | ||||||
10 | } | - | ||||||
11 | - | |||||||
12 | void QImagePixmapCleanupHooks::addPlatformPixmapModificationHook(_qt_pixmap_cleanup_hook_pmd hook) | - | ||||||
13 | { | - | ||||||
14 | pixmapModificationHooks.append(hook); | - | ||||||
15 | } never executed: end of block | 0 | ||||||
16 | - | |||||||
17 | void QImagePixmapCleanupHooks::addPlatformPixmapDestructionHook(_qt_pixmap_cleanup_hook_pmd hook) | - | ||||||
18 | { | - | ||||||
19 | pixmapDestructionHooks.append(hook); | - | ||||||
20 | } never executed: end of block | 0 | ||||||
21 | - | |||||||
22 | - | |||||||
23 | void QImagePixmapCleanupHooks::addImageHook(_qt_image_cleanup_hook_64 hook) | - | ||||||
24 | { | - | ||||||
25 | imageHooks.append(hook); | - | ||||||
26 | } never executed: end of block | 0 | ||||||
27 | - | |||||||
28 | void QImagePixmapCleanupHooks::removePlatformPixmapModificationHook(_qt_pixmap_cleanup_hook_pmd hook) | - | ||||||
29 | { | - | ||||||
30 | pixmapModificationHooks.removeAll(hook); | - | ||||||
31 | } never executed: end of block | 0 | ||||||
32 | - | |||||||
33 | void QImagePixmapCleanupHooks::removePlatformPixmapDestructionHook(_qt_pixmap_cleanup_hook_pmd hook) | - | ||||||
34 | { | - | ||||||
35 | pixmapDestructionHooks.removeAll(hook); | - | ||||||
36 | } never executed: end of block | 0 | ||||||
37 | - | |||||||
38 | void QImagePixmapCleanupHooks::removeImageHook(_qt_image_cleanup_hook_64 hook) | - | ||||||
39 | { | - | ||||||
40 | imageHooks.removeAll(hook); | - | ||||||
41 | } never executed: end of block | 0 | ||||||
42 | - | |||||||
43 | void QImagePixmapCleanupHooks::executePlatformPixmapModificationHooks(QPlatformPixmap* pmd) | - | ||||||
44 | { | - | ||||||
45 | const QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks(); | - | ||||||
46 | - | |||||||
47 | - | |||||||
48 | - | |||||||
49 | if (!h
| 0 | ||||||
50 | return; never executed: return; | 0 | ||||||
51 | for (auto hook : h->pixmapModificationHooks) | - | ||||||
52 | hook(pmd); never executed: hook(pmd); | 0 | ||||||
53 | } never executed: end of block | 0 | ||||||
54 | - | |||||||
55 | void QImagePixmapCleanupHooks::executePlatformPixmapDestructionHooks(QPlatformPixmap* pmd) | - | ||||||
56 | { | - | ||||||
57 | const QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks(); | - | ||||||
58 | - | |||||||
59 | - | |||||||
60 | - | |||||||
61 | if (!h
| 0 | ||||||
62 | return; never executed: return; | 0 | ||||||
63 | for (auto hook : h->pixmapDestructionHooks) | - | ||||||
64 | hook(pmd); never executed: hook(pmd); | 0 | ||||||
65 | } never executed: end of block | 0 | ||||||
66 | - | |||||||
67 | void QImagePixmapCleanupHooks::executeImageHooks(qint64 key) | - | ||||||
68 | { | - | ||||||
69 | const QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks(); | - | ||||||
70 | - | |||||||
71 | - | |||||||
72 | - | |||||||
73 | if (!h
| 0 | ||||||
74 | return; never executed: return; | 0 | ||||||
75 | for (auto hook : h->imageHooks) | - | ||||||
76 | hook(key); never executed: hook(key); | 0 | ||||||
77 | } never executed: end of block | 0 | ||||||
78 | - | |||||||
79 | - | |||||||
80 | void QImagePixmapCleanupHooks::enableCleanupHooks(QPlatformPixmap *handle) | - | ||||||
81 | { | - | ||||||
82 | handle->is_cached = true; | - | ||||||
83 | } never executed: end of block | 0 | ||||||
84 | - | |||||||
85 | void QImagePixmapCleanupHooks::enableCleanupHooks(const QPixmap &pixmap) | - | ||||||
86 | { | - | ||||||
87 | enableCleanupHooks(const_cast<QPixmap &>(pixmap).data_ptr().data()); | - | ||||||
88 | } never executed: end of block | 0 | ||||||
89 | - | |||||||
90 | void QImagePixmapCleanupHooks::enableCleanupHooks(const QImage &image) | - | ||||||
91 | { | - | ||||||
92 | const_cast<QImage &>(image).data_ptr()->is_cached = true; | - | ||||||
93 | } never executed: end of block | 0 | ||||||
94 | - | |||||||
95 | bool QImagePixmapCleanupHooks::isImageCached(const QImage &image) | - | ||||||
96 | { | - | ||||||
97 | return never executed: const_cast<QImage &>(image).data_ptr()->is_cached;return const_cast<QImage &>(image).data_ptr()->is_cached; never executed: return const_cast<QImage &>(image).data_ptr()->is_cached; | 0 | ||||||
98 | } | - | ||||||
99 | - | |||||||
100 | bool QImagePixmapCleanupHooks::isPixmapCached(const QPixmap &pixmap) | - | ||||||
101 | { | - | ||||||
102 | return never executed: const_cast<QPixmap&>(pixmap).data_ptr().data()->is_cached;return const_cast<QPixmap&>(pixmap).data_ptr().data()->is_cached; never executed: return const_cast<QPixmap&>(pixmap).data_ptr().data()->is_cached; | 0 | ||||||
103 | } | - | ||||||
104 | - | |||||||
105 | - | |||||||
106 | - | |||||||
107 | - | |||||||
Switch to Source code | Preprocessed file |