Qt 4.8
Classes | Functions
qpixmapdata_vg_p.h File Reference
#include <QtGui/private/qpixmap_raster_p.h>
#include <QtGui/private/qvolatileimage_p.h>
#include "qvg_p.h"

Go to the source code of this file.

Classes

class  QVGPixmapData
 

Functions

void qt_vg_hibernate_pixmaps (QVGSharedContext *context)
 
void qt_vg_register_pixmap (QVGPixmapData *pd)
 
void qt_vg_unregister_pixmap (QVGPixmapData *pd)
 

Function Documentation

◆ qt_vg_hibernate_pixmaps()

void qt_vg_hibernate_pixmaps ( QVGSharedContext context)

Definition at line 333 of file qwindowsurface_vgegl.cpp.

Referenced by qt_vg_destroy_context().

334 {
335  // Artificially increase the reference count to prevent the
336  // context from being destroyed until after we have finished
337  // the hibernation process.
338  ++(shared->refCount);
339 
340  // We need a context current to hibernate the VGImage objects.
341  shared->context->makeCurrent(qt_vg_shared_surface());
342 
343  // Scan all QVGPixmapData objects in the system and hibernate them.
344  QVGPixmapData *pd = shared->firstPixmap;
345  while (pd != 0) {
346  pd->hibernate();
347  pd = pd->next;
348  }
349 
350  // Hibernate any remaining VGImage's in the image pool.
352 
353  // Don't need the current context any more.
354  shared->context->lazyDoneCurrent();
355 
356  // Decrease the reference count and destroy the context if necessary.
357  if (--(shared->refCount) <= 0)
359 }
EGLSurface qt_vg_shared_surface(void)
QVGPixmapData * next
static void qt_vg_destroy_shared_context(QVGSharedContext *shared)
static QVGImagePool * instance()
virtual void hibernate()
virtual void hibernate()

◆ qt_vg_register_pixmap()

void qt_vg_register_pixmap ( QVGPixmapData pd)

Definition at line 157 of file qwindowsurface_vgegl.cpp.

Referenced by qt_vg_unregister_pixmap().

158 {
159  QVGSharedContext *shared = sharedContext();
160  pd->next = shared->firstPixmap;
161  pd->prev = 0;
162  if (shared->firstPixmap)
163  shared->firstPixmap->prev = pd;
164  shared->firstPixmap = pd;
165 }
QVGPixmapData * next
QVGPixmapData * prev
QVGPixmapData * firstPixmap

◆ qt_vg_unregister_pixmap()

void qt_vg_unregister_pixmap ( QVGPixmapData pd)

Definition at line 167 of file qwindowsurface_vgegl.cpp.

168 {
169  if (pd->next)
170  pd->next->prev = pd->prev;
171  if (pd->prev) {
172  pd->prev->next = pd->next;
173  } else {
174  QVGSharedContext *shared = sharedContext();
175  if (shared)
176  shared->firstPixmap = pd->next;
177  }
178 }
QVGPixmapData * next
QVGPixmapData * prev
QVGPixmapData * firstPixmap