qimagepixmapcleanuphooks.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/image/qimagepixmapcleanuphooks.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5namespace { 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
guard.load() =...c::InitializedDescription
TRUEnever evaluated
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
never executed: guard.store(QtGlobalStatic::Destroyed);
}
never executed: end of block
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
never executed: return &holder.value;
&holder.value;
never executed: return &holder.value;
} } } 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;
0
6-
7QImagePixmapCleanupHooks *QImagePixmapCleanupHooks::instance()-
8{-
9 return
never executed: return qt_image_and_pixmap_cleanup_hooks();
qt_image_and_pixmap_cleanup_hooks();
never executed: return qt_image_and_pixmap_cleanup_hooks();
0
10}-
11-
12void QImagePixmapCleanupHooks::addPlatformPixmapModificationHook(_qt_pixmap_cleanup_hook_pmd hook)-
13{-
14 pixmapModificationHooks.append(hook);-
15}
never executed: end of block
0
16-
17void QImagePixmapCleanupHooks::addPlatformPixmapDestructionHook(_qt_pixmap_cleanup_hook_pmd hook)-
18{-
19 pixmapDestructionHooks.append(hook);-
20}
never executed: end of block
0
21-
22-
23void QImagePixmapCleanupHooks::addImageHook(_qt_image_cleanup_hook_64 hook)-
24{-
25 imageHooks.append(hook);-
26}
never executed: end of block
0
27-
28void QImagePixmapCleanupHooks::removePlatformPixmapModificationHook(_qt_pixmap_cleanup_hook_pmd hook)-
29{-
30 pixmapModificationHooks.removeAll(hook);-
31}
never executed: end of block
0
32-
33void QImagePixmapCleanupHooks::removePlatformPixmapDestructionHook(_qt_pixmap_cleanup_hook_pmd hook)-
34{-
35 pixmapDestructionHooks.removeAll(hook);-
36}
never executed: end of block
0
37-
38void QImagePixmapCleanupHooks::removeImageHook(_qt_image_cleanup_hook_64 hook)-
39{-
40 imageHooks.removeAll(hook);-
41}
never executed: end of block
0
42-
43void QImagePixmapCleanupHooks::executePlatformPixmapModificationHooks(QPlatformPixmap* pmd)-
44{-
45 const QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks();-
46-
47-
48-
49 if (!h
!hDescription
TRUEnever evaluated
FALSEnever evaluated
)
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-
55void QImagePixmapCleanupHooks::executePlatformPixmapDestructionHooks(QPlatformPixmap* pmd)-
56{-
57 const QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks();-
58-
59-
60-
61 if (!h
!hDescription
TRUEnever evaluated
FALSEnever evaluated
)
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-
67void QImagePixmapCleanupHooks::executeImageHooks(qint64 key)-
68{-
69 const QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks();-
70-
71-
72-
73 if (!h
!hDescription
TRUEnever evaluated
FALSEnever evaluated
)
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-
80void QImagePixmapCleanupHooks::enableCleanupHooks(QPlatformPixmap *handle)-
81{-
82 handle->is_cached = true;-
83}
never executed: end of block
0
84-
85void QImagePixmapCleanupHooks::enableCleanupHooks(const QPixmap &pixmap)-
86{-
87 enableCleanupHooks(const_cast<QPixmap &>(pixmap).data_ptr().data());-
88}
never executed: end of block
0
89-
90void QImagePixmapCleanupHooks::enableCleanupHooks(const QImage &image)-
91{-
92 const_cast<QImage &>(image).data_ptr()->is_cached = true;-
93}
never executed: end of block
0
94-
95bool QImagePixmapCleanupHooks::isImageCached(const QImage &image)-
96{-
97 return
never executed: return const_cast<QImage &>(image).data_ptr()->is_cached;
const_cast<QImage &>(image).data_ptr()->is_cached;
never executed: return const_cast<QImage &>(image).data_ptr()->is_cached;
0
98}-
99-
100bool QImagePixmapCleanupHooks::isPixmapCached(const QPixmap &pixmap)-
101{-
102 return
never executed: return const_cast<QPixmap&>(pixmap).data_ptr().data()->is_cached;
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 codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9