Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | static QImagePixmapCleanupHooks *qt_image_and_pixmap_cleanup_hooks() { static QGlobalStatic<QImagePixmapCleanupHooks > thisGlobalStatic = { { (0) }, false }; if (!thisGlobalStatic.pointer.load() && !thisGlobalStatic.destroyed) { QImagePixmapCleanupHooks *x = new QImagePixmapCleanupHooks; if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) delete x; else static QGlobalStaticDeleter<QImagePixmapCleanupHooks > cleanup(thisGlobalStatic); } return thisGlobalStatic.pointer.load(); } never executed: delete x; never executed: return thisGlobalStatic.pointer.load(); never evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x) never evaluated: !thisGlobalStatic.pointer.load() never evaluated: !thisGlobalStatic.destroyed | 0 |
6 | | - |
7 | QImagePixmapCleanupHooks *QImagePixmapCleanupHooks::instance() | - |
8 | { | - |
9 | 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 | } | 0 |
16 | | - |
17 | void QImagePixmapCleanupHooks::addPlatformPixmapDestructionHook(_qt_pixmap_cleanup_hook_pmd hook) | - |
18 | { | - |
19 | pixmapDestructionHooks.append(hook); | - |
20 | } | 0 |
21 | | - |
22 | | - |
23 | void QImagePixmapCleanupHooks::addImageHook(_qt_image_cleanup_hook_64 hook) | - |
24 | { | - |
25 | imageHooks.append(hook); | - |
26 | } | 0 |
27 | | - |
28 | void QImagePixmapCleanupHooks::removePlatformPixmapModificationHook(_qt_pixmap_cleanup_hook_pmd hook) | - |
29 | { | - |
30 | pixmapModificationHooks.removeAll(hook); | - |
31 | } | 0 |
32 | | - |
33 | void QImagePixmapCleanupHooks::removePlatformPixmapDestructionHook(_qt_pixmap_cleanup_hook_pmd hook) | - |
34 | { | - |
35 | pixmapDestructionHooks.removeAll(hook); | - |
36 | } | 0 |
37 | | - |
38 | void QImagePixmapCleanupHooks::removeImageHook(_qt_image_cleanup_hook_64 hook) | - |
39 | { | - |
40 | imageHooks.removeAll(hook); | - |
41 | } | 0 |
42 | | - |
43 | void QImagePixmapCleanupHooks::executePlatformPixmapModificationHooks(QPlatformPixmap* pmd) | - |
44 | { | - |
45 | QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks(); | - |
46 | | - |
47 | | - |
48 | | - |
49 | if (!h) | 0 |
50 | return; | 0 |
51 | for (int i = 0; i < h->pixmapModificationHooks.count(); ++i) never evaluated: i < h->pixmapModificationHooks.count() | 0 |
52 | h->pixmapModificationHooks[i](pmd); never executed: h->pixmapModificationHooks[i](pmd); | 0 |
53 | } | 0 |
54 | | - |
55 | void QImagePixmapCleanupHooks::executePlatformPixmapDestructionHooks(QPlatformPixmap* pmd) | - |
56 | { | - |
57 | QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks(); | - |
58 | | - |
59 | | - |
60 | | - |
61 | if (!h) | 0 |
62 | return; | 0 |
63 | for (int i = 0; i < h->pixmapDestructionHooks.count(); ++i) never evaluated: i < h->pixmapDestructionHooks.count() | 0 |
64 | h->pixmapDestructionHooks[i](pmd); never executed: h->pixmapDestructionHooks[i](pmd); | 0 |
65 | } | 0 |
66 | | - |
67 | void QImagePixmapCleanupHooks::executeImageHooks(qint64 key) | - |
68 | { | - |
69 | QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks(); | - |
70 | | - |
71 | | - |
72 | | - |
73 | if (!h) | 0 |
74 | return; | 0 |
75 | for (int i = 0; i < h->imageHooks.count(); ++i) never evaluated: i < h->imageHooks.count() | 0 |
76 | h->imageHooks[i](key); never executed: h->imageHooks[i](key); | 0 |
77 | } | 0 |
78 | | - |
79 | | - |
80 | void QImagePixmapCleanupHooks::enableCleanupHooks(QPlatformPixmap *handle) | - |
81 | { | - |
82 | handle->is_cached = true; | - |
83 | } | 0 |
84 | | - |
85 | void QImagePixmapCleanupHooks::enableCleanupHooks(const QPixmap &pixmap) | - |
86 | { | - |
87 | enableCleanupHooks(const_cast<QPixmap &>(pixmap).data_ptr().data()); | - |
88 | } | 0 |
89 | | - |
90 | void QImagePixmapCleanupHooks::enableCleanupHooks(const QImage &image) | - |
91 | { | - |
92 | const_cast<QImage &>(image).data_ptr()->is_cached = true; | - |
93 | } | 0 |
94 | | - |
95 | bool QImagePixmapCleanupHooks::isImageCached(const QImage &image) | - |
96 | { | - |
97 | 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 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 | | - |
108 | | - |
| | |