Qt 4.8
Public Functions | Static Public Functions | Properties | List of all members
QImagePixmapCleanupHooks Class Reference

#include <qimagepixmapcleanuphooks_p.h>

Public Functions

void addImageHook (_qt_image_cleanup_hook_64)
 
void addPixmapDataDestructionHook (_qt_pixmap_cleanup_hook_pmd)
 
void addPixmapDataModificationHook (_qt_pixmap_cleanup_hook_pmd)
 
void removeImageHook (_qt_image_cleanup_hook_64)
 
void removePixmapDataDestructionHook (_qt_pixmap_cleanup_hook_pmd)
 
void removePixmapDataModificationHook (_qt_pixmap_cleanup_hook_pmd)
 

Static Public Functions

static void enableCleanupHooks (const QImage &image)
 
static void enableCleanupHooks (const QPixmap &pixmap)
 
static void enableCleanupHooks (QPixmapData *pixmapData)
 
static void executeImageHooks (qint64 key)
 
static void executePixmapDataDestructionHooks (QPixmapData *)
 
static void executePixmapDataModificationHooks (QPixmapData *)
 
static QImagePixmapCleanupHooksinstance ()
 
static bool isImageCached (const QImage &image)
 
static bool isPixmapCached (const QPixmap &pixmap)
 

Properties

QList< _qt_image_cleanup_hook_64imageHooks
 
QList< _qt_pixmap_cleanup_hook_pmdpixmapDestructionHooks
 
QList< _qt_pixmap_cleanup_hook_pmdpixmapModificationHooks
 

Detailed Description

Definition at line 66 of file qimagepixmapcleanuphooks_p.h.

Functions

◆ addImageHook()

void QImagePixmapCleanupHooks::addImageHook ( _qt_image_cleanup_hook_64  hook)

Definition at line 76 of file qimagepixmapcleanuphooks.cpp.

Referenced by QDirectFBPaintEngine::drawBufferSpan().

77 {
78  imageHooks.append(hook);
79 }
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QList< _qt_image_cleanup_hook_64 > imageHooks

◆ addPixmapDataDestructionHook()

void QImagePixmapCleanupHooks::addPixmapDataDestructionHook ( _qt_pixmap_cleanup_hook_pmd  hook)

Definition at line 70 of file qimagepixmapcleanuphooks.cpp.

Referenced by QGLBlurTextureCache::insertBlurTextureInfo().

71 {
73 }
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QList< _qt_pixmap_cleanup_hook_pmd > pixmapDestructionHooks

◆ addPixmapDataModificationHook()

void QImagePixmapCleanupHooks::addPixmapDataModificationHook ( _qt_pixmap_cleanup_hook_pmd  hook)

Definition at line 65 of file qimagepixmapcleanuphooks.cpp.

Referenced by QGLBlurTextureCache::insertBlurTextureInfo().

66 {
68 }
QList< _qt_pixmap_cleanup_hook_pmd > pixmapModificationHooks
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507

◆ enableCleanupHooks() [1/3]

void QImagePixmapCleanupHooks::enableCleanupHooks ( const QImage image)
static

Definition at line 146 of file qimagepixmapcleanuphooks.cpp.

Referenced by QGLContextPrivate::bindTextureFromNativePixmap(), QEgl::createSurface(), enableCleanupHooks(), and QGLBlurTextureCache::insertBlurTextureInfo().

147 {
148  const_cast<QImage &>(image).data_ptr()->is_cached = true;
149 }
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
void * data_ptr(const QTransform &t)
Definition: qpainter_p.h:81

◆ enableCleanupHooks() [2/3]

void QImagePixmapCleanupHooks::enableCleanupHooks ( const QPixmap pixmap)
static

Definition at line 141 of file qimagepixmapcleanuphooks.cpp.

142 {
143  enableCleanupHooks(const_cast<QPixmap &>(pixmap).data_ptr().data());
144 }
static void enableCleanupHooks(const QImage &image)
static const char * data(const QByteArray &arr)
void * data_ptr(const QTransform &t)
Definition: qpainter_p.h:81

◆ enableCleanupHooks() [3/3]

void QImagePixmapCleanupHooks::enableCleanupHooks ( QPixmapData pixmapData)
static

Definition at line 136 of file qimagepixmapcleanuphooks.cpp.

137 {
138  pixmapData->is_cached = true;
139 }

◆ executeImageHooks()

void QImagePixmapCleanupHooks::executeImageHooks ( qint64  key)
static

Definition at line 126 of file qimagepixmapcleanuphooks.cpp.

Referenced by QImage::detach(), and QImageData::~QImageData().

127 {
128  for (int i = 0; i < qt_image_and_pixmap_cleanup_hooks()->imageHooks.count(); ++i)
129  qt_image_and_pixmap_cleanup_hooks()->imageHooks[i](key);
130 
133 }
int key
Q_GUI_EXPORT _qt_image_cleanup_hook_64 qt_image_cleanup_hook_64

◆ executePixmapDataDestructionHooks()

void QImagePixmapCleanupHooks::executePixmapDataDestructionHooks ( QPixmapData pmd)
static

Definition at line 111 of file qimagepixmapcleanuphooks.cpp.

Referenced by QPixmapData::~QPixmapData(), and QX11PixmapData::~QX11PixmapData().

112 {
113  QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks();
114  // the global destructor for the pixmap and image hooks might have
115  // been called already if the app is "leaking" global
116  // pixmaps/images
117  if (!h)
118  return;
119  for (int i = 0; i < h->pixmapDestructionHooks.count(); ++i)
120  h->pixmapDestructionHooks[i](pmd);
121 
124 }
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
Q_GUI_EXPORT _qt_pixmap_cleanup_hook_64 qt_pixmap_cleanup_hook_64
QList< _qt_pixmap_cleanup_hook_pmd > pixmapDestructionHooks
qint64 cacheKey() const

◆ executePixmapDataModificationHooks()

void QImagePixmapCleanupHooks::executePixmapDataModificationHooks ( QPixmapData pmd)
static

Definition at line 96 of file qimagepixmapcleanuphooks.cpp.

Referenced by QPixmap::detach().

97 {
98  QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks();
99  // the global destructor for the pixmap and image hooks might have
100  // been called already if the app is "leaking" global
101  // pixmaps/images
102  if (!h)
103  return;
104  for (int i = 0; i < h->pixmapModificationHooks.count(); ++i)
105  h->pixmapModificationHooks[i](pmd);
106 
109 }
QList< _qt_pixmap_cleanup_hook_pmd > pixmapModificationHooks
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
Q_GUI_EXPORT _qt_pixmap_cleanup_hook_64 qt_pixmap_cleanup_hook_64
qint64 cacheKey() const

◆ instance()

QImagePixmapCleanupHooks * QImagePixmapCleanupHooks::instance ( )
static

Definition at line 60 of file qimagepixmapcleanuphooks.cpp.

Referenced by QDirectFBPaintEngine::drawBufferSpan(), and QGLBlurTextureCache::insertBlurTextureInfo().

61 {
62  return qt_image_and_pixmap_cleanup_hooks();
63 }

◆ isImageCached()

bool QImagePixmapCleanupHooks::isImageCached ( const QImage image)
static

Definition at line 151 of file qimagepixmapcleanuphooks.cpp.

152 {
153  return const_cast<QImage &>(image).data_ptr()->is_cached;
154 }
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
void * data_ptr(const QTransform &t)
Definition: qpainter_p.h:81

◆ isPixmapCached()

bool QImagePixmapCleanupHooks::isPixmapCached ( const QPixmap pixmap)
static

Definition at line 156 of file qimagepixmapcleanuphooks.cpp.

157 {
158  return const_cast<QPixmap&>(pixmap).data_ptr().data()->is_cached;
159 }
void * data_ptr(const QTransform &t)
Definition: qpainter_p.h:81
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71

◆ removeImageHook()

void QImagePixmapCleanupHooks::removeImageHook ( _qt_image_cleanup_hook_64  hook)

Definition at line 91 of file qimagepixmapcleanuphooks.cpp.

92 {
93  imageHooks.removeAll(hook);
94 }
QList< _qt_image_cleanup_hook_64 > imageHooks
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Definition: qlist.h:770

◆ removePixmapDataDestructionHook()

void QImagePixmapCleanupHooks::removePixmapDataDestructionHook ( _qt_pixmap_cleanup_hook_pmd  hook)

Definition at line 86 of file qimagepixmapcleanuphooks.cpp.

87 {
89 }
QList< _qt_pixmap_cleanup_hook_pmd > pixmapDestructionHooks
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Definition: qlist.h:770

◆ removePixmapDataModificationHook()

void QImagePixmapCleanupHooks::removePixmapDataModificationHook ( _qt_pixmap_cleanup_hook_pmd  hook)

Definition at line 81 of file qimagepixmapcleanuphooks.cpp.

82 {
84 }
QList< _qt_pixmap_cleanup_hook_pmd > pixmapModificationHooks
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Definition: qlist.h:770

Properties

◆ imageHooks

QList<_qt_image_cleanup_hook_64> QImagePixmapCleanupHooks::imageHooks
private

Definition at line 96 of file qimagepixmapcleanuphooks_p.h.

Referenced by addImageHook(), and removeImageHook().

◆ pixmapDestructionHooks

QList<_qt_pixmap_cleanup_hook_pmd> QImagePixmapCleanupHooks::pixmapDestructionHooks
private

◆ pixmapModificationHooks

QList<_qt_pixmap_cleanup_hook_pmd> QImagePixmapCleanupHooks::pixmapModificationHooks
private

The documentation for this class was generated from the following files: