image/qimagepixmapcleanuphooks.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5static 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 -
7QImagePixmapCleanupHooks *QImagePixmapCleanupHooks::instance() -
8{ -
9 return 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: }
0
16 -
17void QImagePixmapCleanupHooks::addPlatformPixmapDestructionHook(_qt_pixmap_cleanup_hook_pmd hook) -
18{ -
19 pixmapDestructionHooks.append(hook); -
20}
never executed: }
0
21 -
22 -
23void QImagePixmapCleanupHooks::addImageHook(_qt_image_cleanup_hook_64 hook) -
24{ -
25 imageHooks.append(hook); -
26}
never executed: }
0
27 -
28void QImagePixmapCleanupHooks::removePlatformPixmapModificationHook(_qt_pixmap_cleanup_hook_pmd hook) -
29{ -
30 pixmapModificationHooks.removeAll(hook); -
31}
never executed: }
0
32 -
33void QImagePixmapCleanupHooks::removePlatformPixmapDestructionHook(_qt_pixmap_cleanup_hook_pmd hook) -
34{ -
35 pixmapDestructionHooks.removeAll(hook); -
36}
never executed: }
0
37 -
38void QImagePixmapCleanupHooks::removeImageHook(_qt_image_cleanup_hook_64 hook) -
39{ -
40 imageHooks.removeAll(hook); -
41}
never executed: }
0
42 -
43void QImagePixmapCleanupHooks::executePlatformPixmapModificationHooks(QPlatformPixmap* pmd) -
44{ -
45 QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks(); -
46 -
47 -
48 -
49 if (!h)
never evaluated: !h
0
50 return;
never executed: 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}
never executed: }
0
54 -
55void QImagePixmapCleanupHooks::executePlatformPixmapDestructionHooks(QPlatformPixmap* pmd) -
56{ -
57 QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks(); -
58 -
59 -
60 -
61 if (!h)
never evaluated: !h
0
62 return;
never executed: 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}
never executed: }
0
66 -
67void QImagePixmapCleanupHooks::executeImageHooks(qint64 key) -
68{ -
69 QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks(); -
70 -
71 -
72 -
73 if (!h)
never evaluated: !h
0
74 return;
never executed: 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}
never executed: }
0
78 -
79 -
80void QImagePixmapCleanupHooks::enableCleanupHooks(QPlatformPixmap *handle) -
81{ -
82 handle->is_cached = true; -
83}
never executed: }
0
84 -
85void QImagePixmapCleanupHooks::enableCleanupHooks(const QPixmap &pixmap) -
86{ -
87 enableCleanupHooks(const_cast<QPixmap &>(pixmap).data_ptr().data()); -
88}
never executed: }
0
89 -
90void QImagePixmapCleanupHooks::enableCleanupHooks(const QImage &image) -
91{ -
92 const_cast<QImage &>(image).data_ptr()->is_cached = true; -
93}
never executed: }
0
94 -
95bool 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 -
100bool 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 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial