Makes the API symmetric with the other Lighthouse APIs.
Change-Id: I8a399f3c968ea35d4624711b31f2ac5bb94b7893
Reviewed-on: http://codereview.qt.nokia.com/1735
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
#ifdef Q_WS_X11
QPixmap xRenderPixmap(1, 1);
- m_prefer_image = xRenderPixmap.pixmapData()->classId() == QPixmapData::X11Class && !xRenderPixmap.x11PictureHandle();
+ m_prefer_image = xRenderPixmap.handle()->classId() == QPlatformPixmap::X11Class && !xRenderPixmap.x11PictureHandle();
#endif
}
#include <QtGui/private/qt_x11_p.h>
#include <QtGui/qx11info_x11.h>
-#include <QtGui/private/qpixmapdata_p.h>
+#include <QtGui/qplatformpixmap_qpa.h>
#include <QtGui/private/qpixmap_x11_p.h>
#include <QtGui/private/qimagepixmapcleanuphooks_p.h>
return EGL_NO_SURFACE;
}
- QX11PixmapData *x11PixmapData = 0;
+ QX11PlatformPixmap *x11PlatformPixmap = 0;
if (devType == QInternal::Pixmap) {
- QPixmapData *pmd = static_cast<QPixmap*>(device)->data_ptr().data();
- if (pmd->classId() == QPixmapData::X11Class)
- x11PixmapData = static_cast<QX11PixmapData*>(pmd);
+ QPlatformPixmap *pmd = static_cast<QPixmap*>(device)->data_ptr().data();
+ if (pmd->classId() == QPlatformPixmap::X11Class)
+ x11PlatformPixmap = static_cast<QX11PlatformPixmap*>(pmd);
else {
- // TODO: Replace the pixmap's data with a new QX11PixmapData
- qWarning("WARNING: Creating an EGL surface on a QPixmap is only supported for QX11PixmapData");
+ // TODO: Replace the pixmap's data with a new QX11PlatformPixmap
+ qWarning("WARNING: Creating an EGL surface on a QPixmap is only supported for QX11PlatformPixmap");
return EGL_NO_SURFACE;
}
} else if ((devType != QInternal::Widget) && (devType != QInternal::Pbuffer)) {
return surf;
}
- if (x11PixmapData) {
+ if (x11PlatformPixmap) {
// X11 Pixmaps are only created with a depth, so that's all we need to check
EGLint configDepth;
eglGetConfigAttrib(QEgl::display(), config, EGL_BUFFER_SIZE , &configDepth);
- if (x11PixmapData->depth() != configDepth) {
+ if (x11PlatformPixmap->depth() != configDepth) {
// The bit depths are wrong which means the EGLConfig isn't compatable with
// this pixmap. So we need to replace the pixmap's existing data with a new
// one which is created with the correct depth:
#ifndef QT_NO_XRENDER
if (configDepth == 32) {
qWarning("Warning: EGLConfig's depth (32) != pixmap's depth (%d), converting to ARGB32",
- x11PixmapData->depth());
- x11PixmapData->convertToARGB32(true);
+ x11PlatformPixmap->depth());
+ x11PlatformPixmap->convertToARGB32(true);
} else
#endif
{
qWarning("Warning: EGLConfig's depth (%d) != pixmap's depth (%d)",
- configDepth, x11PixmapData->depth());
+ configDepth, x11PlatformPixmap->depth());
}
}
surfaceAttribs.setValue(EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGB);
EGLSurface surf = eglCreatePixmapSurface(QEgl::display(), config,
- (EGLNativePixmapType) x11PixmapData->handle(),
+ (EGLNativePixmapType) x11PlatformPixmap->handle(),
surfaceAttribs.properties());
- x11PixmapData->gl_surface = (void*)surf;
- QImagePixmapCleanupHooks::enableCleanupHooks(x11PixmapData);
+ x11PlatformPixmap->gl_surface = (void*)surf;
+ QImagePixmapCleanupHooks::enableCleanupHooks(x11PlatformPixmap);
return surf;
}
static void setCurrentContext(QEgl::API api, QEglContext *context);
friend class QMeeGoGraphicsSystem;
- friend class QMeeGoPixmapData;
+ friend class QMeeGoPlatformPixmap;
};
QT_END_NAMESPACE
image/qpixmap_blitter_p.h \
image/qpixmapcache.h \
image/qpixmapcache_p.h \
- image/qpixmapdata_p.h \
- image/qpixmapdatafactory_p.h \
+ image/qplatformpixmap_qpa.h \
image/qimagepixmapcleanuphooks_p.h \
image/qvolatileimage_p.h \
image/qvolatileimagedata_p.h \
image/qpictureformatplugin.cpp \
image/qpixmap.cpp \
image/qpixmapcache.cpp \
- image/qpixmapdata.cpp \
- image/qpixmapdatafactory.cpp \
+ image/qplatformpixmap.cpp \
image/qmovie.cpp \
image/qpixmap_raster.cpp \
image/qpixmap_blitter.cpp \
****************************************************************************/
#include "qbitmap.h"
-#include "qpixmapdata_p.h"
+#include "qplatformpixmap_qpa.h"
#include "qimage.h"
#include "qvariant.h"
#include <qpainter.h>
\sa QPixmap::isNull()
*/
QBitmap::QBitmap()
- : QPixmap(QSize(0, 0), QPixmapData::BitmapType)
+ : QPixmap(QSize(0, 0), QPlatformPixmap::BitmapType)
{
}
*/
QBitmap::QBitmap(int w, int h)
- : QPixmap(QSize(w, h), QPixmapData::BitmapType)
+ : QPixmap(QSize(w, h), QPlatformPixmap::BitmapType)
{
}
*/
QBitmap::QBitmap(const QSize &size)
- : QPixmap(size, QPixmapData::BitmapType)
+ : QPixmap(size, QPlatformPixmap::BitmapType)
{
}
*/
QBitmap::QBitmap(const QString& fileName, const char *format)
- : QPixmap(QSize(0, 0), QPixmapData::BitmapType)
+ : QPixmap(QSize(0, 0), QPlatformPixmap::BitmapType)
{
load(fileName, format, Qt::MonoOnly);
}
img.setColor(1, c0);
}
- QScopedPointer<QPixmapData> data(QGuiApplicationPrivate::platformIntegration()->createPixmapData(QPixmapData::BitmapType));
+ QScopedPointer<QPlatformPixmap> data(QGuiApplicationPrivate::platformIntegration()->createPlatformPixmap(QPlatformPixmap::BitmapType));
data->fromImage(img, flags | Qt::MonoOnly);
return QPixmap(data.take());
QBitmap transformed(const QMatrix &) const;
QBitmap transformed(const QTransform &matrix) const;
- typedef QExplicitlySharedDataPointer<QPixmapData> DataPtr;
+ typedef QExplicitlySharedDataPointer<QPlatformPixmap> DataPtr;
};
Q_DECLARE_SHARED(QBitmap)
#include <stdlib.h>
#include <limits.h>
#include <math.h>
+#include <qplatformpixmap_qpa.h>
#include <private/qdrawhelper_p.h>
#include <private/qmemrotate_p.h>
-#include <private/qpixmapdata_p.h>
#include <private/qimagescale_p.h>
#include <private/qsimd_p.h>
friend class QWSOnScreenSurface;
QImageData *d;
- friend class QRasterPixmapData;
- friend class QBlittablePixmapData;
+ friend class QRasterPlatformPixmap;
+ friend class QBlittablePlatformPixmap;
friend class QPixmapCacheEntry;
friend Q_GUI_EXPORT qint64 qt_image_id(const QImage &image);
friend const QVector<QRgb> *qt_image_colortable(const QImage &image);
****************************************************************************/
#include "qimagepixmapcleanuphooks_p.h"
-#include "private/qpixmapdata_p.h"
+#include "qplatformpixmap_qpa.h"
#include "private/qimage_p.h"
return qt_image_and_pixmap_cleanup_hooks();
}
-void QImagePixmapCleanupHooks::addPixmapDataModificationHook(_qt_pixmap_cleanup_hook_pmd hook)
+void QImagePixmapCleanupHooks::addPlatformPixmapModificationHook(_qt_pixmap_cleanup_hook_pmd hook)
{
pixmapModificationHooks.append(hook);
}
-void QImagePixmapCleanupHooks::addPixmapDataDestructionHook(_qt_pixmap_cleanup_hook_pmd hook)
+void QImagePixmapCleanupHooks::addPlatformPixmapDestructionHook(_qt_pixmap_cleanup_hook_pmd hook)
{
pixmapDestructionHooks.append(hook);
}
imageHooks.append(hook);
}
-void QImagePixmapCleanupHooks::removePixmapDataModificationHook(_qt_pixmap_cleanup_hook_pmd hook)
+void QImagePixmapCleanupHooks::removePlatformPixmapModificationHook(_qt_pixmap_cleanup_hook_pmd hook)
{
pixmapModificationHooks.removeAll(hook);
}
-void QImagePixmapCleanupHooks::removePixmapDataDestructionHook(_qt_pixmap_cleanup_hook_pmd hook)
+void QImagePixmapCleanupHooks::removePlatformPixmapDestructionHook(_qt_pixmap_cleanup_hook_pmd hook)
{
pixmapDestructionHooks.removeAll(hook);
}
imageHooks.removeAll(hook);
}
-void QImagePixmapCleanupHooks::executePixmapDataModificationHooks(QPixmapData* pmd)
+void QImagePixmapCleanupHooks::executePlatformPixmapModificationHooks(QPlatformPixmap* pmd)
{
QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks();
// the global destructor for the pixmap and image hooks might have
qt_pixmap_cleanup_hook_64(pmd->cacheKey());
}
-void QImagePixmapCleanupHooks::executePixmapDataDestructionHooks(QPixmapData* pmd)
+void QImagePixmapCleanupHooks::executePlatformPixmapDestructionHooks(QPlatformPixmap* pmd)
{
QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks();
// the global destructor for the pixmap and image hooks might have
}
-void QImagePixmapCleanupHooks::enableCleanupHooks(QPixmapData *pixmapData)
+void QImagePixmapCleanupHooks::enableCleanupHooks(QPlatformPixmap *handle)
{
- pixmapData->is_cached = true;
+ handle->is_cached = true;
}
void QImagePixmapCleanupHooks::enableCleanupHooks(const QPixmap &pixmap)
QT_BEGIN_NAMESPACE
typedef void (*_qt_image_cleanup_hook_64)(qint64);
-typedef void (*_qt_pixmap_cleanup_hook_pmd)(QPixmapData*);
+typedef void (*_qt_pixmap_cleanup_hook_pmd)(QPlatformPixmap*);
class QImagePixmapCleanupHooks;
static void enableCleanupHooks(const QImage &image);
static void enableCleanupHooks(const QPixmap &pixmap);
- static void enableCleanupHooks(QPixmapData *pixmapData);
+ static void enableCleanupHooks(QPlatformPixmap *handle);
static bool isImageCached(const QImage &image);
static bool isPixmapCached(const QPixmap &pixmap);
// Gets called when a pixmap data is about to be modified:
- void addPixmapDataModificationHook(_qt_pixmap_cleanup_hook_pmd);
+ void addPlatformPixmapModificationHook(_qt_pixmap_cleanup_hook_pmd);
// Gets called when a pixmap data is about to be destroyed:
- void addPixmapDataDestructionHook(_qt_pixmap_cleanup_hook_pmd);
+ void addPlatformPixmapDestructionHook(_qt_pixmap_cleanup_hook_pmd);
// Gets called when an image is about to be modified or destroyed:
void addImageHook(_qt_image_cleanup_hook_64);
- void removePixmapDataModificationHook(_qt_pixmap_cleanup_hook_pmd);
- void removePixmapDataDestructionHook(_qt_pixmap_cleanup_hook_pmd);
+ void removePlatformPixmapModificationHook(_qt_pixmap_cleanup_hook_pmd);
+ void removePlatformPixmapDestructionHook(_qt_pixmap_cleanup_hook_pmd);
void removeImageHook(_qt_image_cleanup_hook_64);
- static void executePixmapDataModificationHooks(QPixmapData*);
- static void executePixmapDataDestructionHooks(QPixmapData*);
+ static void executePlatformPixmapModificationHooks(QPlatformPixmap*);
+ static void executePlatformPixmapDestructionHooks(QPlatformPixmap*);
static void executeImageHooks(qint64 key);
private:
#include <qglobal.h>
#include "qpixmap.h"
-#include "qpixmapdata_p.h"
+#include "qplatformpixmap_qpa.h"
#include "qimagepixmapcleanuphooks_p.h"
#include "qbitmap.h"
void QPixmap::init(int w, int h, int type)
{
- if ((w > 0 && h > 0) || type == QPixmapData::BitmapType)
- data = QPixmapData::create(w, h, (QPixmapData::PixelType) type);
+ if ((w > 0 && h > 0) || type == QPlatformPixmap::BitmapType)
+ data = QPlatformPixmap::create(w, h, (QPlatformPixmap::PixelType) type);
else
data = 0;
}
: QPaintDevice()
{
(void) qt_pixmap_thread_test();
- init(0, 0, QPixmapData::PixmapType);
+ init(0, 0, QPlatformPixmap::PixmapType);
}
/*!
: QPaintDevice()
{
if (!qt_pixmap_thread_test())
- init(0, 0, QPixmapData::PixmapType);
+ init(0, 0, QPlatformPixmap::PixmapType);
else
- init(w, h, QPixmapData::PixmapType);
+ init(w, h, QPlatformPixmap::PixmapType);
}
/*!
: QPaintDevice()
{
if (!qt_pixmap_thread_test())
- init(0, 0, QPixmapData::PixmapType);
+ init(0, 0, QPlatformPixmap::PixmapType);
else
- init(size.width(), size.height(), QPixmapData::PixmapType);
+ init(size.width(), size.height(), QPlatformPixmap::PixmapType);
}
/*!
QPixmap::QPixmap(const QSize &s, int type)
{
if (!qt_pixmap_thread_test())
- init(0, 0, static_cast<QPixmapData::PixelType>(type));
+ init(0, 0, static_cast<QPlatformPixmap::PixelType>(type));
else
- init(s.width(), s.height(), static_cast<QPixmapData::PixelType>(type));
+ init(s.width(), s.height(), static_cast<QPlatformPixmap::PixelType>(type));
}
/*!
\internal
*/
-QPixmap::QPixmap(QPixmapData *d)
+QPixmap::QPixmap(QPlatformPixmap *d)
: QPaintDevice(), data(d)
{
}
QPixmap::QPixmap(const QString& fileName, const char *format, Qt::ImageConversionFlags flags)
: QPaintDevice()
{
- init(0, 0, QPixmapData::PixmapType);
+ init(0, 0, QPlatformPixmap::PixmapType);
if (!qt_pixmap_thread_test())
return;
: QPaintDevice()
{
if (!qt_pixmap_thread_test()) {
- init(0, 0, QPixmapData::PixmapType);
+ init(0, 0, QPlatformPixmap::PixmapType);
return;
}
if (pixmap.paintingActive()) { // make a deep copy
QPixmap::QPixmap(const char * const xpm[])
: QPaintDevice()
{
- init(0, 0, QPixmapData::PixmapType);
+ init(0, 0, QPlatformPixmap::PixmapType);
if (!xpm)
return;
QImage image(xpm);
if (!image.isNull()) {
- if (data && data->pixelType() == QPixmapData::BitmapType)
+ if (data && data->pixelType() == QPlatformPixmap::BitmapType)
*this = QBitmap::fromImage(image);
else
*this = fromImage(image);
if (!rect.isEmpty())
r = r.intersected(rect);
- QPixmapData *d = data->createCompatiblePixmapData();
+ QPlatformPixmap *d = data->createCompatiblePlatformPixmap();
d->copy(data.data(), r);
return QPixmap(d);
}
bool QPixmap::isQBitmap() const
{
- return data->type == QPixmapData::BitmapType;
+ return data->type == QPlatformPixmap::BitmapType;
}
/*!
% info.absoluteFilePath()
% HexString<uint>(info.lastModified().toTime_t())
% HexString<quint64>(info.size())
- % HexString<uint>(data ? data->pixelType() : QPixmapData::PixmapType);
+ % HexString<uint>(data ? data->pixelType() : QPlatformPixmap::PixmapType);
// Note: If no extension is provided, we try to match the
// file against known plugin extensions
if (QPixmapCache::find(key, *this))
return true;
- QScopedPointer<QPixmapData> tmp(QPixmapData::create(0, 0, data ? data->type : QPixmapData::PixmapType));
+ QScopedPointer<QPlatformPixmap> tmp(QPlatformPixmap::create(0, 0, data ? data->type : QPlatformPixmap::PixmapType));
if (tmp->fromFile(fileName, format, flags)) {
data = tmp.take();
QPixmapCache::insert(key, *this);
return false;
if (!data)
- data = QPixmapData::create(0, 0, QPixmapData::PixmapType);
+ data = QPlatformPixmap::create(0, 0, QPlatformPixmap::PixmapType);
return data->fromData(buf, len, format, flags);
}
} else {
// Don't bother to make a copy of the data object, since
// it will be filled with new pixel data anyway.
- QPixmapData *d = data->createCompatiblePixmapData();
+ QPlatformPixmap *d = data->createCompatiblePlatformPixmap();
d->resize(data->width(), data->height());
data = d;
}
if (!data)
return;
- // QPixmap.data member may be QRuntimePixmapData so use pixmapData() function to get
+ // QPixmap.data member may be QRuntimePlatformPixmap so use handle() function to get
// the actual underlaying runtime pixmap data.
- QPixmapData *pd = pixmapData();
- QPixmapData::ClassId id = pd->classId();
- if (id == QPixmapData::RasterClass) {
- QRasterPixmapData *rasterData = static_cast<QRasterPixmapData*>(pd);
+ QPlatformPixmap *pd = handle();
+ QPlatformPixmap::ClassId id = pd->classId();
+ if (id == QPlatformPixmap::RasterClass) {
+ QRasterPlatformPixmap *rasterData = static_cast<QRasterPlatformPixmap*>(pd);
rasterData->image.detach();
}
if (data->is_cached && data->ref == 1)
- QImagePixmapCleanupHooks::executePixmapDataModificationHooks(data.data());
+ QImagePixmapCleanupHooks::executePlatformPixmapModificationHooks(data.data());
if (data->ref != 1) {
*this = copy();
if (image.isNull())
return QPixmap();
- QScopedPointer<QPixmapData> data(QGuiApplicationPrivate::platformIntegration()->createPixmapData(QPixmapData::PixmapType));
+ QScopedPointer<QPlatformPixmap> data(QGuiApplicationPrivate::platformIntegration()->createPlatformPixmap(QPlatformPixmap::PixmapType));
data->fromImage(image, flags);
return QPixmap(data.take());
}
*/
QPixmap QPixmap::fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags)
{
- QScopedPointer<QPixmapData> data(QGuiApplicationPrivate::platformIntegration()->createPixmapData(QPixmapData::PixmapType));
+ QScopedPointer<QPlatformPixmap> data(QGuiApplicationPrivate::platformIntegration()->createPlatformPixmap(QPlatformPixmap::PixmapType));
data->fromImageReader(imageReader, flags);
return QPixmap(data.take());
}
/*!
\internal
*/
-QPixmapData* QPixmap::pixmapData() const
+QPlatformPixmap* QPixmap::handle() const
{
return data.data();
}
class QColor;
class QVariant;
class QX11Info;
-class QPixmapData;
+class QPlatformPixmap;
class Q_GUI_EXPORT QPixmap : public QPaintDevice
{
public:
QPixmap();
- explicit QPixmap(QPixmapData *data);
+ explicit QPixmap(QPlatformPixmap *data);
QPixmap(int w, int h);
QPixmap(const QSize &);
QPixmap(const QString& fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
int metric(PaintDeviceMetric) const;
private:
- QExplicitlySharedDataPointer<QPixmapData> data;
+ QExplicitlySharedDataPointer<QPlatformPixmap> data;
bool doImageIO(QImageWriter *io, int quality) const;
void init(int, int, int);
void deref();
Q_DUMMY_COMPARISON_OPERATOR(QPixmap)
- friend class QPixmapData;
+ friend class QPlatformPixmap;
friend class QBitmap;
friend class QPaintDevice;
friend class QPainter;
#endif
public:
- QPixmapData* pixmapData() const;
+ QPlatformPixmap* handle() const;
public:
- typedef QExplicitlySharedDataPointer<QPixmapData> DataPtr;
+ typedef QExplicitlySharedDataPointer<QPlatformPixmap> DataPtr;
inline DataPtr &data_ptr() { return data; }
};
static int global_ser_no = 0;
-QBlittablePixmapData::QBlittablePixmapData()
- : QPixmapData(QPixmapData::PixmapType,BlitterClass), m_engine(0), m_blittable(0)
+QBlittablePlatformPixmap::QBlittablePlatformPixmap()
+ : QPlatformPixmap(QPlatformPixmap::PixmapType,BlitterClass), m_engine(0), m_blittable(0)
#ifdef QT_BLITTER_RASTEROVERLAY
,m_rasterOverlay(0), m_unmergedCopy(0)
#endif //QT_BLITTER_RASTEROVERLAY
setSerialNumber(++global_ser_no);
}
-QBlittablePixmapData::~QBlittablePixmapData()
+QBlittablePlatformPixmap::~QBlittablePlatformPixmap()
{
delete m_blittable;
delete m_engine;
#endif //QT_BLITTER_RASTEROVERLAY
}
-QBlittable *QBlittablePixmapData::blittable() const
+QBlittable *QBlittablePlatformPixmap::blittable() const
{
if (!m_blittable) {
- QBlittablePixmapData *that = const_cast<QBlittablePixmapData *>(this);
+ QBlittablePlatformPixmap *that = const_cast<QBlittablePlatformPixmap *>(this);
that->m_blittable = this->createBlittable(QSize(w,h));
}
return m_blittable;
}
-void QBlittablePixmapData::setBlittable(QBlittable *blittable)
+void QBlittablePlatformPixmap::setBlittable(QBlittable *blittable)
{
resize(blittable->size().width(),blittable->size().height());
m_blittable = blittable;
}
-void QBlittablePixmapData::resize(int width, int height)
+void QBlittablePlatformPixmap::resize(int width, int height)
{
delete m_blittable;
is_null = (w <= 0 || h <= 0);
}
-int QBlittablePixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
+int QBlittablePlatformPixmap::metric(QPaintDevice::PaintDeviceMetric metric) const
{
switch (metric) {
case QPaintDevice::PdmWidth:
case QPaintDevice::PdmPhysicalDpiY:
return qt_defaultDpiY();
default:
- qWarning("QRasterPixmapData::metric(): Unhandled metric type %d", metric);
+ qWarning("QRasterPlatformPixmap::metric(): Unhandled metric type %d", metric);
break;
}
return 0;
}
-void QBlittablePixmapData::fill(const QColor &color)
+void QBlittablePlatformPixmap::fill(const QColor &color)
{
//jlind: todo: change when blittables can support non opaque fillRects
if (color.alpha() == 255 && blittable()->capabilities() & QBlittable::SolidRectCapability) {
}
-QImage *QBlittablePixmapData::buffer()
+QImage *QBlittablePlatformPixmap::buffer()
{
return blittable()->lock();
}
-QImage QBlittablePixmapData::toImage() const
+QImage QBlittablePlatformPixmap::toImage() const
{
return blittable()->lock()->copy();
}
-bool QBlittablePixmapData::hasAlphaChannel() const
+bool QBlittablePlatformPixmap::hasAlphaChannel() const
{
return blittable()->lock()->hasAlphaChannel();
}
-void QBlittablePixmapData::fromImage(const QImage &image,
+void QBlittablePlatformPixmap::fromImage(const QImage &image,
Qt::ImageConversionFlags flags)
{
resize(image.width(),image.height());
}
}
-QPaintEngine *QBlittablePixmapData::paintEngine() const
+QPaintEngine *QBlittablePlatformPixmap::paintEngine() const
{
if (!m_engine) {
- QBlittablePixmapData *that = const_cast<QBlittablePixmapData *>(this);
+ QBlittablePlatformPixmap *that = const_cast<QBlittablePlatformPixmap *>(this);
that->m_engine = new QBlitterPaintEngine(that);
}
return m_engine;
static bool showRasterOverlay = !qgetenv("QT_BLITTER_RASTEROVERLAY").isEmpty();
-void QBlittablePixmapData::mergeOverlay()
+void QBlittablePlatformPixmap::mergeOverlay()
{
if (m_unmergedCopy || !showRasterOverlay)
return;
p.end();
}
-void QBlittablePixmapData::unmergeOverlay()
+void QBlittablePlatformPixmap::unmergeOverlay()
{
if (!m_unmergedCopy || !showRasterOverlay)
return;
m_unmergedCopy = 0;
}
-QImage *QBlittablePixmapData::overlay()
+QImage *QBlittablePlatformPixmap::overlay()
{
if (!m_rasterOverlay||
m_rasterOverlay->size() != QSize(w,h)){
return m_rasterOverlay;
}
-void QBlittablePixmapData::markRasterOverlayImpl(const QRectF &rect)
+void QBlittablePlatformPixmap::markRasterOverlayImpl(const QRectF &rect)
{
if (!showRasterOverlay)
return;
}
}
-void QBlittablePixmapData::unmarkRasterOverlayImpl(const QRectF &rect)
+void QBlittablePlatformPixmap::unmarkRasterOverlayImpl(const QRectF &rect)
{
if (!showRasterOverlay)
return;
}
}
-QRectF QBlittablePixmapData::clipAndTransformRect(const QRectF &rect) const
+QRectF QBlittablePlatformPixmap::clipAndTransformRect(const QRectF &rect) const
{
QRectF transformationRect = rect;
paintEngine();
#ifndef QPIXMAP_BLITTER_P_H
#define QPIXMAP_BLITTER_P_H
-#include <private/qpixmapdata_p.h>
+#include <qplatformpixmap_qpa.h>
#include <private/qpaintengine_blitter_p.h>
#ifndef QT_NO_BLITTABLE
QT_BEGIN_NAMESPACE
-class Q_GUI_EXPORT QBlittablePixmapData : public QPixmapData
+class Q_GUI_EXPORT QBlittablePlatformPixmap : public QPlatformPixmap
{
-// Q_DECLARE_PRIVATE(QBlittablePixmapData);
+// Q_DECLARE_PRIVATE(QBlittablePlatformPixmap);
public:
- QBlittablePixmapData();
- ~QBlittablePixmapData();
+ QBlittablePlatformPixmap();
+ ~QBlittablePlatformPixmap();
virtual QBlittable *createBlittable(const QSize &size) const = 0;
QBlittable *blittable() const;
};
-inline void QBlittablePixmapData::markRasterOverlay(const QRectF &rect)
+inline void QBlittablePlatformPixmap::markRasterOverlay(const QRectF &rect)
{
#ifdef QT_BLITTER_RASTEROVERLAY
markRasterOverlayImpl(rect);
#endif
}
-inline void QBlittablePixmapData::markRasterOverlay(const QVectorPath &path)
+inline void QBlittablePlatformPixmap::markRasterOverlay(const QVectorPath &path)
{
#ifdef QT_BLITTER_RASTEROVERLAY
markRasterOverlayImpl(path.convertToPainterPath().boundingRect());
#endif
}
-inline void QBlittablePixmapData::markRasterOverlay(const QPointF &pos, const QTextItem &ti)
+inline void QBlittablePlatformPixmap::markRasterOverlay(const QPointF &pos, const QTextItem &ti)
{
#ifdef QT_BLITTER_RASTEROVERLAY
QFontMetricsF fm(ti.font());
#endif
}
-inline void QBlittablePixmapData::markRasterOverlay(const QRect *rects, int rectCount)
+inline void QBlittablePlatformPixmap::markRasterOverlay(const QRect *rects, int rectCount)
{
#ifdef QT_BLITTER_RASTEROVERLAY
for (int i = 0; i < rectCount; i++) {
Q_UNUSED(rectCount)
#endif
}
-inline void QBlittablePixmapData::markRasterOverlay(const QRectF *rects, int rectCount)
+inline void QBlittablePlatformPixmap::markRasterOverlay(const QRectF *rects, int rectCount)
{
#ifdef QT_BLITTER_RASTEROVERLAY
for (int i = 0; i < rectCount; i++) {
#endif
}
-inline void QBlittablePixmapData::unmarkRasterOverlay(const QRectF &rect)
+inline void QBlittablePlatformPixmap::unmarkRasterOverlay(const QRectF &rect)
{
#ifdef QT_BLITTER_RASTEROVERLAY
unmarkRasterOverlayImpl(rect);
QPixmap qt_toRasterPixmap(const QImage &image)
{
- QPixmapData *data =
- new QRasterPixmapData(image.depth() == 1
- ? QPixmapData::BitmapType
- : QPixmapData::PixmapType);
+ QPlatformPixmap *data =
+ new QRasterPlatformPixmap(image.depth() == 1
+ ? QPlatformPixmap::BitmapType
+ : QPlatformPixmap::PixmapType);
data->fromImage(image, Qt::AutoColor);
if (pixmap.isNull())
return QPixmap();
- if (QPixmap(pixmap).data_ptr()->classId() == QPixmapData::RasterClass)
+ if (QPixmap(pixmap).data_ptr()->classId() == QPlatformPixmap::RasterClass)
return pixmap;
return qt_toRasterPixmap(pixmap.toImage());
}
-QRasterPixmapData::QRasterPixmapData(PixelType type)
- : QPixmapData(type, RasterClass)
+QRasterPlatformPixmap::QRasterPlatformPixmap(PixelType type)
+ : QPlatformPixmap(type, RasterClass)
{
}
-QRasterPixmapData::~QRasterPixmapData()
+QRasterPlatformPixmap::~QRasterPlatformPixmap()
{
}
-QPixmapData *QRasterPixmapData::createCompatiblePixmapData() const
+QPlatformPixmap *QRasterPlatformPixmap::createCompatiblePlatformPixmap() const
{
- return new QRasterPixmapData(pixelType());
+ return new QRasterPlatformPixmap(pixelType());
}
-void QRasterPixmapData::resize(int width, int height)
+void QRasterPlatformPixmap::resize(int width, int height)
{
QImage::Format format;
#ifdef Q_WS_QWS
setSerialNumber(image.serialNumber());
}
-bool QRasterPixmapData::fromData(const uchar *buffer, uint len, const char *format,
+bool QRasterPlatformPixmap::fromData(const uchar *buffer, uint len, const char *format,
Qt::ImageConversionFlags flags)
{
QByteArray a = QByteArray::fromRawData(reinterpret_cast<const char *>(buffer), len);
return !isNull();
}
-void QRasterPixmapData::fromImage(const QImage &sourceImage,
+void QRasterPlatformPixmap::fromImage(const QImage &sourceImage,
Qt::ImageConversionFlags flags)
{
Q_UNUSED(flags);
createPixmapForImage(image, flags, /* inplace = */false);
}
-void QRasterPixmapData::fromImageReader(QImageReader *imageReader,
+void QRasterPlatformPixmap::fromImageReader(QImageReader *imageReader,
Qt::ImageConversionFlags flags)
{
Q_UNUSED(flags);
// from qwindowsurface.cpp
extern void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset);
-void QRasterPixmapData::copy(const QPixmapData *data, const QRect &rect)
+void QRasterPlatformPixmap::copy(const QPlatformPixmap *data, const QRect &rect)
{
fromImage(data->toImage(rect).copy(), Qt::NoOpaqueDetection);
}
-bool QRasterPixmapData::scroll(int dx, int dy, const QRect &rect)
+bool QRasterPlatformPixmap::scroll(int dx, int dy, const QRect &rect)
{
if (!image.isNull())
qt_scrollRectInImage(image, rect, QPoint(dx, dy));
return true;
}
-void QRasterPixmapData::fill(const QColor &color)
+void QRasterPlatformPixmap::fill(const QColor &color)
{
uint pixel;
image.fill(pixel);
}
-bool QRasterPixmapData::hasAlphaChannel() const
+bool QRasterPlatformPixmap::hasAlphaChannel() const
{
return image.hasAlphaChannel();
}
-QImage QRasterPixmapData::toImage() const
+QImage QRasterPlatformPixmap::toImage() const
{
if (!image.isNull()) {
QImageData *data = const_cast<QImage &>(image).data_ptr();
return image;
}
-QImage QRasterPixmapData::toImage(const QRect &rect) const
+QImage QRasterPlatformPixmap::toImage(const QRect &rect) const
{
if (rect.isNull())
return image;
return image.copy(clipped);
}
-QPaintEngine* QRasterPixmapData::paintEngine() const
+QPaintEngine* QRasterPlatformPixmap::paintEngine() const
{
return image.paintEngine();
}
-int QRasterPixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
+int QRasterPlatformPixmap::metric(QPaintDevice::PaintDeviceMetric metric) const
{
QImageData *d = image.d;
if (!d)
case QPaintDevice::PdmPhysicalDpiY:
return qt_defaultDpiY();
default:
- qWarning("QRasterPixmapData::metric(): Unhandled metric type %d", metric);
+ qWarning("QRasterPlatformPixmap::metric(): Unhandled metric type %d", metric);
break;
}
return 0;
}
-void QRasterPixmapData::createPixmapForImage(QImage &sourceImage, Qt::ImageConversionFlags flags, bool inPlace)
+void QRasterPlatformPixmap::createPixmapForImage(QImage &sourceImage, Qt::ImageConversionFlags flags, bool inPlace)
{
QImage::Format format;
if (flags & Qt::NoFormatConversion)
setSerialNumber(image.serialNumber());
}
-QImage* QRasterPixmapData::buffer()
+QImage* QRasterPlatformPixmap::buffer()
{
return ℑ
}
// We mean it.
//
-#include <QtGui/private/qpixmapdata_p.h>
-#include <QtGui/private/qpixmapdatafactory_p.h>
+#include <QtGui/qplatformpixmap_qpa.h>
#ifdef Q_WS_WIN
# include "qt_windows.h"
QT_BEGIN_NAMESPACE
-class Q_GUI_EXPORT QRasterPixmapData : public QPixmapData
+class Q_GUI_EXPORT QRasterPlatformPixmap : public QPlatformPixmap
{
public:
- QRasterPixmapData(PixelType type);
- ~QRasterPixmapData();
+ QRasterPlatformPixmap(PixelType type);
+ ~QRasterPlatformPixmap();
- QPixmapData *createCompatiblePixmapData() const;
+ QPlatformPixmap *createCompatiblePlatformPixmap() const;
void resize(int width, int height);
void fromFile(const QString &filename, Qt::ImageConversionFlags flags);
void fromImage(const QImage &image, Qt::ImageConversionFlags flags);
void fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags);
- void copy(const QPixmapData *data, const QRect &rect);
+ void copy(const QPlatformPixmap *data, const QRect &rect);
bool scroll(int dx, int dy, const QRect &rect);
void fill(const QColor &color);
bool hasAlphaChannel() const;
public:
QPixmapCacheEntry(const QPixmapCache::Key &key, const QPixmap &pix) : QPixmap(pix), key(key)
{
- QPixmapData *pd = pixmapData();
- if (pd && pd->classId() == QPixmapData::RasterClass) {
- QRasterPixmapData *d = static_cast<QRasterPixmapData*>(pd);
+ QPlatformPixmap *pd = handle();
+ if (pd && pd->classId() == QPlatformPixmap::RasterClass) {
+ QRasterPlatformPixmap *d = static_cast<QRasterPlatformPixmap*>(pd);
if (!d->image.isNull() && d->image.d->paintEngine
&& !d->image.d->paintEngine->isActive())
{
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qpixmapdatafactory_p.h"
-
-#ifdef Q_WS_QWS
-# include <QtGui/qscreen_qws.h>
-#endif
-#ifdef Q_WS_X11
-# include <private/qpixmap_x11_p.h>
-#endif
-#if defined(Q_WS_WIN)
-# include <private/qpixmap_raster_p.h>
-#endif
-#ifdef Q_WS_MAC
-# include <private/qpixmap_mac_p.h>
-#endif
-#ifdef Q_WS_QPA
-# include <private/qpixmap_raster_p.h>
-#endif
-#ifdef Q_OS_SYMBIAN
-# include <private/qpixmap_s60_p.h>
-#endif
-
-#include "private/qguiapplication_p.h"
-
-QT_BEGIN_NAMESPACE
-
-#if !defined(Q_WS_QWS)
-
-class QSimplePixmapDataFactory : public QPixmapDataFactory
-{
-public:
- ~QSimplePixmapDataFactory() {}
- QPixmapData* create(QPixmapData::PixelType type);
-};
-
-QPixmapData* QSimplePixmapDataFactory::create(QPixmapData::PixelType type)
-{
- // ### should we always use Raster instead?
- return QGuiApplicationPrivate::platformIntegration()->createPixmapData(type);
-}
-
-Q_GLOBAL_STATIC(QSimplePixmapDataFactory, factory)
-
-#endif // !defined(Q_WS_QWS)
-
-QPixmapDataFactory::~QPixmapDataFactory()
-{
-}
-
-QPixmapDataFactory* QPixmapDataFactory::instance(int screen)
-{
- Q_UNUSED(screen);
-#ifdef Q_WS_QWS
- return QScreen::instance()->pixmapDataFactory();
-#else
- return factory();
-#endif
-}
-
-QT_END_NAMESPACE
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPIXMAPDATAFACTORY_P_H
-#define QPIXMAPDATAFACTORY_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/qstring.h>
-#include <QtGui/qimage.h>
-#include <QtGui/private/qpixmapdata_p.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Gui)
-
-class QPixmapData;
-
-class QPixmapDataFactory
-{
-public:
- static QPixmapDataFactory* instance(int screen = 0);
- virtual ~QPixmapDataFactory();
-
- virtual QPixmapData* create(QPixmapData::PixelType type) = 0;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QPIXMAPDATAFACTORY_P_H
**
****************************************************************************/
-#include "qpixmapdata_p.h"
+#include "qplatformpixmap_qpa.h"
#include <QtCore/qbuffer.h>
#include <QtGui/qbitmap.h>
#include <QtGui/qimagereader.h>
QT_BEGIN_NAMESPACE
-QPixmapData *QPixmapData::create(int w, int h, PixelType type)
+QPlatformPixmap *QPlatformPixmap::create(int w, int h, PixelType type)
{
- QPixmapData *data = QGuiApplicationPrivate::platformIntegration()->createPixmapData(static_cast<QPixmapData::PixelType>(type));
+ QPlatformPixmap *data = QGuiApplicationPrivate::platformIntegration()->createPlatformPixmap(static_cast<QPlatformPixmap::PixelType>(type));
data->resize(w, h);
return data;
}
-QPixmapData::QPixmapData(PixelType pixelType, int objectId)
+QPlatformPixmap::QPlatformPixmap(PixelType pixelType, int objectId)
: w(0),
h(0),
d(0),
{
}
-QPixmapData::~QPixmapData()
+QPlatformPixmap::~QPlatformPixmap()
{
// Sometimes the pixmap cleanup hooks will be called from derrived classes, which will
// then set is_cached to false. For example, on X11 QtOpenGL needs to delete the GLXPixmap
// or EGL Pixmap Surface for a given pixmap _before_ the native X11 pixmap is deleted,
- // otherwise some drivers will leak the GL surface. In this case, QX11PixmapData will
+ // otherwise some drivers will leak the GL surface. In this case, QX11PlatformPixmap will
// call the cleanup hooks itself before deleting the native pixmap and set is_cached to
// false.
if (is_cached) {
- QImagePixmapCleanupHooks::executePixmapDataDestructionHooks(this);
+ QImagePixmapCleanupHooks::executePlatformPixmapDestructionHooks(this);
is_cached = false;
}
}
-QPixmapData *QPixmapData::createCompatiblePixmapData() const
+QPlatformPixmap *QPlatformPixmap::createCompatiblePlatformPixmap() const
{
- QPixmapData *d = QGuiApplicationPrivate::platformIntegration()->createPixmapData(pixelType());
+ QPlatformPixmap *d = QGuiApplicationPrivate::platformIntegration()->createPlatformPixmap(pixelType());
return d;
}
-static QImage makeBitmapCompliantIfNeeded(QPixmapData *d, const QImage &image, Qt::ImageConversionFlags flags)
+static QImage makeBitmapCompliantIfNeeded(QPlatformPixmap *d, const QImage &image, Qt::ImageConversionFlags flags)
{
- if (d->pixelType() == QPixmapData::BitmapType) {
+ if (d->pixelType() == QPlatformPixmap::BitmapType) {
QImage img = image.convertToFormat(QImage::Format_MonoLSB, flags);
// make sure image.color(0) == Qt::color0 (white)
return image;
}
-void QPixmapData::fromImageReader(QImageReader *imageReader,
+void QPlatformPixmap::fromImageReader(QImageReader *imageReader,
Qt::ImageConversionFlags flags)
{
const QImage image = imageReader->read();
fromImage(image, flags);
}
-bool QPixmapData::fromFile(const QString &fileName, const char *format,
+bool QPlatformPixmap::fromFile(const QString &fileName, const char *format,
Qt::ImageConversionFlags flags)
{
QImage image = QImageReader(fileName, format).read();
return !isNull();
}
-bool QPixmapData::fromData(const uchar *buf, uint len, const char *format, Qt::ImageConversionFlags flags)
+bool QPlatformPixmap::fromData(const uchar *buf, uint len, const char *format, Qt::ImageConversionFlags flags)
{
QByteArray a = QByteArray::fromRawData(reinterpret_cast<const char *>(buf), len);
QBuffer b(&a);
return !isNull();
}
-void QPixmapData::copy(const QPixmapData *data, const QRect &rect)
+void QPlatformPixmap::copy(const QPlatformPixmap *data, const QRect &rect)
{
fromImage(data->toImage(rect), Qt::NoOpaqueDetection);
}
-bool QPixmapData::scroll(int dx, int dy, const QRect &rect)
+bool QPlatformPixmap::scroll(int dx, int dy, const QRect &rect)
{
Q_UNUSED(dx);
Q_UNUSED(dy);
return false;
}
-QPixmap QPixmapData::transformed(const QTransform &matrix,
- Qt::TransformationMode mode) const
+QPixmap QPlatformPixmap::transformed(const QTransform &matrix,
+ Qt::TransformationMode mode) const
{
return QPixmap::fromImage(toImage().transformed(matrix, mode));
}
-void QPixmapData::setSerialNumber(int serNo)
+void QPlatformPixmap::setSerialNumber(int serNo)
{
ser_no = serNo;
}
-QImage QPixmapData::toImage(const QRect &rect) const
+QImage QPlatformPixmap::toImage(const QRect &rect) const
{
if (rect.contains(QRect(0, 0, w, h)))
return toImage();
return toImage().copy(rect);
}
-QImage* QPixmapData::buffer()
+QImage* QPlatformPixmap::buffer()
{
return 0;
}
#if defined(Q_OS_SYMBIAN)
-void* QPixmapData::toNativeType(NativeType /* type */)
+void* QPlatformPixmap::toNativeType(NativeType /* type */)
{
return 0;
}
-void QPixmapData::fromNativeType(void* /* pixmap */, NativeType /* typre */)
+void QPlatformPixmap::fromNativeType(void* /* pixmap */, NativeType /* typre */)
{
return;
}
class QImageReader;
-class Q_GUI_EXPORT QPixmapData
+class Q_GUI_EXPORT QPlatformPixmap
{
public:
enum PixelType {
enum ClassId { RasterClass, DirectFBClass,
BlitterClass, CustomClass = 1024 };
- QPixmapData(PixelType pixelType, int classId);
- virtual ~QPixmapData();
+ QPlatformPixmap(PixelType pixelType, int classId);
+ virtual ~QPlatformPixmap();
- virtual QPixmapData *createCompatiblePixmapData() const;
+ virtual QPlatformPixmap *createCompatiblePlatformPixmap() const;
virtual void resize(int width, int height) = 0;
virtual void fromImage(const QImage &image,
virtual bool fromData(const uchar *buffer, uint len, const char *format,
Qt::ImageConversionFlags flags);
- virtual void copy(const QPixmapData *data, const QRect &rect);
+ virtual void copy(const QPlatformPixmap *data, const QRect &rect);
virtual bool scroll(int dx, int dy, const QRect &rect);
virtual int metric(QPaintDevice::PaintDeviceMetric metric) const = 0;
| ((qint64) detach_no));
}
- static QPixmapData *create(int w, int h, PixelType type);
+ static QPlatformPixmap *create(int w, int h, PixelType type);
protected:
friend class QPixmap;
friend class QImagePixmapCleanupHooks; // Needs to set is_cached
friend class QGLTextureCache; //Needs to check the reference count
- friend class QExplicitlySharedDataPointer<QPixmapData>;
+ friend class QExplicitlySharedDataPointer<QPlatformPixmap>;
QAtomicInt ref;
int detach_no;
#include "qvolatileimage_p.h"
#include "qvolatileimagedata_p.h"
#include <QtGui/private/qpaintengine_raster_p.h>
-#include <QtGui/private/qpixmapdata_p.h>
+#include <QtGui/qplatformpixmap_qpa.h>
QT_BEGIN_NAMESPACE
}
/*!
- To be called from the PixmapData's paintEngine().
+ To be called from the PlatformPixmap's paintEngine().
*/
QPaintEngine *QVolatileImage::paintEngine()
{
void QVolatileImagePaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm)
{
#ifdef Q_OS_SYMBIAN
- void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage);
+ void *nativeData = pm.handle()->toNativeType(QPlatformPixmap::VolatileImage);
if (nativeData) {
QVolatileImage *img = static_cast<QVolatileImage *>(nativeData);
img->beginDataAccess();
void QVolatileImagePaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr)
{
#ifdef Q_OS_SYMBIAN
- void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage);
+ void *nativeData = pm.handle()->toNativeType(QPlatformPixmap::VolatileImage);
if (nativeData) {
QVolatileImage *img = static_cast<QVolatileImage *>(nativeData);
img->beginDataAccess();
*/
/*!
- \fn QPixmapData *QPlatformIntegration::createPixmapData(QPixmapData::PixelType type) const
+ \fn QPlatformPixmap *QPlatformIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
- Factory function for QPixmapData. PixelType can be either PixmapType or BitmapType.
- \sa QPixmapData
+ Factory function for QPlatformPixmap. PixelType can be either PixmapType or BitmapType.
+ \sa QPlatformPixmap
*/
/*!
#define QPLATFORMINTEGRATION_H
#include <QtGui/qwindowdefs.h>
-#include <QtGui/private/qpixmapdata_p.h>
+#include <QtGui/qplatformpixmap_qpa.h>
#include <QtGui/qplatformscreen_qpa.h>
#include <QtGui/qsurfaceformat.h>
virtual bool hasCapability(Capability cap) const;
// GraphicsSystem functions
- virtual QPixmapData *createPixmapData(QPixmapData::PixelType type) const = 0;
+ virtual QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const = 0;
virtual QPlatformWindow *createPlatformWindow(QWindow *window) const = 0;
virtual QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const = 0;
virtual QPlatformGLContext *createPlatformGLContext(const QSurfaceFormat &format, QPlatformGLContext *share) const;
friend class QWin32PaintEnginePrivate;
friend class QMacCGContext;
friend class QPreviewPaintEngine;
- friend class QX11GLPixmapData;
+ friend class QX11GLPlatformPixmap;
};
bool canBlitterDrawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) const
{
- if (pm.pixmapData()->classId() != QPixmapData::BlitterClass)
+ if (pm.handle()->classId() != QPlatformPixmap::BlitterClass)
return false;
if (checkStateAgainstMask(capabillitiesState,drawPixmapMask)) {
if (m_capabilities & (QBlittable::SourceOverPixmapCapability
{
Q_DECLARE_PUBLIC(QBlitterPaintEngine);
public:
- QBlitterPaintEnginePrivate(QBlittablePixmapData *p)
+ QBlitterPaintEnginePrivate(QBlittablePlatformPixmap *p)
: QPaintEngineExPrivate(),
pmData(p),
isBlitterLocked(false),
QRasterPaintEngine *raster;
- QBlittablePixmapData *pmData;
+ QBlittablePlatformPixmap *pmData;
bool isBlitterLocked;
CapabilitiesToStateMask *capabillities;
uint hasXForm;
};
-QBlitterPaintEngine::QBlitterPaintEngine(QBlittablePixmapData *p)
+QBlitterPaintEngine::QBlitterPaintEngine(QBlittablePlatformPixmap *p)
: QPaintEngineEx(*(new QBlitterPaintEnginePrivate(p)))
{
}
QT_BEGIN_NAMESPACE
class QBlitterPaintEnginePrivate;
-class QBlittablePixmapData;
+class QBlittablePlatformPixmap;
class QBlittable;
class Q_GUI_EXPORT QBlitterPaintEngine : public QPaintEngineEx
{
Q_DECLARE_PRIVATE(QBlitterPaintEngine);
public:
- QBlitterPaintEngine(QBlittablePixmapData *p);
+ QBlitterPaintEngine(QBlittablePlatformPixmap *p);
~QBlitterPaintEngine();
virtual QPainterState *createState(QPainterState *orig) const;
if (device->devType() == QInternal::Pixmap) {
QPixmap *pixmap = static_cast<QPixmap *>(device);
- QPixmapData *pd = pixmap->pixmapData();
- if (pd->classId() == QPixmapData::RasterClass || pd->classId() == QPixmapData::BlitterClass)
+ QPlatformPixmap *pd = pixmap->handle();
+ if (pd->classId() == QPlatformPixmap::RasterClass || pd->classId() == QPlatformPixmap::BlitterClass)
d->device = pd->buffer();
} else {
d->device = device;
qDebug() << " - QRasterPaintEngine::drawPixmap(), pos=" << pos << " pixmap=" << pixmap.size() << "depth=" << pixmap.depth();
#endif
- QPixmapData *pd = pixmap.pixmapData();
- if (pd->classId() == QPixmapData::RasterClass) {
- const QImage &image = static_cast<QRasterPixmapData *>(pd)->image;
+ QPlatformPixmap *pd = pixmap.handle();
+ if (pd->classId() == QPlatformPixmap::RasterClass) {
+ const QImage &image = static_cast<QRasterPlatformPixmap *>(pd)->image;
if (image.depth() == 1) {
Q_D(QRasterPaintEngine);
QRasterPaintEngineState *s = state();
qDebug() << " - QRasterPaintEngine::drawPixmap(), r=" << r << " sr=" << sr << " pixmap=" << pixmap.size() << "depth=" << pixmap.depth();
#endif
- QPixmapData* pd = pixmap.pixmapData();
- if (pd->classId() == QPixmapData::RasterClass) {
- const QImage &image = static_cast<QRasterPixmapData *>(pd)->image;
+ QPlatformPixmap* pd = pixmap.handle();
+ if (pd->classId() == QPlatformPixmap::RasterClass) {
+ const QImage &image = static_cast<QRasterPlatformPixmap *>(pd)->image;
if (image.depth() == 1) {
Q_D(QRasterPaintEngine);
QRasterPaintEngineState *s = state();
QImage image;
- QPixmapData *pd = pixmap.pixmapData();
- if (pd->classId() == QPixmapData::RasterClass) {
- image = static_cast<QRasterPixmapData *>(pd)->image;
+ QPlatformPixmap *pd = pixmap.handle();
+ if (pd->classId() == QPlatformPixmap::RasterClass) {
+ image = static_cast<QRasterPlatformPixmap *>(pd)->image;
} else {
image = pixmap.toImage();
}
#include <qglframebufferobject.h>
#include <private/qimage_p.h>
-#include <private/qpixmapdata_p.h>
+#include <qplatformpixmap_qpa.h>
#include <private/qglpixelbuffer_p.h>
#include <private/qimagepixmapcleanuphooks_p.h>
#include "qcolormap.h"
QGLTextureCache::QGLTextureCache()
: m_cache(64*1024) // cache ~64 MB worth of textures - this is not accurate though
{
- QImagePixmapCleanupHooks::instance()->addPixmapDataModificationHook(cleanupTexturesForPixampData);
- QImagePixmapCleanupHooks::instance()->addPixmapDataDestructionHook(cleanupBeforePixmapDestruction);
+ QImagePixmapCleanupHooks::instance()->addPlatformPixmapModificationHook(cleanupTexturesForPixampData);
+ QImagePixmapCleanupHooks::instance()->addPlatformPixmapDestructionHook(cleanupBeforePixmapDestruction);
QImagePixmapCleanupHooks::instance()->addImageHook(cleanupTexturesForCacheKey);
}
QGLTextureCache::~QGLTextureCache()
{
- QImagePixmapCleanupHooks::instance()->removePixmapDataModificationHook(cleanupTexturesForPixampData);
- QImagePixmapCleanupHooks::instance()->removePixmapDataDestructionHook(cleanupBeforePixmapDestruction);
+ QImagePixmapCleanupHooks::instance()->removePlatformPixmapModificationHook(cleanupTexturesForPixampData);
+ QImagePixmapCleanupHooks::instance()->removePlatformPixmapDestructionHook(cleanupBeforePixmapDestruction);
QImagePixmapCleanupHooks::instance()->removeImageHook(cleanupTexturesForCacheKey);
}
}
-void QGLTextureCache::cleanupTexturesForPixampData(QPixmapData* pmd)
+void QGLTextureCache::cleanupTexturesForPixampData(QPlatformPixmap* pmd)
{
cleanupTexturesForCacheKey(pmd->cacheKey());
}
-void QGLTextureCache::cleanupBeforePixmapDestruction(QPixmapData* pmd)
+void QGLTextureCache::cleanupBeforePixmapDestruction(QPlatformPixmap* pmd)
{
// Remove any bound textures first:
cleanupTexturesForPixampData(pmd);
#if defined(Q_WS_X11)
- if (pmd->classId() == QPixmapData::X11Class) {
+ if (pmd->classId() == QPlatformPixmap::X11Class) {
Q_ASSERT(pmd->ref == 0); // Make sure reference counting isn't broken
QGLContextPrivate::destroyGlSurfaceForPixmap(pmd);
}
QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target, GLint format, QGLContext::BindOptions options)
{
Q_Q(QGLContext);
- QPixmapData *pd = pixmap.pixmapData();
+ QPlatformPixmap *pd = pixmap.handle();
Q_UNUSED(pd);
const qint64 key = pixmap.cacheKey();
#if defined(Q_WS_X11)
// Try to use texture_from_pixmap
const QX11Info *xinfo = qt_x11Info(paintDevice);
- if (pd->classId() == QPixmapData::X11Class && pd->pixelType() == QPixmapData::PixmapType
+ if (pd->classId() == QPlatformPixmap::X11Class && pd->pixelType() == QPlatformPixmap::PixmapType
&& xinfo && xinfo->screen() == pixmap.x11Info().screen()
&& target == GL_TEXTURE_2D
&& QApplication::instance()->thread() == QThread::currentThread())
int old_depth = qt_x11_preferred_pixmap_depth;
qt_x11_preferred_pixmap_depth = x11Info().depth();
- QPixmapData *data = new QX11PixmapData(QPixmapData::PixmapType);
+ QPlatformPixmap *data = new QX11PlatformPixmap(QPlatformPixmap::PixmapType);
data->resize(sz.width(), sz.height());
QPixmap pm(data);
qt_x11_preferred_pixmap_depth = old_depth;
EGLSurface QGLContextPrivate::eglSurfaceForDevice() const
{
- // If a QPixmapData had to create the QGLContext, we don't have a paintDevice
+ // If a QPlatformPixmap had to create the QGLContext, we don't have a paintDevice
if (!paintDevice)
return eglSurface;
#ifdef Q_WS_X11
if (paintDevice->devType() == QInternal::Pixmap) {
- QPixmapData *pmd = static_cast<QPixmap*>(paintDevice)->data_ptr().data();
- if (pmd->classId() == QPixmapData::X11Class) {
- QX11PixmapData* x11PixmapData = static_cast<QX11PixmapData*>(pmd);
- return (EGLSurface)x11PixmapData->gl_surface;
+ QPlatformPixmap *pmd = static_cast<QPixmap*>(paintDevice)->data_ptr().data();
+ if (pmd->classId() == QPlatformPixmap::X11Class) {
+ QX11PlatformPixmap* x11PlatformPixmap = static_cast<QX11PlatformPixmap*>(pmd);
+ return (EGLSurface)x11PlatformPixmap->gl_surface;
}
}
#endif
void* pbuf;
quint32 gpm;
int screen;
- QHash<QPixmapData*, QPixmap> boundPixmaps;
+ QHash<QPlatformPixmap*, QPixmap> boundPixmaps;
QGLTexture *bindTextureFromNativePixmap(QPixmap*, const qint64 key,
QGLContext::BindOptions options);
- static void destroyGlSurfaceForPixmap(QPixmapData*);
- static void unbindPixmapFromTexture(QPixmapData*);
+ static void destroyGlSurfaceForPixmap(QPlatformPixmap*);
+ static void unbindPixmapFromTexture(QPlatformPixmap*);
#endif
#if defined(Q_WS_MAC)
bool update;
public:
QGLTextureDestroyer() : QObject() {
qRegisterMetaType<GLuint>("GLuint");
- connect(this, SIGNAL(freeTexture(QGLContext *, QPixmapData *, GLuint)),
- this, SLOT(freeTexture_slot(QGLContext *, QPixmapData *, GLuint)));
+ connect(this, SIGNAL(freeTexture(QGLContext *, QPlatformPixmap *, GLuint)),
+ this, SLOT(freeTexture_slot(QGLContext *, QPlatformPixmap *, GLuint)));
}
- void emitFreeTexture(QGLContext *context, QPixmapData *boundPixmap, GLuint id) {
+ void emitFreeTexture(QGLContext *context, QPlatformPixmap *boundPixmap, GLuint id) {
emit freeTexture(context, boundPixmap, id);
}
Q_SIGNALS:
- void freeTexture(QGLContext *context, QPixmapData *boundPixmap, GLuint id);
+ void freeTexture(QGLContext *context, QPlatformPixmap *boundPixmap, GLuint id);
private slots:
- void freeTexture_slot(QGLContext *context, QPixmapData *boundPixmap, GLuint id) {
+ void freeTexture_slot(QGLContext *context, QPlatformPixmap *boundPixmap, GLuint id) {
Q_UNUSED(boundPixmap);
#if defined(Q_WS_X11)
if (boundPixmap) {
if (options & QGLContext::MemoryManagedBindOption) {
Q_ASSERT(context);
#if !defined(Q_WS_X11)
- QPixmapData *boundPixmap = 0;
+ QPlatformPixmap *boundPixmap = 0;
#endif
context->d_ptr->texture_destroyer->emitFreeTexture(context, boundPixmap, id);
}
QGLContext::BindOptions options;
#if defined(Q_WS_X11)
- QPixmapData* boundPixmap;
+ QPlatformPixmap* boundPixmap;
#endif
bool canBindCompressedTexture
void removeContextTextures(QGLContext *ctx);
static QGLTextureCache *instance();
static void cleanupTexturesForCacheKey(qint64 cacheKey);
- static void cleanupTexturesForPixampData(QPixmapData* pixmap);
- static void cleanupBeforePixmapDestruction(QPixmapData* pixmap);
+ static void cleanupTexturesForPixampData(QPlatformPixmap* pixmap);
+ static void cleanupBeforePixmapDestruction(QPlatformPixmap* pixmap);
private:
QCache<QGLTextureCacheKey, QGLTexture> m_cache;
#include <private/qwidget_p.h> // to access QWExtra
#include <private/qnativeimagehandleprovider_p.h>
#include "qgl_egl_p.h"
-#include "qpixmapdata_gl_p.h"
+#include "qplatformpixmap_gl_p.h"
#include "qgltexturepool_p.h"
#include "qcolormap.h"
#include <QDebug>
}
}
-void QGLPixmapData::fromNativeType(void* pixmap, NativeType type)
+void QGLPlatformPixmap::fromNativeType(void* pixmap, NativeType type)
{
- if (type == QPixmapData::FbsBitmap) {
+ if (type == QPlatformPixmap::FbsBitmap) {
CFbsBitmap *bitmap = reinterpret_cast<CFbsBitmap *>(pixmap);
QSize size(bitmap->SizeInPixels().iWidth, bitmap->SizeInPixels().iHeight);
if (size.width() == w && size.height() == h)
m_hasFillColor = false;
m_dirty = true;
- } else if (type == QPixmapData::VolatileImage && pixmap) {
+ } else if (type == QPlatformPixmap::VolatileImage && pixmap) {
// Support QS60Style in more efficient skin graphics retrieval.
QVolatileImage *img = static_cast<QVolatileImage *>(pixmap);
if (img->width() == w && img->height() == h)
m_hasAlpha = m_source.hasAlphaChannel();
m_hasFillColor = false;
m_dirty = true;
- } else if (type == QPixmapData::NativeImageHandleProvider && pixmap) {
+ } else if (type == QPlatformPixmap::NativeImageHandleProvider && pixmap) {
destroyTexture();
nativeImageHandleProvider = static_cast<QNativeImageHandleProvider *>(pixmap);
// Cannot defer the retrieval, we need at least the size right away.
}
}
-void* QGLPixmapData::toNativeType(NativeType type)
+void* QGLPlatformPixmap::toNativeType(NativeType type)
{
- if (type == QPixmapData::FbsBitmap) {
+ if (type == QPlatformPixmap::FbsBitmap) {
if (m_source.isNull())
m_source = QVolatileImage(w, h, QImage::Format_ARGB32_Premultiplied);
return m_source.duplicateNativeImage();
return 0;
}
-bool QGLPixmapData::initFromNativeImageHandle(void *handle, const QString &type)
+bool QGLPlatformPixmap::initFromNativeImageHandle(void *handle, const QString &type)
{
if (type == QLatin1String("RSgImage")) {
- fromNativeType(handle, QPixmapData::SgImage);
+ fromNativeType(handle, QPlatformPixmap::SgImage);
return true;
} else if (type == QLatin1String("CFbsBitmap")) {
- fromNativeType(handle, QPixmapData::FbsBitmap);
+ fromNativeType(handle, QPlatformPixmap::FbsBitmap);
return true;
}
return false;
}
-void QGLPixmapData::createFromNativeImageHandleProvider()
+void QGLPlatformPixmap::createFromNativeImageHandleProvider()
{
void *handle = 0;
QString type;
nativeImageHandle = handle;
nativeImageType = type;
} else {
- qWarning("QGLPixmapData: Unknown native image type '%s'", qPrintable(type));
+ qWarning("QGLPlatformPixmap: Unknown native image type '%s'", qPrintable(type));
}
} else {
- qWarning("QGLPixmapData: Native handle is null");
+ qWarning("QGLPlatformPixmap: Native handle is null");
}
}
-void QGLPixmapData::releaseNativeImageHandle()
+void QGLPlatformPixmap::releaseNativeImageHandle()
{
if (nativeImageHandleProvider && nativeImageHandle) {
nativeImageHandleProvider->release(nativeImageHandle, nativeImageType);
Q_Q(QGLContext);
- QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(pixmap->data_ptr().data());
- Q_ASSERT(pixmapData->classId() == QPixmapData::X11Class);
+ QX11PlatformPixmap *handle = static_cast<QX11PlatformPixmap*>(pixmap->data_ptr().data());
+ Q_ASSERT(handle->classId() == QPlatformPixmap::X11Class);
// We can't use TFP if the pixmap has a separate X11 mask
- if (pixmapData->x11_mask)
+ if (handle->x11_mask)
return 0;
if (!qt_resolveTextureFromPixmap(paintDevice))
return 0;
- const QX11Info &x11Info = pixmapData->xinfo;
+ const QX11Info &x11Info = handle->xinfo;
// Store the configs (Can be static because configs aren't dependent on current context)
static GLXFBConfig glxRGBPixmapConfig = 0;
static GLXFBConfig glxRGBAPixmapConfig = 0;
static bool RGBAConfigInverted = false;
- bool hasAlpha = pixmapData->hasAlphaChannel();
+ bool hasAlpha = handle->hasAlphaChannel();
// Check to see if we need a config
if ( (hasAlpha && !glxRGBAPixmapConfig) || (!hasAlpha && !glxRGBPixmapConfig) ) {
}
// Check to see if the surface is still valid
- if (pixmapData->gl_surface &&
- hasAlpha != (pixmapData->flags & QX11PixmapData::GlSurfaceCreatedWithAlpha))
+ if (handle->gl_surface &&
+ hasAlpha != (handle->flags & QX11PlatformPixmap::GlSurfaceCreatedWithAlpha))
{
// Surface is invalid!
- destroyGlSurfaceForPixmap(pixmapData);
+ destroyGlSurfaceForPixmap(handle);
}
// Check to see if we need a surface
- if (!pixmapData->gl_surface) {
+ if (!handle->gl_surface) {
GLXPixmap glxPixmap;
int pixmapAttribs[] = {
GLX_TEXTURE_FORMAT_EXT, hasAlpha ? GLX_TEXTURE_FORMAT_RGBA_EXT : GLX_TEXTURE_FORMAT_RGB_EXT,
// Wrap the X Pixmap into a GLXPixmap:
glxPixmap = glXCreatePixmap(x11Info.display(),
hasAlpha ? glxRGBAPixmapConfig : glxRGBPixmapConfig,
- pixmapData->handle(), pixmapAttribs);
+ handle->handle(), pixmapAttribs);
if (!glxPixmap)
return 0;
- pixmapData->gl_surface = (void*)glxPixmap;
+ handle->gl_surface = (void*)glxPixmap;
// Make sure the cleanup hook gets called so we can delete the glx pixmap
- QImagePixmapCleanupHooks::enableCleanupHooks(pixmapData);
+ QImagePixmapCleanupHooks::enableCleanupHooks(handle);
}
GLuint textureId;
glGenTextures(1, &textureId);
glBindTexture(GL_TEXTURE_2D, textureId);
- glXBindTexImageEXT(x11Info.display(), (GLXPixmap)pixmapData->gl_surface, GLX_FRONT_LEFT_EXT, 0);
+ glXBindTexImageEXT(x11Info.display(), (GLXPixmap)handle->gl_surface, GLX_FRONT_LEFT_EXT, 0);
glBindTexture(GL_TEXTURE_2D, textureId);
GLuint filtering = (options & QGLContext::LinearFilteringBindOption) ? GL_LINEAR : GL_NEAREST;
QGLTexture *texture = new QGLTexture(q, textureId, GL_TEXTURE_2D, options);
if (texture->options & QGLContext::InvertedYBindOption)
- pixmapData->flags |= QX11PixmapData::InvertedWhenBoundToTexture;
+ handle->flags |= QX11PlatformPixmap::InvertedWhenBoundToTexture;
// We assume the cost of bound pixmaps is zero
QGLTextureCache::instance()->insert(q, key, texture, 0);
}
-void QGLContextPrivate::destroyGlSurfaceForPixmap(QPixmapData* pmd)
+void QGLContextPrivate::destroyGlSurfaceForPixmap(QPlatformPixmap* pmd)
{
#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
- Q_ASSERT(pmd->classId() == QPixmapData::X11Class);
- QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(pmd);
- if (pixmapData->gl_surface) {
- glXDestroyPixmap(QX11Info::display(), (GLXPixmap)pixmapData->gl_surface);
- pixmapData->gl_surface = 0;
+ Q_ASSERT(pmd->classId() == QPlatformPixmap::X11Class);
+ QX11PlatformPixmap *handle = static_cast<QX11PlatformPixmap*>(pmd);
+ if (handle->gl_surface) {
+ glXDestroyPixmap(QX11Info::display(), (GLXPixmap)handle->gl_surface);
+ handle->gl_surface = 0;
}
#endif
}
-void QGLContextPrivate::unbindPixmapFromTexture(QPixmapData* pmd)
+void QGLContextPrivate::unbindPixmapFromTexture(QPlatformPixmap* pmd)
{
#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
- Q_ASSERT(pmd->classId() == QPixmapData::X11Class);
+ Q_ASSERT(pmd->classId() == QPlatformPixmap::X11Class);
Q_ASSERT(QGLContext::currentContext());
- QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(pmd);
- if (pixmapData->gl_surface)
- glXReleaseTexImageEXT(QX11Info::display(), (GLXPixmap)pixmapData->gl_surface, GLX_FRONT_LEFT_EXT);
+ QX11PlatformPixmap *handle = static_cast<QX11PlatformPixmap*>(pmd);
+ if (handle->gl_surface)
+ glXReleaseTexImageEXT(QX11Info::display(), (GLXPixmap)handle->gl_surface, GLX_FRONT_LEFT_EXT);
#endif
}
int devType = device()->devType();
- QX11PixmapData *x11PixmapData = 0;
+ QX11PlatformPixmap *x11PlatformPixmap = 0;
if (devType == QInternal::Pixmap) {
- QPixmapData *pmd = static_cast<QPixmap*>(device())->data_ptr().data();
- if (pmd->classId() == QPixmapData::X11Class)
- x11PixmapData = static_cast<QX11PixmapData*>(pmd);
+ QPlatformPixmap *pmd = static_cast<QPixmap*>(device())->data_ptr().data();
+ if (pmd->classId() == QPlatformPixmap::X11Class)
+ x11PlatformPixmap = static_cast<QX11PlatformPixmap*>(pmd);
else {
- // TODO: Replace the pixmap's data with a new QX11PixmapData
+ // TODO: Replace the pixmap's data with a new QX11PlatformPixmap
qWarning("WARNING: Creating a QGLContext on a QPixmap is only supported for X11 pixmap backend");
return false;
}
// Do don't create the EGLSurface for everything.
// QWidget - yes, create the EGLSurface and store it in QGLContextPrivate::eglSurface
// QGLWidget - yes, create the EGLSurface and store it in QGLContextPrivate::eglSurface
- // QPixmap - yes, create the EGLSurface but store it in QX11PixmapData::gl_surface
+ // QPixmap - yes, create the EGLSurface but store it in QX11PlatformPixmap::gl_surface
// QGLPixelBuffer - no, it creates the surface itself and stores it in QGLPixelBufferPrivate::pbuf
if (devType == QInternal::Widget) {
setWindowCreated(true);
}
- if (x11PixmapData) {
+ if (x11PlatformPixmap) {
// TODO: Actually check to see if the existing surface can be re-used
- if (x11PixmapData->gl_surface)
- eglDestroySurface(d->eglContext->display(), (EGLSurface)x11PixmapData->gl_surface);
+ if (x11PlatformPixmap->gl_surface)
+ eglDestroySurface(d->eglContext->display(), (EGLSurface)x11PlatformPixmap->gl_surface);
- x11PixmapData->gl_surface = (void*)QEgl::createSurface(device(), d->eglContext->config());
+ x11PlatformPixmap->gl_surface = (void*)QEgl::createSurface(device(), d->eglContext->config());
}
return true;
return 0;
- QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(pixmap->data_ptr().data());
- Q_ASSERT(pixmapData->classId() == QPixmapData::X11Class);
- bool hasAlpha = pixmapData->hasAlphaChannel();
+ QX11PlatformPixmap *handle = static_cast<QX11PlatformPixmap*>(pixmap->data_ptr().data());
+ Q_ASSERT(handle->classId() == QPlatformPixmap::X11Class);
+ bool hasAlpha = handle->hasAlphaChannel();
bool pixmapHasValidSurface = false;
bool textureIsBound = false;
GLuint textureId;
glGenTextures(1, &textureId);
glBindTexture(GL_TEXTURE_2D, textureId);
- if (haveTFP && pixmapData->gl_surface &&
- hasAlpha == (pixmapData->flags & QX11PixmapData::GlSurfaceCreatedWithAlpha))
+ if (haveTFP && handle->gl_surface &&
+ hasAlpha == (handle->flags & QX11PlatformPixmap::GlSurfaceCreatedWithAlpha))
{
pixmapHasValidSurface = true;
}
// If we already have a valid EGL surface for the pixmap, we should use it
if (pixmapHasValidSurface) {
EGLBoolean success;
- success = eglBindTexImage(QEgl::display(), (EGLSurface)pixmapData->gl_surface, EGL_BACK_BUFFER);
+ success = eglBindTexImage(QEgl::display(), (EGLSurface)handle->gl_surface, EGL_BACK_BUFFER);
if (success == EGL_FALSE) {
qWarning() << "eglBindTexImage() failed:" << QEgl::errorString();
- eglDestroySurface(QEgl::display(), (EGLSurface)pixmapData->gl_surface);
- pixmapData->gl_surface = (void*)EGL_NO_SURFACE;
+ eglDestroySurface(QEgl::display(), (EGLSurface)handle->gl_surface);
+ handle->gl_surface = (void*)EGL_NO_SURFACE;
} else
textureIsBound = true;
}
if (!textureIsBound && haveTFP) {
// Check to see if the surface is still valid
- if (pixmapData->gl_surface &&
- hasAlpha != (pixmapData->flags & QX11PixmapData::GlSurfaceCreatedWithAlpha))
+ if (handle->gl_surface &&
+ hasAlpha != (handle->flags & QX11PlatformPixmap::GlSurfaceCreatedWithAlpha))
{
// Surface is invalid!
- destroyGlSurfaceForPixmap(pixmapData);
+ destroyGlSurfaceForPixmap(handle);
}
- if (pixmapData->gl_surface == 0) {
+ if (handle->gl_surface == 0) {
EGLConfig config = QEgl::defaultConfig(QInternal::Pixmap,
QEgl::OpenGL,
hasAlpha ? QEgl::Translucent : QEgl::NoOptions);
- pixmapData->gl_surface = (void*)QEgl::createSurface(pixmap, config);
- if (pixmapData->gl_surface == (void*)EGL_NO_SURFACE)
+ handle->gl_surface = (void*)QEgl::createSurface(pixmap, config);
+ if (handle->gl_surface == (void*)EGL_NO_SURFACE)
return false;
}
EGLBoolean success;
- success = eglBindTexImage(QEgl::display(), (EGLSurface)pixmapData->gl_surface, EGL_BACK_BUFFER);
+ success = eglBindTexImage(QEgl::display(), (EGLSurface)handle->gl_surface, EGL_BACK_BUFFER);
if (success == EGL_FALSE) {
qWarning() << "eglBindTexImage() failed:" << QEgl::errorString();
- eglDestroySurface(QEgl::display(), (EGLSurface)pixmapData->gl_surface);
- pixmapData->gl_surface = (void*)EGL_NO_SURFACE;
+ eglDestroySurface(QEgl::display(), (EGLSurface)handle->gl_surface);
+ handle->gl_surface = (void*)EGL_NO_SURFACE;
haveTFP = false; // If TFP isn't working, disable it's use
} else
textureIsBound = true;
if (textureIsBound) {
texture = new QGLTexture(q, textureId, GL_TEXTURE_2D, options);
- pixmapData->flags |= QX11PixmapData::InvertedWhenBoundToTexture;
+ handle->flags |= QX11PlatformPixmap::InvertedWhenBoundToTexture;
// We assume the cost of bound pixmaps is zero
QGLTextureCache::instance()->insert(q, key, texture, 0);
}
-void QGLContextPrivate::destroyGlSurfaceForPixmap(QPixmapData* pmd)
+void QGLContextPrivate::destroyGlSurfaceForPixmap(QPlatformPixmap* pmd)
{
- Q_ASSERT(pmd->classId() == QPixmapData::X11Class);
- QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(pmd);
- if (pixmapData->gl_surface) {
+ Q_ASSERT(pmd->classId() == QPlatformPixmap::X11Class);
+ QX11PlatformPixmap *handle = static_cast<QX11PlatformPixmap*>(pmd);
+ if (handle->gl_surface) {
EGLBoolean success;
- success = eglDestroySurface(QEgl::display(), (EGLSurface)pixmapData->gl_surface);
+ success = eglDestroySurface(QEgl::display(), (EGLSurface)handle->gl_surface);
if (success == EGL_FALSE) {
qWarning() << "destroyGlSurfaceForPixmap() - Error deleting surface: "
<< QEgl::errorString();
}
- pixmapData->gl_surface = 0;
+ handle->gl_surface = 0;
}
}
-void QGLContextPrivate::unbindPixmapFromTexture(QPixmapData* pmd)
+void QGLContextPrivate::unbindPixmapFromTexture(QPlatformPixmap* pmd)
{
- Q_ASSERT(pmd->classId() == QPixmapData::X11Class);
- QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(pmd);
- if (pixmapData->gl_surface) {
+ Q_ASSERT(pmd->classId() == QPlatformPixmap::X11Class);
+ QX11PlatformPixmap *handle = static_cast<QX11PlatformPixmap*>(pmd);
+ if (handle->gl_surface) {
EGLBoolean success;
success = eglReleaseTexImage(QEgl::display(),
- (EGLSurface)pixmapData->gl_surface,
+ (EGLSurface)handle->gl_surface,
EGL_BACK_BUFFER);
if (success == EGL_FALSE) {
qWarning() << "unbindPixmapFromTexture() - Unable to release bound texture: "
#include "private/qpixmapfilter_p.h"
#include "private/qpaintengineex_opengl2_p.h"
#include "private/qglengineshadermanager_p.h"
-#include "private/qpixmapdata_p.h"
+#include "qplatformpixmap_qpa.h"
#include "private/qimagepixmapcleanuphooks_p.h"
#include "qglpixmapfilter_p.h"
#include "qpaintengine_opengl_p.h"
void timerEvent(QTimerEvent *event);
private:
- static void pixmapDestroyed(QPixmapData *pixmap);
+ static void pixmapDestroyed(QPlatformPixmap *pixmap);
QCache<quint64, QGLBlurTextureInfo > cache;
{
static bool hookAdded = false;
if (!hookAdded) {
- QImagePixmapCleanupHooks::instance()->addPixmapDataDestructionHook(pixmapDestroyed);
- QImagePixmapCleanupHooks::instance()->addPixmapDataModificationHook(pixmapDestroyed);
+ QImagePixmapCleanupHooks::instance()->addPlatformPixmapDestructionHook(pixmapDestroyed);
+ QImagePixmapCleanupHooks::instance()->addPlatformPixmapModificationHook(pixmapDestroyed);
hookAdded = true;
}
timerId = startTimer(8000);
}
-void QGLBlurTextureCache::pixmapDestroyed(QPixmapData *pmd)
+void QGLBlurTextureCache::pixmapDestroyed(QPlatformPixmap *pmd)
{
foreach (QGLBlurTextureCache *cache, blurTextureCaches) {
if (cache->hasBlurTextureInfo(pmd->cacheKey()))
~QCocoaIntegration();
bool hasCapability(QPlatformIntegration::Capability cap) const;
- QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
+ QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const;
QPlatformWindow *createPlatformWindow(QWindow *window) const;
QPlatformGLContext *createPlatformGLContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share) const;
QPlatformBackingStore *createPlatformBackingStore(QWindow *widget) const;
-QPixmapData *QCocoaIntegration::createPixmapData(QPixmapData::PixelType type) const
+QPlatformPixmap *QCocoaIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
{
- return new QRasterPixmapData(type);
+ return new QRasterPlatformPixmap(type);
}
QPlatformWindow *QCocoaIntegration::createPlatformWindow(QWindow *window) const
void QDirectFbBlitter::drawPixmap(const QRectF &rect, const QPixmap &pixmap, const QRectF &srcRect)
{
- QPixmapData *data = pixmap.pixmapData();
+ QPlatformPixmap *data = pixmap.handle();
Q_ASSERT(data->width() && data->height());
- Q_ASSERT(data->classId() == QPixmapData::BlitterClass);
- QBlittablePixmapData *blitPm = static_cast<QBlittablePixmapData*>(data);
+ Q_ASSERT(data->classId() == QPlatformPixmap::BlitterClass);
+ QBlittablePlatformPixmap *blitPm = static_cast<QBlittablePlatformPixmap*>(data);
QDirectFbBlitter *dfbBlitter = static_cast<QDirectFbBlitter *>(blitPm->blittable());
dfbBlitter->unlock();
friend class QDirectFbConvenience;
};
-class QDirectFbBlitterPixmapData : public QBlittablePixmapData
+class QDirectFbBlitterPlatformPixmap : public QBlittablePlatformPixmap
{
public:
QBlittable *createBlittable(const QSize &size) const { return new QDirectFbBlitter(size); }
return ((0x1f << 7) & format) >> 7;
}
-IDirectFBSurface *QDirectFbConvenience::dfbSurfaceForPixmapData(QPixmapData *pixmapData)
+IDirectFBSurface *QDirectFbConvenience::dfbSurfaceForPlatformPixmap(QPlatformPixmap *handle)
{
- QBlittablePixmapData *blittablePmData = static_cast<QBlittablePixmapData *>(pixmapData);
+ QBlittablePlatformPixmap *blittablePmData = static_cast<QBlittablePlatformPixmap *>(handle);
if (blittablePmData) {
QBlittable *blittable = blittablePmData->blittable();
QDirectFbBlitter *dfbBlitter = static_cast<QDirectFbBlitter *>(blittable);
static IDirectFB *dfbInterface();
static IDirectFBDisplayLayer *dfbDisplayLayer(int display = DLID_PRIMARY);
- static IDirectFBSurface *dfbSurfaceForPixmapData(QPixmapData *);
+ static IDirectFBSurface *dfbSurfaceForPlatformPixmap(QPlatformPixmap *);
static Qt::MouseButton mouseButton(DFBInputDeviceButtonIdentifier identifier);
static Qt::MouseButtons mouseButtons(DFBInputDeviceButtonMask mask);
map = cursor->pixmap();
}
- IDirectFBSurface *surface = QDirectFbConvenience::dfbSurfaceForPixmapData(map.pixmapData());
+ IDirectFBSurface *surface = QDirectFbConvenience::dfbSurfaceForPlatformPixmap(map.handle());
if (m_layer->SetCooperativeLevel(m_layer, DLSCL_ADMINISTRATIVE) != DFB_OK) {
return;
#include <private/qpixmap_raster_p.h>
#include <QtGui/private/qpixmap_blitter_p.h>
-#include <QtGui/private/qpixmapdata_p.h>
+#include <QtGui/qplatformpixmap_qpa.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QThread>
#include <QtCore/QAbstractEventDispatcher>
delete mInput;
}
-QPixmapData *QDirectFbIntegration::createPixmapData(QPixmapData::PixelType type) const
+QPlatformPixmap *QDirectFbIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
{
- if (type == QPixmapData::BitmapType)
- return new QRasterPixmapData(type);
+ if (type == QPlatformPixmap::BitmapType)
+ return new QRasterPlatformPixmap(type);
else
- return new QDirectFbBlitterPixmapData;
+ return new QDirectFbBlitterPlatformPixmap;
}
QPlatformWindow *QDirectFbIntegration::createPlatformWindow(QWidget *widget, WId winId) const
QDirectFbIntegration();
~QDirectFbIntegration();
- QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
+ QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const;
QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId = 0) const;
QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const;
QAbstractEventDispatcher *createEventDispatcher() const;
dfbWindow->GetSurface(dfbWindow,&m_dfbSurface);
//WRONGSIZE
QDirectFbBlitter *blitter = new QDirectFbBlitter(window->rect().size(), m_dfbSurface);
- m_pmdata = new QDirectFbBlitterPixmapData;
+ m_pmdata = new QDirectFbBlitterPlatformPixmap;
m_pmdata->setBlittable(blitter);
m_pixmap = new QPixmap(m_pmdata);
}
void lockSurfaceToImage();
QPixmap *m_pixmap;
- QBlittablePixmapData *m_pmdata;
+ QBlittablePlatformPixmap *m_pmdata;
IDirectFBSurface *m_dfbSurface;
};
}
}
-QPixmapData *QEglFSIntegration::createPixmapData(QPixmapData::PixelType type) const
+QPlatformPixmap *QEglFSIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
{
#ifdef QEGL_EXTRA_DEBUG
- qWarning("QEglIntegration::createPixmapData %d\n", type);
+ qWarning("QEglIntegration::createPlatformPixmap %d\n", type);
#endif
- return new QRasterPixmapData(type);
+ return new QRasterPlatformPixmap(type);
}
QPlatformWindow *QEglFSIntegration::createPlatformWindow(QWidget *widget, WId winId) const
QEglFSIntegration();
bool hasCapability(QPlatformIntegration::Capability cap) const;
- QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
+ QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const;
QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId) const;
QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const;
}
-QPixmapData *QLinuxFbIntegration::createPixmapData(QPixmapData::PixelType type) const
+QPlatformPixmap *QLinuxFbIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
{
- return new QRasterPixmapData(type);
+ return new QRasterPlatformPixmap(type);
}
QWindowSurface *QLinuxFbIntegration::createWindowSurface(QWidget *widget, WId) const
bool hasCapability(QPlatformIntegration::Capability cap) const;
- QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
+ QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const;
QPlatformWindow *createPlatformWindow(QWidget *widget, WId WinId) const;
QWindowSurface *createWindowSurface(QWidget *widget, WId WinId) const;
QAbstractEventDispatcher *createEventDispatcher() const;
}
}
-QPixmapData *QMinimalIntegration::createPixmapData(QPixmapData::PixelType type) const
+QPlatformPixmap *QMinimalIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
{
- return new QRasterPixmapData(type);
+ return new QRasterPlatformPixmap(type);
}
QPlatformWindow *QMinimalIntegration::createPlatformWindow(QWindow *window) const
bool hasCapability(QPlatformIntegration::Capability cap) const;
- QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
+ QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const;
QPlatformWindow *createPlatformWindow(QWindow *window) const;
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
QAbstractEventDispatcher *createEventDispatcher() const;
#include "qopenkodewindow.h"
#include "qopenkodeeventloopintegration.h"
-#include <QtOpenGL/private/qpixmapdata_gl_p.h>
+#include <QtOpenGL/qplatformpixmap_gl_p.h>
#include <QtOpenGL/private/qwindowsurface_gl_p.h>
#include <QtGui/private/qpixmap_raster_p.h>
}
}
-QPixmapData *QOpenKODEIntegration::createPixmapData(QPixmapData::PixelType type) const
+QPlatformPixmap *QOpenKODEIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
{
- return new QGLPixmapData(type);
+ return new QGLPlatformPixmap(type);
}
QPlatformWindow *QOpenKODEIntegration::createPlatformWindow(QWidget *tlw, WId ) const
bool hasCapability(QPlatformIntegration::Capability cap) const;
- QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
+ QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const;
QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId = 0) const;
QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const;
#include "qgraphicssystem_vglite.h"
#include "qwindowsurface_vglite.h"
-#include <QtOpenVG/private/qpixmapdata_vg_p.h>
+#include <QtOpenVG/qplatformpixmap_vg_p.h>
#include <QtGui/private/qegl_p.h>
#include <QtCore/qdebug.h>
#ifdef OPENVG_USBHP_INIT
{
}
-QPixmapData *QVGLiteGraphicsSystem::createPixmapData(QPixmapData::PixelType type) const
+QPlatformPixmap *QVGLiteGraphicsSystem::createPlatformPixmap(QPlatformPixmap::PixelType type) const
{
#if !defined(QVGLite_NO_SINGLE_CONTEXT) && !defined(QVGLite_NO_PIXMAP_DATA)
- // Pixmaps can use QVGLitePixmapData; bitmaps must use raster.
- if (type == QPixmapData::PixmapType)
- return new QVGPixmapData(type);
+ // Pixmaps can use QVGLitePlatformPixmap; bitmaps must use raster.
+ if (type == QPlatformPixmap::PixmapType)
+ return new QVGPlatformPixmap(type);
else
- return new QRasterPixmapData(type);
+ return new QRasterPlatformPixmap(type);
#else
- return new QRasterPixmapData(type);
+ return new QRasterPlatformPixmap(type);
#endif
}
QVGLiteGraphicsSystem();
~QVGLiteGraphicsSystem();
- QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
+ QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const;
QWindowSurface *createWindowSurface(QWidget *widget) const;
QList<QGraphicsSystemScreen *> screens() const { return mScreens; }
mScreens.append(mPrimaryScreen);
}
-QPixmapData *QVFbIntegration::createPixmapData(QPixmapData::PixelType type) const
+QPlatformPixmap *QVFbIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
{
- return new QRasterPixmapData(type);
+ return new QRasterPlatformPixmap(type);
}
QWindowSurface *QVFbIntegration::createWindowSurface(QWidget *widget, WId) const
public:
QVFbIntegration(const QStringList ¶mList);
- QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
+ QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const;
QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId) const;
QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const;
QAbstractEventDispatcher *createEventDispatcher() const;
QUIKitIntegration();
~QUIKitIntegration();
- QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
+ QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const;
QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId = 0) const;
QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const;
{
}
-QPixmapData *QUIKitIntegration::createPixmapData(QPixmapData::PixelType type) const
+QPlatformPixmap *QUIKitIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
{
- return new QRasterPixmapData(type);
+ return new QRasterPlatformPixmap(type);
}
QPlatformWindow *QUIKitIntegration::createPlatformWindow(QWidget *widget, WId winId) const
}
-QPixmapData *QVNCIntegration::createPixmapData(QPixmapData::PixelType type) const
+QPlatformPixmap *QVNCIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
{
- return new QRasterPixmapData(type);
+ return new QRasterPlatformPixmap(type);
}
QWindowSurface *QVNCIntegration::createWindowSurface(QWidget *widget, WId) const
QVNCIntegration(const QStringList& paramList);
bool hasCapability(QPlatformIntegration::Capability cap) const;
- QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
+ QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const;
QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId) const;
QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const;
QAbstractEventDispatcher createEventDispatcher() const;
}
}
-QPixmapData *QWaylandIntegration::createPixmapData(QPixmapData::PixelType type) const
+QPlatformPixmap *QWaylandIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
{
- return new QRasterPixmapData(type);
+ return new QRasterPlatformPixmap(type);
}
QPlatformWindow *QWaylandIntegration::createPlatformWindow(QWindow *window) const
QWaylandIntegration();
bool hasCapability(QPlatformIntegration::Capability cap) const;
- QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
+ QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const;
QPlatformWindow *createPlatformWindow(QWindow *window) const;
QPlatformGLContext *createPlatformGLContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share) const;
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
}
}
-QPixmapData *QXcbIntegration::createPixmapData(QPixmapData::PixelType type) const
+QPlatformPixmap *QXcbIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
{
- return new QRasterPixmapData(type);
+ return new QRasterPlatformPixmap(type);
}
QPlatformWindow *QXcbIntegration::createPlatformWindow(QWindow *window) const
~QXcbIntegration();
bool hasCapability(Capability cap) const;
- QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
+ QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const;
QPlatformWindow *createPlatformWindow(QWindow *window) const;
QPlatformGLContext *createPlatformGLContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share) const;
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
#include <EGL/egl.h>
#endif //!defined(QT_OPENGL_ES_2)
#include <private/qwindowsurface_gl_p.h>
-#include <private/qpixmapdata_gl_p.h>
+#include <qplatformpixmap_gl_p.h>
#endif //QT_NO_OPENGL
QT_BEGIN_NAMESPACE
}
}
-QPixmapData *QXlibIntegration::createPixmapData(QPixmapData::PixelType type) const
+QPlatformPixmap *QXlibIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
{
#ifndef QT_NO_OPENGL
if (mUseOpenGL)
- return new QGLPixmapData(type);
+ return new QGLPlatformPixmap(type);
#endif
- return new QRasterPixmapData(type);
+ return new QRasterPlatformPixmap(type);
}
QWindowSurface *QXlibIntegration::createWindowSurface(QWidget *widget, WId) const
QXlibIntegration(bool useOpenGL = false);
bool hasCapability(Capability cap) const;
- QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
+ QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const;
QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId) const;
QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const;
QAbstractEventDispatcher *createEventDispatcher() const;
QT_MODULE(Gui)
class QPainter;
-class QPixmapData;
+class QPlatformPixmap;
class QPixmapFilterPrivate;
CGContextRef ret = 0;
// It would make sense to put this into a mac #ifdef'ed
- // virtual function in the QPixmapData at some point
- if (pm->data->classId() == QPixmapData::MacClass) {
- const QMacPixmapData *pmData = static_cast<const QMacPixmapData*>(pm->data.data());
+ // virtual function in the QPlatformPixmap at some point
+ if (pm->data->classId() == QPlatformPixmap::MacClass) {
+ const QMacPlatformPixmap *pmData = static_cast<const QMacPlatformPixmap*>(pm->data.data());
ret = CGBitmapContextCreate(pmData->pixels, pmData->w, pmData->h,
8, pmData->bytesPerRow, colorspace,
flags);
if(!ret)
qWarning("QPaintDevice: Unable to create context for pixmap (%d/%d/%d)",
pmData->w, pmData->h, (pmData->bytesPerRow * pmData->h));
- } else if (pm->data->classId() == QPixmapData::RasterClass) {
+ } else if (pm->data->classId() == QPlatformPixmap::RasterClass) {
QImage *image = pm->data->buffer();
ret = CGBitmapContextCreate(image->bits(), image->width(), image->height(),
8, image->bytesPerLine(), colorspace, flags);
Q_WIDGETS_EXPORT quint32 *qt_mac_pixmap_get_base(const QPixmap *pix)
{
if (QApplicationPrivate::graphics_system_name == QLatin1String("raster"))
- return reinterpret_cast<quint32 *>(static_cast<QRasterPixmapData*>(pix->data.data())->buffer()->bits());
+ return reinterpret_cast<quint32 *>(static_cast<QRasterPlatformPixmap*>(pix->data.data())->buffer()->bits());
else
- return static_cast<QMacPixmapData*>(pix->data.data())->pixels;
+ return static_cast<QMacPlatformPixmap*>(pix->data.data())->pixels;
}
Q_WIDGETS_EXPORT int qt_mac_pixmap_get_bytes_per_line(const QPixmap *pix)
{
if (QApplicationPrivate::graphics_system_name == QLatin1String("raster"))
- return static_cast<QRasterPixmapData*>(pix->data.data())->buffer()->bytesPerLine();
+ return static_cast<QRasterPlatformPixmap*>(pix->data.data())->buffer()->bytesPerLine();
else
- return static_cast<QMacPixmapData*>(pix->data.data())->bytesPerRow;
+ return static_cast<QMacPlatformPixmap*>(pix->data.data())->bytesPerRow;
}
void qt_mac_cgimage_data_free(void *info, const void *memoryToFree, size_t)
{
- QMacPixmapData *pmdata = static_cast<QMacPixmapData *>(info);
+ QMacPlatformPixmap *pmdata = static_cast<QMacPlatformPixmap *>(info);
if (!pmdata) {
free(const_cast<void *>(memoryToFree));
} else {
- if (QMacPixmapData::validDataPointers.contains(pmdata) == false) {
+ if (QMacPlatformPixmap::validDataPointers.contains(pmdata) == false) {
free(const_cast<void *>(memoryToFree));
return;
}
return qRgb(tr,tg,tb);
}
-QSet<QMacPixmapData*> QMacPixmapData::validDataPointers;
+QSet<QMacPlatformPixmap*> QMacPlatformPixmap::validDataPointers;
-QMacPixmapData::QMacPixmapData(PixelType type)
- : QPixmapData(type, MacClass), has_alpha(0), has_mask(0),
+QMacPlatformPixmap::QMacPlatformPixmap(PixelType type)
+ : QPlatformPixmap(type, MacClass), has_alpha(0), has_mask(0),
uninit(true), pixels(0), pixelsSize(0), pixelsToFree(0),
bytesPerRow(0), cg_data(0), cg_dataBeingReleased(0), cg_mask(0),
pengine(0)
{
}
-QPixmapData *QMacPixmapData::createCompatiblePixmapData() const
+QPlatformPixmap *QMacPlatformPixmap::createCompatiblePlatformPixmap() const
{
- return new QMacPixmapData(pixelType());
+ return new QMacPlatformPixmap(pixelType());
}
#define BEST_BYTE_ALIGNMENT 16
#define COMPTUE_BEST_BYTES_PER_ROW(bpr) \
(((bpr) + (BEST_BYTE_ALIGNMENT - 1)) & ~(BEST_BYTE_ALIGNMENT - 1))
-void QMacPixmapData::resize(int width, int height)
+void QMacPlatformPixmap::resize(int width, int height)
{
setSerialNumber(++qt_pixmap_serial);
#undef COMPUTE_BEST_BYTES_PER_ROW
-void QMacPixmapData::fromImage(const QImage &img,
+void QMacPlatformPixmap::fromImage(const QImage &img,
Qt::ImageConversionFlags flags)
{
setSerialNumber(++qt_pixmap_serial);
return qi->colorCount();
}
-QImage QMacPixmapData::toImage() const
+QImage QMacPlatformPixmap::toImage() const
{
QImage::Format format = QImage::Format_MonoLSB;
if (d != 1) //Doesn't support index color modes
return image;
}
-void QMacPixmapData::fill(const QColor &fillColor)
+void QMacPlatformPixmap::fill(const QColor &fillColor)
{
{ //we don't know what backend to use so we cannot paint here
macSetHasAlpha(true);
}
-QPixmap QMacPixmapData::alphaChannel() const
+QPixmap QMacPlatformPixmap::alphaChannel() const
{
if (!has_alpha)
return QPixmap();
- QMacPixmapData *alpha = new QMacPixmapData(PixmapType);
+ QMacPlatformPixmap *alpha = new QMacPlatformPixmap(PixmapType);
alpha->resize(w, h);
macGetAlphaChannel(alpha, false);
return QPixmap(alpha);
}
-void QMacPixmapData::setAlphaChannel(const QPixmap &alpha)
+void QMacPlatformPixmap::setAlphaChannel(const QPixmap &alpha)
{
has_mask = true;
- QMacPixmapData *alphaData = static_cast<QMacPixmapData*>(alpha.data.data());
+ QMacPlatformPixmap *alphaData = static_cast<QMacPlatformPixmap*>(alpha.data.data());
macSetAlphaChannel(alphaData, false);
}
-QBitmap QMacPixmapData::mask() const
+QBitmap QMacPlatformPixmap::mask() const
{
if (!has_mask && !has_alpha)
return QBitmap();
- QMacPixmapData *mask = new QMacPixmapData(BitmapType);
+ QMacPlatformPixmap *mask = new QMacPlatformPixmap(BitmapType);
mask->resize(w, h);
macGetAlphaChannel(mask, true);
return QPixmap(mask);
}
-void QMacPixmapData::setMask(const QBitmap &mask)
+void QMacPlatformPixmap::setMask(const QBitmap &mask)
{
if (mask.isNull()) {
- QMacPixmapData opaque(PixmapType);
+ QMacPlatformPixmap opaque(PixmapType);
opaque.resize(w, h);
opaque.fill(QColor(255, 255, 255, 255));
macSetAlphaChannel(&opaque, true);
has_alpha = false;
has_mask = true;
- QMacPixmapData *maskData = static_cast<QMacPixmapData*>(mask.data.data());
+ QMacPlatformPixmap *maskData = static_cast<QMacPlatformPixmap*>(mask.data.data());
macSetAlphaChannel(maskData, true);
}
-int QMacPixmapData::metric(QPaintDevice::PaintDeviceMetric theMetric) const
+int QMacPlatformPixmap::metric(QPaintDevice::PaintDeviceMetric theMetric) const
{
switch (theMetric) {
case QPaintDevice::PdmWidth:
return 0;
}
-QMacPixmapData::~QMacPixmapData()
+QMacPlatformPixmap::~QMacPlatformPixmap()
{
validDataPointers.remove(this);
if (cg_mask) {
free(pixelsToFree);
}
-void QMacPixmapData::macSetAlphaChannel(const QMacPixmapData *pix, bool asMask)
+void QMacPlatformPixmap::macSetAlphaChannel(const QMacPlatformPixmap *pix, bool asMask)
{
if (!pixels || !h || !w || pix->w != w || pix->h != h)
return;
macSetHasAlpha(true);
}
-void QMacPixmapData::macGetAlphaChannel(QMacPixmapData *pix, bool asMask) const
+void QMacPlatformPixmap::macGetAlphaChannel(QMacPlatformPixmap *pix, bool asMask) const
{
quint32 *dptr = pix->pixels, *drow;
const uint dbpr = pix->bytesPerRow;
}
}
-void QMacPixmapData::macSetHasAlpha(bool b)
+void QMacPlatformPixmap::macSetHasAlpha(bool b)
{
has_alpha = b;
macReleaseCGImageRef();
}
-void QMacPixmapData::macCreateCGImageRef()
+void QMacPlatformPixmap::macCreateCGImageRef()
{
Q_ASSERT(cg_data == 0);
//create the cg data
cgflags, provider, 0, 0, kCGRenderingIntentDefault);
}
-void QMacPixmapData::macReleaseCGImageRef()
+void QMacPlatformPixmap::macReleaseCGImageRef()
{
if (!cg_data)
return; // There's nothing we need to do
// We create our space in memory to paint on here. If we already have existing pixels
// copy them over. This is to preserve the fact that CGImageRef's are immutable.
-void QMacPixmapData::macCreatePixels()
+void QMacPlatformPixmap::macCreatePixels()
{
const int numBytes = bytesPerRow * h;
quint32 *base_pixels;
}
#if 0
-QPixmap QMacPixmapData::transformed(const QTransform &transform,
+QPixmap QMacPlatformPixmap::transformed(const QTransform &transform,
Qt::TransformationMode mode) const
{
int w, h; // size of target pixmap
return QPixmap();
// create destination
- QMacPixmapData *pm = new QMacPixmapData(pixelType(), w, h);
+ QMacPlatformPixmap *pm = new QMacPlatformPixmap(pixelType(), w, h);
const quint32 *sptr = pixels;
quint32 *dptr = pm->pixels;
memset(dptr, 0, (pm->bytesPerRow * pm->h));
// do the transform
if (mode == Qt::SmoothTransformation) {
-#warning QMacPixmapData::transformed not properly implemented
- qWarning("QMacPixmapData::transformed not properly implemented");
+#warning QMacPlatformPixmap::transformed not properly implemented
+ qWarning("QMacPlatformPixmap::transformed not properly implemented");
#if 0
QPainter p(&pm);
p.setRenderHint(QPainter::Antialiasing);
if (!qt_xForm_helper(mat, 0, QT_XFORM_TYPE_MSBFIRST, bpp,
(uchar*)dptr, xbpl, (pm->bytesPerRow) - xbpl,
h, (uchar*)sptr, (bytesPerRow), ws, hs)) {
- qWarning("QMacPixmapData::transform(): failure");
+ qWarning("QMacPlatformPixmap::transform(): failure");
return QPixmap();
}
}
if (isNull())
return 0;
- if (data->classId() == QPixmapData::MacClass) {
- QMacPixmapData *d = static_cast<QMacPixmapData *>(data.data());
+ if (data->classId() == QPlatformPixmap::MacClass) {
+ QMacPlatformPixmap *d = static_cast<QMacPlatformPixmap *>(data.data());
if (!d->cg_data)
d->macCreateCGImageRef();
CGImageRef ret = d->cg_data;
CGImageRetain(ret);
return ret;
- } else if (data->classId() == QPixmapData::RasterClass) {
- return qt_mac_image_to_cgimage(static_cast<QRasterPixmapData *>(data.data())->image);
+ } else if (data->classId() == QPlatformPixmap::RasterClass) {
+ return qt_mac_image_to_cgimage(static_cast<QRasterPlatformPixmap *>(data.data())->image);
}
return 0;
}
-bool QMacPixmapData::hasAlphaChannel() const
+bool QMacPlatformPixmap::hasAlphaChannel() const
{
return has_alpha;
}
CGImageRef qt_mac_create_imagemask(const QPixmap &pixmap, const QRectF &sr)
{
- QMacPixmapData *px = static_cast<QMacPixmapData*>(pixmap.data.data());
+ QMacPlatformPixmap *px = static_cast<QMacPlatformPixmap*>(pixmap.data.data());
if (px->cg_mask) {
if (px->cg_mask_rect == sr) {
CGImageRetain(px->cg_mask); //reference for the caller
#endif
/*! \internal */
-QPaintEngine* QMacPixmapData::paintEngine() const
+QPaintEngine* QMacPlatformPixmap::paintEngine() const
{
if (!pengine) {
- QMacPixmapData *that = const_cast<QMacPixmapData*>(this);
+ QMacPlatformPixmap *that = const_cast<QMacPlatformPixmap*>(this);
that->pengine = new QCoreGraphicsPaintEngine();
}
return pengine;
}
-void QMacPixmapData::copy(const QPixmapData *data, const QRect &rect)
+void QMacPlatformPixmap::copy(const QPlatformPixmap *data, const QRect &rect)
{
if (data->pixelType() == BitmapType) {
QBitmap::fromImage(toImage().copy(rect));
return;
}
- const QMacPixmapData *macData = static_cast<const QMacPixmapData*>(data);
+ const QMacPlatformPixmap *macData = static_cast<const QMacPlatformPixmap*>(data);
resize(rect.width(), rect.height());
has_mask = macData->has_mask;
}
-bool QMacPixmapData::scroll(int dx, int dy, const QRect &rect)
+bool QMacPlatformPixmap::scroll(int dx, int dy, const QRect &rect)
{
Q_UNUSED(dx);
Q_UNUSED(dy);
// We mean it.
//
-#include <QtGui/private/qpixmapdata_p.h>
-#include <QtGui/private/qpixmapdatafactory_p.h>
+#include <QtGui/qplatformpixmap_qpa.h>
+#include <QtGui/qplatformpixmapfactory_p.h>
#include <QtGui/private/qt_mac_p.h>
QT_BEGIN_NAMESPACE
-class QMacPixmapData : public QPixmapData
+class QMacPlatformPixmap : public QPlatformPixmap
{
public:
- QMacPixmapData(PixelType type);
- ~QMacPixmapData();
+ QMacPlatformPixmap(PixelType type);
+ ~QMacPlatformPixmap();
- QPixmapData *createCompatiblePixmapData() const;
+ QPlatformPixmap *createCompatiblePlatformPixmap() const;
void resize(int width, int height);
void fromImage(const QImage &image, Qt::ImageConversionFlags flags);
- void copy(const QPixmapData *data, const QRect &rect);
+ void copy(const QPlatformPixmap *data, const QRect &rect);
bool scroll(int dx, int dy, const QRect &rect);
int metric(QPaintDevice::PaintDeviceMetric metric) const;
uint has_alpha : 1, has_mask : 1, uninit : 1;
void macSetHasAlpha(bool b);
- void macGetAlphaChannel(QMacPixmapData *, bool asMask) const;
- void macSetAlphaChannel(const QMacPixmapData *, bool asMask);
+ void macGetAlphaChannel(QMacPlatformPixmap *, bool asMask) const;
+ void macSetAlphaChannel(const QMacPlatformPixmap *, bool asMask);
void macCreateCGImageRef();
void macCreatePixels();
void macReleaseCGImageRef();
uint bytesPerRow;
QRectF cg_mask_rect;
CGImageRef cg_data, cg_dataBeingReleased, cg_mask;
- static QSet<QMacPixmapData*> validDataPointers;
+ static QSet<QMacPlatformPixmap*> validDataPointers;
QPaintEngine *pengine;
qt_S60Beep = 0;
}
QFontCache::cleanup(); // Has to happen now, since QFontEngineS60 has FBS handles
- QPixmapCache::clear(); // Has to happen now, since QS60PixmapData has FBS handles
+ QPixmapCache::clear(); // Has to happen now, since QS60PlatformPixmap has FBS handles
#ifdef QT_NO_FREETYPE
qt_cleanup_symbianFontDatabase();
QS60PaintEnginePrivate() {}
};
-QS60PaintEngine::QS60PaintEngine(QPaintDevice *device, QS60PixmapData *data)
- : QRasterPaintEngine(*(new QS60PaintEnginePrivate), device), pixmapData(data)
+QS60PaintEngine::QS60PaintEngine(QPaintDevice *device, QS60PlatformPixmap *data)
+ : QRasterPaintEngine(*(new QS60PaintEnginePrivate), device), handle(data)
{
}
{
Q_D(QS60PaintEngine);
- if (pixmapData->classId() == QPixmapData::RasterClass) {
- pixmapData->beginDataAccess();
+ if (handle->classId() == QPlatformPixmap::RasterClass) {
+ handle->beginDataAccess();
bool ret = QRasterPaintEngine::begin(device);
// Make sure QPaintEngine::paintDevice() returns the proper device.
- // QRasterPaintEngine changes pdev to QImage in case of RasterClass QPixmapData
+ // QRasterPaintEngine changes pdev to QImage in case of RasterClass QPlatformPixmap
// which is incorrect in Symbian.
d->pdev = device;
return ret;
bool QS60PaintEngine::end()
{
- if (pixmapData->classId() == QPixmapData::RasterClass) {
+ if (handle->classId() == QPlatformPixmap::RasterClass) {
bool ret = QRasterPaintEngine::end();
- pixmapData->endDataAccess();
+ handle->endDataAccess();
return ret;
}
return QRasterPaintEngine::end();
void QS60PaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm)
{
- if (pm.pixmapData()->classId() == QPixmapData::RasterClass) {
- QS60PixmapData *srcData = static_cast<QS60PixmapData *>(pm.pixmapData());
+ if (pm.handle()->classId() == QPlatformPixmap::RasterClass) {
+ QS60PlatformPixmap *srcData = static_cast<QS60PlatformPixmap *>(pm.handle());
srcData->beginDataAccess();
QRasterPaintEngine::drawPixmap(p, pm);
srcData->endDataAccess();
} else {
- void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage);
+ void *nativeData = pm.handle()->toNativeType(QPlatformPixmap::VolatileImage);
if (nativeData) {
QVolatileImage *img = static_cast<QVolatileImage *>(nativeData);
img->beginDataAccess();
void QS60PaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr)
{
- if (pm.pixmapData()->classId() == QPixmapData::RasterClass) {
- QS60PixmapData *srcData = static_cast<QS60PixmapData *>(pm.pixmapData());
+ if (pm.handle()->classId() == QPlatformPixmap::RasterClass) {
+ QS60PlatformPixmap *srcData = static_cast<QS60PlatformPixmap *>(pm.handle());
srcData->beginDataAccess();
QRasterPaintEngine::drawPixmap(r, pm, sr);
srcData->endDataAccess();
} else {
- void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage);
+ void *nativeData = pm.handle()->toNativeType(QPlatformPixmap::VolatileImage);
if (nativeData) {
QVolatileImage *img = static_cast<QVolatileImage *>(nativeData);
img->beginDataAccess();
void QS60PaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr)
{
- if (pm.pixmapData()->classId() == QPixmapData::RasterClass) {
- QS60PixmapData *srcData = static_cast<QS60PixmapData *>(pm.pixmapData());
+ if (pm.handle()->classId() == QPlatformPixmap::RasterClass) {
+ QS60PlatformPixmap *srcData = static_cast<QS60PlatformPixmap *>(pm.handle());
srcData->beginDataAccess();
QRasterPaintEngine::drawTiledPixmap(r, pm, sr);
srcData->endDataAccess();
QT_BEGIN_NAMESPACE
class QS60PaintEnginePrivate;
-class QS60PixmapData;
+class QS60PlatformPixmap;
class QS60PaintEngine : public QRasterPaintEngine
{
Q_DECLARE_PRIVATE(QS60PaintEngine)
public:
- QS60PaintEngine(QPaintDevice *device, QS60PixmapData* data);
+ QS60PaintEngine(QPaintDevice *device, QS60PlatformPixmap* data);
bool begin(QPaintDevice *device);
bool end();
void prepare(QImage* image);
private:
- QS60PixmapData *pixmapData;
+ QS60PlatformPixmap *handle;
};
QT_END_NAMESPACE
0x10, 0x20, 0x40, 0x80 };
static bool cleanup_function_registered = false;
-static QS60PixmapData *firstPixmap = 0;
+static QS60PlatformPixmap *firstPixmap = 0;
// static
-void QS60PixmapData::qt_symbian_register_pixmap(QS60PixmapData *pd)
+void QS60PlatformPixmap::qt_symbian_register_pixmap(QS60PlatformPixmap *pd)
{
if (!cleanup_function_registered) {
qAddPostRoutine(qt_symbian_release_pixmaps);
}
// static
-void QS60PixmapData::qt_symbian_unregister_pixmap(QS60PixmapData *pd)
+void QS60PlatformPixmap::qt_symbian_unregister_pixmap(QS60PlatformPixmap *pd)
{
if (pd->next)
pd->next->prev = pd->prev;
}
// static
-void QS60PixmapData::qt_symbian_release_pixmaps()
+void QS60PlatformPixmap::qt_symbian_release_pixmaps()
{
- // Scan all QS60PixmapData objects in the system and destroy them.
- QS60PixmapData *pd = firstPixmap;
+ // Scan all QS60PlatformPixmap objects in the system and destroy them.
+ QS60PlatformPixmap *pd = firstPixmap;
while (pd != 0) {
pd->release();
pd = pd->next;
*/
CFbsBitmap *QPixmap::toSymbianCFbsBitmap() const
{
- QPixmapData *data = pixmapData();
+ QPlatformPixmap *data = handle();
if (!data || data->isNull())
return 0;
- return reinterpret_cast<CFbsBitmap*>(data->toNativeType(QPixmapData::FbsBitmap));
+ return reinterpret_cast<CFbsBitmap*>(data->toNativeType(QPlatformPixmap::FbsBitmap));
}
/*!
if (!bitmap)
return QPixmap();
- QScopedPointer<QPixmapData> data(QPixmapData::create(0,0, QPixmapData::PixmapType));
- data->fromNativeType(reinterpret_cast<void*>(bitmap), QPixmapData::FbsBitmap);
+ QScopedPointer<QPlatformPixmap> data(QPlatformPixmap::create(0,0, QPlatformPixmap::PixmapType));
+ data->fromNativeType(reinterpret_cast<void*>(bitmap), QPlatformPixmap::FbsBitmap);
QPixmap pixmap(data.take());
return pixmap;
}
-QS60PixmapData::QS60PixmapData(PixelType type) : QRasterPixmapData(type),
+QS60PlatformPixmap::QS60PlatformPixmap(PixelType type) : QRasterPlatformPixmap(type),
symbianBitmapDataAccess(new QSymbianBitmapDataAccess),
cfbsBitmap(0),
pengine(0),
qt_symbian_register_pixmap(this);
}
-QS60PixmapData::~QS60PixmapData()
+QS60PlatformPixmap::~QS60PlatformPixmap()
{
release();
delete symbianBitmapDataAccess;
qt_symbian_unregister_pixmap(this);
}
-void QS60PixmapData::resize(int width, int height)
+void QS60PlatformPixmap::resize(int width, int height)
{
if (width <= 0 || height <= 0) {
w = width;
}
}
-void QS60PixmapData::release()
+void QS60PlatformPixmap::release()
{
if (cfbsBitmap) {
QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock);
/*!
* Takes ownership of bitmap. Used by window surface
*/
-void QS60PixmapData::fromSymbianBitmap(CFbsBitmap* bitmap, bool lockFormat)
+void QS60PlatformPixmap::fromSymbianBitmap(CFbsBitmap* bitmap, bool lockFormat)
{
Q_ASSERT(bitmap);
}
}
-QImage QS60PixmapData::toImage(const QRect &r) const
+QImage QS60PlatformPixmap::toImage(const QRect &r) const
{
- QS60PixmapData *that = const_cast<QS60PixmapData*>(this);
+ QS60PlatformPixmap *that = const_cast<QS60PlatformPixmap*>(this);
that->beginDataAccess();
QImage copy = that->image.copy(r);
that->endDataAccess();
return copy;
}
-void QS60PixmapData::fromImage(const QImage &img, Qt::ImageConversionFlags flags)
+void QS60PlatformPixmap::fromImage(const QImage &img, Qt::ImageConversionFlags flags)
{
release();
}
}
-void QS60PixmapData::copy(const QPixmapData *data, const QRect &rect)
+void QS60PlatformPixmap::copy(const QPlatformPixmap *data, const QRect &rect)
{
- const QS60PixmapData *s60Data = static_cast<const QS60PixmapData*>(data);
+ const QS60PlatformPixmap *s60Data = static_cast<const QS60PlatformPixmap*>(data);
fromImage(s60Data->toImage(rect), Qt::AutoColor | Qt::OrderedAlphaDither);
}
-bool QS60PixmapData::scroll(int dx, int dy, const QRect &rect)
+bool QS60PlatformPixmap::scroll(int dx, int dy, const QRect &rect)
{
beginDataAccess();
- bool res = QRasterPixmapData::scroll(dx, dy, rect);
+ bool res = QRasterPlatformPixmap::scroll(dx, dy, rect);
endDataAccess();
return res;
}
-int QS60PixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
+int QS60PlatformPixmap::metric(QPaintDevice::PaintDeviceMetric metric) const
{
if (!cfbsBitmap)
return 0;
}
-void QS60PixmapData::fill(const QColor &color)
+void QS60PlatformPixmap::fill(const QColor &color)
{
if (color.alpha() != 255) {
QImage im(width(), height(), QImage::Format_ARGB32_Premultiplied);
fromImage(im, Qt::AutoColor | Qt::OrderedAlphaDither);
} else {
beginDataAccess();
- QRasterPixmapData::fill(color);
+ QRasterPlatformPixmap::fill(color);
endDataAccess();
}
}
-void QS60PixmapData::setMask(const QBitmap &mask)
+void QS60PlatformPixmap::setMask(const QBitmap &mask)
{
if (mask.size().isEmpty()) {
if (image.depth() != 1) {
}
} else if (image.depth() == 1) {
beginDataAccess();
- QRasterPixmapData::setMask(mask);
+ QRasterPlatformPixmap::setMask(mask);
endDataAccess();
} else {
const int w = image.width();
}
}
-void QS60PixmapData::setAlphaChannel(const QPixmap &alphaChannel)
+void QS60PlatformPixmap::setAlphaChannel(const QPixmap &alphaChannel)
{
QImage img(toImage());
img.setAlphaChannel(alphaChannel.toImage());
fromImage(img, Qt::OrderedDither | Qt::OrderedAlphaDither);
}
-QImage QS60PixmapData::toImage() const
+QImage QS60PlatformPixmap::toImage() const
{
return toImage(QRect());
}
-QPaintEngine* QS60PixmapData::paintEngine() const
+QPaintEngine* QS60PlatformPixmap::paintEngine() const
{
if (!pengine) {
- QS60PixmapData *that = const_cast<QS60PixmapData*>(this);
+ QS60PlatformPixmap *that = const_cast<QS60PlatformPixmap*>(this);
that->pengine = new QS60PaintEngine(&that->image, that);
}
return pengine;
}
-void QS60PixmapData::beginDataAccess()
+void QS60PlatformPixmap::beginDataAccess()
{
if(!cfbsBitmap)
return;
}
}
-void QS60PixmapData::endDataAccess(bool readOnly) const
+void QS60PlatformPixmap::endDataAccess(bool readOnly) const
{
Q_UNUSED(readOnly);
if (!sgImage)
return QPixmap();
- QScopedPointer<QPixmapData> data(QPixmapData::create(0,0, QPixmapData::PixmapType));
- data->fromNativeType(reinterpret_cast<void*>(sgImage), QPixmapData::SgImage);
+ QScopedPointer<QPlatformPixmap> data(QPlatformPixmap::create(0,0, QPlatformPixmap::PixmapType));
+ data->fromNativeType(reinterpret_cast<void*>(sgImage), QPlatformPixmap::SgImage);
QPixmap pixmap(data.take());
return pixmap;
}
if (isNull())
return 0;
- RSgImage *sgImage = reinterpret_cast<RSgImage*>(pixmapData()->toNativeType(QPixmapData::SgImage));
+ RSgImage *sgImage = reinterpret_cast<RSgImage*>(handle()->toNativeType(QPlatformPixmap::SgImage));
return sgImage;
}
-void* QS60PixmapData::toNativeType(NativeType type)
+void* QS60PlatformPixmap::toNativeType(NativeType type)
{
- if (type == QPixmapData::SgImage) {
+ if (type == QPlatformPixmap::SgImage) {
return 0;
- } else if (type == QPixmapData::FbsBitmap) {
+ } else if (type == QPlatformPixmap::FbsBitmap) {
if (isNull() || !cfbsBitmap)
return 0;
return 0;
}
-void QS60PixmapData::fromNativeType(void* pixmap, NativeType nativeType)
+void QS60PlatformPixmap::fromNativeType(void* pixmap, NativeType nativeType)
{
- if (nativeType == QPixmapData::SgImage) {
+ if (nativeType == QPlatformPixmap::SgImage) {
return;
- } else if (nativeType == QPixmapData::FbsBitmap && pixmap) {
+ } else if (nativeType == QPlatformPixmap::FbsBitmap && pixmap) {
CFbsBitmap *bitmap = reinterpret_cast<CFbsBitmap*>(pixmap);
type = (format != QImage::Format_MonoLSB)
- ? QPixmapData::PixmapType
- : QPixmapData::BitmapType;
+ ? QPlatformPixmap::PixmapType
+ : QPlatformPixmap::BitmapType;
if (needsCopy) {
}
}
-void QS60PixmapData::convertToDisplayMode(int mode)
+void QS60PlatformPixmap::convertToDisplayMode(int mode)
{
const TDisplayMode displayMode = static_cast<TDisplayMode>(mode);
if (!cfbsBitmap || cfbsBitmap->DisplayMode() == displayMode)
UPDATE_BUFFER();
}
-QPixmapData *QS60PixmapData::createCompatiblePixmapData() const
+QPlatformPixmap *QS60PlatformPixmap::createCompatiblePlatformPixmap() const
{
- return new QS60PixmapData(pixelType());
+ return new QS60PlatformPixmap(pixelType());
}
QT_END_NAMESPACE
bool wasLocked;
};
-class QS60PixmapData : public QRasterPixmapData
+class QS60PlatformPixmap : public QRasterPlatformPixmap
{
public:
- QS60PixmapData(PixelType type);
- ~QS60PixmapData();
+ QS60PlatformPixmap(PixelType type);
+ ~QS60PlatformPixmap();
- QPixmapData *createCompatiblePixmapData() const;
+ QPlatformPixmap *createCompatiblePlatformPixmap() const;
void resize(int width, int height);
void fromImage(const QImage &image, Qt::ImageConversionFlags flags);
- void copy(const QPixmapData *data, const QRect &rect);
+ void copy(const QPlatformPixmap *data, const QRect &rect);
bool scroll(int dx, int dy, const QRect &rect);
int metric(QPaintDevice::PaintDeviceMetric metric) const;
bool formatLocked;
- QS60PixmapData *next;
- QS60PixmapData *prev;
+ QS60PlatformPixmap *next;
+ QS60PlatformPixmap *prev;
- static void qt_symbian_register_pixmap(QS60PixmapData *pd);
- static void qt_symbian_unregister_pixmap(QS60PixmapData *pd);
+ static void qt_symbian_register_pixmap(QS60PlatformPixmap *pd);
+ static void qt_symbian_unregister_pixmap(QS60PlatformPixmap *pd);
static void qt_symbian_release_pixmaps();
friend class QPixmap;
return 0;
HBITMAP bitmap = 0;
- if (data->classId() == QPixmapData::RasterClass) {
- QRasterPixmapData* d = static_cast<QRasterPixmapData*>(data.data());
+ if (data->classId() == QPlatformPixmap::RasterClass) {
+ QRasterPlatformPixmap* d = static_cast<QRasterPlatformPixmap*>(data.data());
int w = d->image.width();
int h = d->image.height();
memcpy(pixels + y * bytes_per_line, image.scanLine(y), bytes_per_line);
} else {
- QPixmapData *data = new QRasterPixmapData(depth() == 1 ?
- QPixmapData::BitmapType : QPixmapData::PixmapType);
+ QPlatformPixmap *data = new QRasterPlatformPixmap(depth() == 1 ?
+ QPlatformPixmap::BitmapType : QPlatformPixmap::PixmapType);
data->fromImage(toImage(), Qt::AutoColor);
return QPixmap(data).toWinHBITMAP(format);
}
fg.green = 0;
fg.blue = 0;
QImage image = QApplicationPrivate::instance()->getPixmapCursor(cshape).toImage();
- pm = QX11PixmapData::createBitmapFromImage(image);
- pmm = QX11PixmapData::createBitmapFromImage(image.createAlphaMask().convertToFormat(QImage::Format_MonoLSB));
+ pm = QX11PlatformPixmap::createBitmapFromImage(image);
+ pmm = QX11PlatformPixmap::createBitmapFromImage(image.createAlphaMask().convertToFormat(QImage::Format_MonoLSB));
hcurs = XCreatePixmapCursor(dpy, pm, pmm, &fg, &bg, 8, 8);
}
if (w <= 0 || h <= 0)
return QBitmap();
- QPixmapData *data = new QX11PixmapData(QPixmapData::BitmapType);
+ QPlatformPixmap *data = new QX11PlatformPixmap(QPlatformPixmap::BitmapType);
data->resize(w, h);
QPixmap bm(data);
QPainter p(&bm);
d->picture = (::Picture)w->x11PictureHandle();
} else if (pdev->devType() == QInternal::Pixmap) {
const QPixmap *pm = static_cast<const QPixmap *>(pdev);
- QX11PixmapData *data = static_cast<QX11PixmapData*>(pm->data.data());
+ QX11PlatformPixmap *data = static_cast<QX11PlatformPixmap*>(pm->data.data());
if (X11->use_xrender && data->depth() != 32 && data->x11_mask)
data->convertToARGB32();
d->picture = (::Picture)static_cast<const QPixmap *>(pdev)->x11PictureHandle();
XRenderPictureAttributes attrs;
attrs.repeat = true;
XRenderChangePicture(d->dpy, d->brush_pm.x11PictureHandle(), CPRepeat, &attrs);
- QX11PixmapData *data = static_cast<QX11PixmapData*>(d->brush_pm.data.data());
+ QX11PlatformPixmap *data = static_cast<QX11PlatformPixmap*>(d->brush_pm.data.data());
if (data->mask_picture)
XRenderChangePicture(d->dpy, data->mask_picture, CPRepeat, &attrs);
}
#ifndef QT_NO_XRENDER
if (d->pdev_depth == 32 && d->brush_pm.depth() != 32) {
d->brush_pm.detach();
- QX11PixmapData *brushData = static_cast<QX11PixmapData*>(d->brush_pm.data.data());
+ QX11PlatformPixmap *brushData = static_cast<QX11PlatformPixmap*>(d->brush_pm.data.data());
brushData->convertToARGB32();
}
#endif
vals.tile = (d->brush_pm.depth() == d->pdev_depth
? d->brush_pm.handle()
- : static_cast<QX11PixmapData*>(d->brush_pm.data.data())->x11ConvertToDefaultDepth());
+ : static_cast<QX11PlatformPixmap*>(d->brush_pm.data.data())->x11ConvertToDefaultDepth());
s = FillTiled;
#if !defined(QT_NO_XRENDER)
d->current_brush = d->cbrush.texture().x11PictureHandle();
QPixmap::x11SetDefaultScreen(pixmap.x11Info().screen());
#ifndef QT_NO_XRENDER
- ::Picture src_pict = static_cast<QX11PixmapData*>(pixmap.data.data())->picture;
+ ::Picture src_pict = static_cast<QX11PlatformPixmap*>(pixmap.data.data())->picture;
if (src_pict && d->picture) {
const int pDepth = pixmap.depth();
if (pDepth == 1 && (d->has_alpha_pen)) {
bool mono_dst = d->pdev_depth == 1;
bool restore_clip = false;
- if (static_cast<QX11PixmapData*>(pixmap.data.data())->x11_mask) { // pixmap has a mask
+ if (static_cast<QX11PlatformPixmap*>(pixmap.data.data())->x11_mask) { // pixmap has a mask
QBitmap comb(sw, sh);
GC cgc = XCreateGC(d->dpy, comb.handle(), 0, 0);
XSetForeground(d->dpy, cgc, 0);
XSetFillStyle(d->dpy, cgc, FillOpaqueStippled);
XSetTSOrigin(d->dpy, cgc, -sx, -sy);
XSetStipple(d->dpy, cgc,
- static_cast<QX11PixmapData*>(pixmap.data.data())->x11_mask);
+ static_cast<QX11PlatformPixmap*>(pixmap.data.data())->x11_mask);
XFillRectangle(d->dpy, comb.handle(), cgc, 0, 0, sw, sh);
XFreeGC(d->dpy, cgc);
if (d->pdev->devType() == QInternal::Pixmap) {
const QPixmap *px = static_cast<const QPixmap*>(d->pdev);
- Pixmap src_mask = static_cast<QX11PixmapData*>(pixmap.data.data())->x11_mask;
- Pixmap dst_mask = static_cast<QX11PixmapData*>(px->data.data())->x11_mask;
+ Pixmap src_mask = static_cast<QX11PlatformPixmap*>(pixmap.data.data())->x11_mask;
+ Pixmap dst_mask = static_cast<QX11PlatformPixmap*>(px->data.data())->x11_mask;
if (dst_mask) {
GC cgc = XCreateGC(d->dpy, dst_mask, 0, 0);
if (src_mask) { // copy src mask into dst mask
#endif
} else
#endif // !QT_NO_XRENDER
- if (pixmap.depth() > 1 && !static_cast<QX11PixmapData*>(pixmap.data.data())->x11_mask) {
+ if (pixmap.depth() > 1 && !static_cast<QX11PlatformPixmap*>(pixmap.data.data())->x11_mask) {
XSetTile(d->dpy, d->gc, pixmap.handle());
XSetFillStyle(d->dpy, d->gc, FillTiled);
XSetTSOrigin(d->dpy, d->gc, x-sx, y-sy);
const bool xrenderPath = (X11->use_xrender
&& !(d->pdev->devType() == QInternal::Pixmap
- && static_cast<const QPixmap *>(d->pdev)->data->pixelType() == QPixmapData::BitmapType));
+ && static_cast<const QPixmap *>(d->pdev)->data->pixelType() == QPlatformPixmap::BitmapType));
QVarLengthArray<QFixedPoint> positions;
QVarLengthArray<glyph_t> glyphs;
QPixmap qt_toX11Pixmap(const QImage &image)
{
- QPixmapData *data =
- new QX11PixmapData(image.depth() == 1
- ? QPixmapData::BitmapType
- : QPixmapData::PixmapType);
+ QPlatformPixmap *data =
+ new QX11PlatformPixmap(image.depth() == 1
+ ? QPlatformPixmap::BitmapType
+ : QPlatformPixmap::PixmapType);
data->fromImage(image, Qt::AutoColor);
if (pixmap.isNull())
return QPixmap();
- if (QPixmap(pixmap).data_ptr()->classId() == QPixmapData::X11Class)
+ if (QPixmap(pixmap).data_ptr()->classId() == QPlatformPixmap::X11Class)
return pixmap;
return qt_toX11Pixmap(pixmap.toImage());
XDestroyImage(x);
}
-QBitmap QX11PixmapData::mask_to_bitmap(int screen) const
+QBitmap QX11PlatformPixmap::mask_to_bitmap(int screen) const
{
if (!x11_mask)
return QBitmap();
return bm;
}
-Qt::HANDLE QX11PixmapData::bitmap_to_mask(const QBitmap &bitmap, int screen)
+Qt::HANDLE QX11PlatformPixmap::bitmap_to_mask(const QBitmap &bitmap, int screen)
{
if (bitmap.isNull())
return 0;
QBasicAtomicInt qt_pixmap_serial = Q_BASIC_ATOMIC_INITIALIZER(0);
int Q_WIDGETS_EXPORT qt_x11_preferred_pixmap_depth = 0;
-QX11PixmapData::QX11PixmapData(PixelType type)
- : QPixmapData(type, X11Class), gl_surface(0), hd(0),
+QX11PlatformPixmap::QX11PlatformPixmap(PixelType type)
+ : QPlatformPixmap(type, X11Class), gl_surface(0), hd(0),
flags(Uninitialized), x11_mask(0), picture(0), mask_picture(0), hd2(0),
share_mode(QPixmap::ImplicitlyShared), pengine(0)
{
}
-QPixmapData *QX11PixmapData::createCompatiblePixmapData() const
+QPlatformPixmap *QX11PlatformPixmap::createCompatiblePlatformPixmap() const
{
- return new QX11PixmapData(pixelType());
+ return new QX11PlatformPixmap(pixelType());
}
-void QX11PixmapData::resize(int width, int height)
+void QX11PlatformPixmap::resize(int width, int height)
{
setSerialNumber(qt_pixmap_serial.fetchAndAddRelaxed(1));
mutable bool has;
};
-void QX11PixmapData::fromImage(const QImage &img,
+void QX11PlatformPixmap::fromImage(const QImage &img,
Qt::ImageConversionFlags flags)
{
setSerialNumber(qt_pixmap_serial.fetchAndAddRelaxed(1));
}
}
-Qt::HANDLE QX11PixmapData::createBitmapFromImage(const QImage &image)
+Qt::HANDLE QX11PlatformPixmap::createBitmapFromImage(const QImage &image)
{
QImage img = image.convertToFormat(QImage::Format_MonoLSB);
const QRgb c0 = QColor(Qt::black).rgb();
return hd;
}
-void QX11PixmapData::bitmapFromImage(const QImage &image)
+void QX11PlatformPixmap::bitmapFromImage(const QImage &image)
{
w = image.width();
h = image.height();
#endif // QT_NO_XRENDER
}
-void QX11PixmapData::fill(const QColor &fillColor)
+void QX11PlatformPixmap::fill(const QColor &fillColor)
{
if (fillColor.alpha() != 255) {
#ifndef QT_NO_XRENDER
XFreeGC(X11->display, gc);
}
-QX11PixmapData::~QX11PixmapData()
+QX11PlatformPixmap::~QX11PlatformPixmap()
{
// Cleanup hooks have to be called before the handles are freed
if (is_cached) {
- QImagePixmapCleanupHooks::executePixmapDataDestructionHooks(this);
+ QImagePixmapCleanupHooks::executePlatformPixmapDestructionHooks(this);
is_cached = false;
}
release();
}
-void QX11PixmapData::release()
+void QX11PlatformPixmap::release()
{
delete pengine;
pengine = 0;
}
}
-QPixmap QX11PixmapData::alphaChannel() const
+QPixmap QX11PlatformPixmap::alphaChannel() const
{
if (!hasAlphaChannel()) {
QPixmap pm(w, h);
return QPixmap::fromImage(im.alphaChannel(), Qt::OrderedDither);
}
-void QX11PixmapData::setAlphaChannel(const QPixmap &alpha)
+void QX11PlatformPixmap::setAlphaChannel(const QPixmap &alpha)
{
QImage image(toImage());
image.setAlphaChannel(alpha.toImage());
}
-QBitmap QX11PixmapData::mask() const
+QBitmap QX11PlatformPixmap::mask() const
{
QBitmap mask;
#ifndef QT_NO_XRENDER
} else
#endif
if (d == 1) {
- QX11PixmapData *that = const_cast<QX11PixmapData*>(this);
+ QX11PlatformPixmap *that = const_cast<QX11PlatformPixmap*>(this);
mask = QPixmap(that);
} else {
mask = mask_to_bitmap(xinfo.screen());
\sa mask(), {QPixmap#Pixmap Transformations}{Pixmap
Transformations}, QBitmap
*/
-void QX11PixmapData::setMask(const QBitmap &newmask)
+void QX11PlatformPixmap::setMask(const QBitmap &newmask)
{
if (newmask.isNull()) { // clear mask
#ifndef QT_NO_XRENDER
if (picture && d == 32) {
- QX11PixmapData newData(pixelType());
+ QX11PlatformPixmap newData(pixelType());
newData.resize(w, h);
newData.fill(Qt::black);
XRenderComposite(X11->display, PictOpOver,
0, 0, 0, 0, 0, 0, w, h);
release();
*this = newData;
- // the new QX11PixmapData object isn't referenced yet, so
+ // the new QX11PlatformPixmap object isn't referenced yet, so
// ref it
ref.ref();
- // the below is to make sure the QX11PixmapData destructor
+ // the below is to make sure the QX11PlatformPixmap destructor
// doesn't delete our newly created render picture
newData.hd = 0;
newData.x11_mask = 0;
XRenderFreePicture(X11->display, mask_picture);
#endif
}
- x11_mask = QX11PixmapData::bitmap_to_mask(newmask, xinfo.screen());
+ x11_mask = QX11PlatformPixmap::bitmap_to_mask(newmask, xinfo.screen());
#ifndef QT_NO_XRENDER
if (picture) {
mask_picture = XRenderCreatePicture(X11->display, x11_mask,
}
}
-int QX11PixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
+int QX11PlatformPixmap::metric(QPaintDevice::PaintDeviceMetric metric) const
{
switch (metric) {
case QPaintDevice::PdmWidth:
case QPaintDevice::PdmPhysicalDpiY:
return QX11Info::appDpiY(xinfo.screen());
default:
- qWarning("QX11PixmapData::metric(): Invalid metric");
+ qWarning("QX11PlatformPixmap::metric(): Invalid metric");
return 0;
}
}
XImage *xi;
};
-bool QX11PixmapData::canTakeQImageFromXImage(const QXImageWrapper &xiWrapper) const
+bool QX11PlatformPixmap::canTakeQImageFromXImage(const QXImageWrapper &xiWrapper) const
{
XImage *xi = xiWrapper.xi;
return false;
}
-QImage QX11PixmapData::takeQImageFromXImage(const QXImageWrapper &xiWrapper) const
+QImage QX11PlatformPixmap::takeQImageFromXImage(const QXImageWrapper &xiWrapper) const
{
XImage *xi = xiWrapper.xi;
return image;
}
-QImage QX11PixmapData::toImage(const QRect &rect) const
+QImage QX11PlatformPixmap::toImage(const QRect &rect) const
{
QXImageWrapper xiWrapper;
xiWrapper.xi = XGetImage(X11->display, hd, rect.x(), rect.y(), rect.width(), rect.height(),
\sa fromImage(), {QImage#Image Formats}{Image Formats}
*/
-QImage QX11PixmapData::toImage() const
+QImage QX11PlatformPixmap::toImage() const
{
return toImage(QRect(0, 0, w, h));
}
-QImage QX11PixmapData::toImage(const QXImageWrapper &xiWrapper, const QRect &rect) const
+QImage QX11PlatformPixmap::toImage(const QXImageWrapper &xiWrapper, const QRect &rect) const
{
XImage *xi = xiWrapper.xi;
\sa trueMatrix(), {QPixmap#Pixmap Transformations}{Pixmap
Transformations}
*/
-QPixmap QX11PixmapData::transformed(const QTransform &transform,
+QPixmap QX11PlatformPixmap::transformed(const QTransform &transform,
Qt::TransformationMode mode ) const
{
if (mode == Qt::SmoothTransformation || transform.type() >= QTransform::TxProject) {
free(dptr);
return bm;
} else { // color pixmap
- QX11PixmapData *x11Data = new QX11PixmapData(QPixmapData::PixmapType);
+ QX11PlatformPixmap *x11Data = new QX11PlatformPixmap(QPlatformPixmap::PixmapType);
QPixmap pm(x11Data);
- x11Data->flags &= ~QX11PixmapData::Uninitialized;
+ x11Data->flags &= ~QX11PlatformPixmap::Uninitialized;
x11Data->xinfo = xinfo;
x11Data->d = d;
x11Data->w = w;
if (isNull())
return;
- if (data->classId() != QPixmapData::X11Class)
+ if (data->classId() != QPlatformPixmap::X11Class)
return;
if (screen < 0)
screen = QX11Info::appScreen();
- QX11PixmapData *x11Data = static_cast<QX11PixmapData*>(data.data());
+ QX11PlatformPixmap *x11Data = static_cast<QX11PlatformPixmap*>(data.data());
if (screen == x11Data->xinfo.screen())
return; // nothing to do
window_attr = root_attr;
}
- QX11PixmapData *data = new QX11PixmapData(QPixmapData::PixmapType);
+ QX11PlatformPixmap *data = new QX11PlatformPixmap(QPlatformPixmap::PixmapType);
void qt_x11_getX11InfoForWindow(QX11Info * xinfo, const XWindowAttributes &a);
qt_x11_getX11InfoForWindow(&data->xinfo,window_attr);
QPixmap pm(data);
- data->flags &= ~QX11PixmapData::Uninitialized;
+ data->flags &= ~QX11PlatformPixmap::Uninitialized;
pm.x11SetScreen(scr);
GC gc = XCreateGC(dpy, pm.handle(), 0, 0);
return pm;
}
-bool QX11PixmapData::hasAlphaChannel() const
+bool QX11PlatformPixmap::hasAlphaChannel() const
{
return d == 32;
}
const QX11Info &QPixmap::x11Info() const
{
- if (data && data->classId() == QPixmapData::X11Class)
- return static_cast<QX11PixmapData*>(data.data())->xinfo;
+ if (data && data->classId() == QPlatformPixmap::X11Class)
+ return static_cast<QX11PlatformPixmap*>(data.data())->xinfo;
else {
static QX11Info nullX11Info;
return nullX11Info;
}
#endif
-QPaintEngine* QX11PixmapData::paintEngine() const
+QPaintEngine* QX11PlatformPixmap::paintEngine() const
{
- QX11PixmapData *that = const_cast<QX11PixmapData*>(this);
+ QX11PlatformPixmap *that = const_cast<QX11PlatformPixmap*>(this);
if ((flags & Readonly) && share_mode == QPixmap::ImplicitlyShared) {
// if someone wants to draw onto us, copy the shared contents
XFreeGC(X11->display, gc);
}
that->hd = hd_copy;
- that->flags &= ~QX11PixmapData::Readonly;
+ that->flags &= ~QX11PlatformPixmap::Readonly;
}
if (!that->pengine)
Qt::HANDLE QPixmap::x11PictureHandle() const
{
#ifndef QT_NO_XRENDER
- if (data && data->classId() == QPixmapData::X11Class)
- return static_cast<const QX11PixmapData*>(data.data())->picture;
+ if (data && data->classId() == QPlatformPixmap::X11Class)
+ return static_cast<const QX11PlatformPixmap*>(data.data())->picture;
else
return 0;
#else
#endif // QT_NO_XRENDER
}
-Qt::HANDLE QX11PixmapData::x11ConvertToDefaultDepth()
+Qt::HANDLE QX11PlatformPixmap::x11ConvertToDefaultDepth()
{
#ifndef QT_NO_XRENDER
if (d == QX11Info::appDepth() || !X11->use_xrender)
#endif
}
-void QX11PixmapData::copy(const QPixmapData *data, const QRect &rect)
+void QX11PlatformPixmap::copy(const QPlatformPixmap *data, const QRect &rect)
{
if (data->pixelType() == BitmapType) {
fromImage(data->toImage().copy(rect), Qt::AutoColor);
return;
}
- const QX11PixmapData *x11Data = static_cast<const QX11PixmapData*>(data);
+ const QX11PlatformPixmap *x11Data = static_cast<const QX11PlatformPixmap*>(data);
setSerialNumber(qt_pixmap_serial.fetchAndAddRelaxed(1));
}
}
-bool QX11PixmapData::scroll(int dx, int dy, const QRect &rect)
+bool QX11PlatformPixmap::scroll(int dx, int dy, const QRect &rect)
{
GC gc = XCreateGC(X11->display, hd, 0, 0);
XCopyArea(X11->display, hd, hd, gc,
}
#if !defined(QT_NO_XRENDER)
-void QX11PixmapData::convertToARGB32(bool preserveContents)
+void QX11PlatformPixmap::convertToARGB32(bool preserveContents)
{
if (!X11->use_xrender)
return;
break;
}
- QX11PixmapData *data = new QX11PixmapData(depth == 1 ? QPixmapData::BitmapType : QPixmapData::PixmapType);
+ QX11PlatformPixmap *data = new QX11PlatformPixmap(depth == 1 ? QPlatformPixmap::BitmapType : QPlatformPixmap::PixmapType);
data->setSerialNumber(qt_pixmap_serial.fetchAndAddRelaxed(1));
- data->flags = QX11PixmapData::Readonly;
+ data->flags = QX11PlatformPixmap::Readonly;
data->share_mode = mode;
data->w = width;
data->h = height;
// We mean it.
//
-#include <QtGui/private/qpixmapdata_p.h>
-#include <QtGui/private/qpixmapdatafactory_p.h>
+#include <QtGui/qplatformpixmap_qpa.h>
+#include <QtGui/qplatformpixmapfactory_p.h>
#include "QtGui/qx11info_x11.h"
struct QXImageWrapper;
-class Q_WIDGETS_EXPORT QX11PixmapData : public QPixmapData
+class Q_WIDGETS_EXPORT QX11PlatformPixmap : public QPlatformPixmap
{
public:
- QX11PixmapData(PixelType type);
-// QX11PixmapData(PixelType type, int width, int height);
-// QX11PixmapData(PixelType type, const QImage &image,
+ QX11PlatformPixmap(PixelType type);
+// QX11PlatformPixmap(PixelType type, int width, int height);
+// QX11PlatformPixmap(PixelType type, const QImage &image,
// Qt::ImageConversionFlags flags);
- ~QX11PixmapData();
+ ~QX11PlatformPixmap();
- QPixmapData *createCompatiblePixmapData() const;
+ QPlatformPixmap *createCompatiblePlatformPixmap() const;
void resize(int width, int height);
void fromImage(const QImage &image, Qt::ImageConversionFlags flags);
- void copy(const QPixmapData *data, const QRect &rect);
+ void copy(const QPlatformPixmap *data, const QRect &rect);
bool scroll(int dx, int dy, const QRect &rect);
void fill(const QColor &color);
friend class QGLContextPrivate; // Needs to access xinfo, gl_surface & flags
friend class QEglContext; // Needs gl_surface
friend class QGLContext; // Needs gl_surface
- friend class QX11GLPixmapData; // Needs gl_surface
- friend class QMeeGoLivePixmapData; // Needs gl_surface and flags
- friend bool qt_createEGLSurfaceForPixmap(QPixmapData*, bool); // Needs gl_surface
+ friend class QX11GLPlatformPixmap; // Needs gl_surface
+ friend class QMeeGoLivePlatformPixmap; // Needs gl_surface and flags
+ friend bool qt_createEGLSurfaceForPixmap(QPlatformPixmap*, bool); // Needs gl_surface
void release();
else if (brush.style() == Qt::TexturePattern) {
extern QPixmap qt_toX11Pixmap(const QPixmap &pixmap); // qpixmap_x11.cpp
XSetWindowBackgroundPixmap(X11->display, q->internalWinId(),
- static_cast<QX11PixmapData*>(qt_toX11Pixmap(brush.texture()).data.data())->x11ConvertToDefaultDepth());
+ static_cast<QX11PlatformPixmap*>(qt_toX11Pixmap(brush.texture()).data.data())->x11ConvertToDefaultDepth());
} else
XSetWindowBackground(X11->display, q->internalWinId(),
QColormap::instance(xinfo.screen()).pixel(brush.color()));
// violates the ICCCM), since this works on all DEs known to Qt
if (!forceReset || !topData->iconPixmap)
topData->iconPixmap = new QPixmap(qt_toX11Pixmap(icon.pixmap(QSize(64,64))));
- pixmap_handle = static_cast<QX11PixmapData*>(topData->iconPixmap->data.data())->x11ConvertToDefaultDepth();
+ pixmap_handle = static_cast<QX11PlatformPixmap*>(topData->iconPixmap->data.data())->x11ConvertToDefaultDepth();
}
}
}
friend class QX11PaintEngine;
friend class QPixmap;
- friend class QX11PixmapData;
+ friend class QX11PlatformPixmap;
friend class QWidget;
friend class QWidgetPrivate;
friend class QGLWidget;
return QPixmap();
QPixmap pixmap;
- QScopedPointer<QPixmapData> pd(QPixmapData::create(0, 0, QPixmapData::PixmapType));
+ QScopedPointer<QPlatformPixmap> pd(QPlatformPixmap::create(0, 0, QPlatformPixmap::PixmapType));
if (mask) {
// Try the efficient path with less copying and conversion.
QVolatileImage img(icon, mask);
- pd->fromNativeType(&img, QPixmapData::VolatileImage);
+ pd->fromNativeType(&img, QPlatformPixmap::VolatileImage);
if (!pd->isNull())
pixmap = QPixmap(pd.take());
}
if (pixmap.isNull()) {
// Potentially more expensive path.
- pd->fromNativeType(icon, QPixmapData::FbsBitmap);
+ pd->fromNativeType(icon, QPlatformPixmap::FbsBitmap);
pixmap = QPixmap(pd.take());
if (mask) {
pixmap.setAlphaChannel(QPixmap::fromSymbianCFbsBitmap(mask));
#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
if (!source)
return QPixmap();
- QScopedPointer<QPixmapData> pd(QPixmapData::create(0, 0, QPixmapData::PixmapType));
- pd->fromNativeType(source, QPixmapData::NativeImageHandleProvider);
+ QScopedPointer<QPlatformPixmap> pd(QPlatformPixmap::create(0, 0, QPlatformPixmap::PixmapType));
+ pd->fromNativeType(source, QPlatformPixmap::NativeImageHandleProvider);
return QPixmap(pd.take());
#else
Q_UNUSED(source);
QPixmap pm = pixmapFromNativeImageHandleProvider(0);
QVERIFY(pm.isNull());
QPixmap tmp(10, 20);
- if (tmp.pixmapData()->classId() == QPixmapData::OpenVGClass) {
+ if (tmp.handle()->classId() == QPlatformPixmap::OpenVGClass) {
// Verify that null pixmap is properly returned when get() provides bogus results.
DummyProvider prov;
pm = pixmapFromNativeImageHandleProvider(&prov);
{
#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
QPixmap tmp(10, 20);
- if (tmp.pixmapData()->classId() == QPixmapData::OpenVGClass) {
+ if (tmp.handle()->classId() == QPlatformPixmap::OpenVGClass) {
BitmapProvider prov;
// This should fail because of null ptr.
{
#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
QPixmap tmp(10, 20);
- if (tmp.pixmapData()->classId() == QPixmapData::OpenVGClass) {
+ if (tmp.handle()->classId() == QPlatformPixmap::OpenVGClass) {
BitmapProvider prov;
prov.bmp = new CFbsBitmap;
QCOMPARE(prov.bmp->Create(TSize(prov.w, prov.h), EColor16MAP), KErrNone);
QPixmap pm = pixmapFromNativeImageHandleProvider(&prov);
QCOMPARE(prov.refCount, 1);
- QVGPixmapData *vgpd = static_cast<QVGPixmapData *>(pm.pixmapData());
+ QVGPlatformPixmap *vgpd = static_cast<QVGPlatformPixmap *>(pm.handle());
vgpd->hibernate();
QCOMPARE(prov.refCount, 0);
#include <QVBoxLayout>
#ifdef QT_BUILD_INTERNAL
+#include <qplatformpixmap_qpa.h>
#include <QtOpenGL/private/qgl_p.h>
-#include <QtGui/private/qpixmapdata_p.h>
#include <QtGui/private/qimage_p.h>
#include <QtGui/private/qimagepixmapcleanuphooks_p.h>
#endif
void draw(QPainter *painter)
{
- QVERIFY(sourcePixmap(Qt::LogicalCoordinates).pixmapData() == pixmap.pixmapData());
- QVERIFY((painter->worldTransform().type() <= QTransform::TxTranslate) == (sourcePixmap(Qt::DeviceCoordinates).pixmapData() == pixmap.pixmapData()));
+ QVERIFY(sourcePixmap(Qt::LogicalCoordinates).handle() == pixmap.handle());
+ QVERIFY((painter->worldTransform().type() <= QTransform::TxTranslate) == (sourcePixmap(Qt::DeviceCoordinates).handle() == pixmap.handle()));
++repaints;
}
#include <qtreewidget.h>
#include <qsplashscreen.h>
-#include <private/qpixmapdata_p.h>
+#include <qplatformpixmap_qpa.h>
#include <private/qdrawhelper_p.h>
#include <QSet>
const QPixmap pixmap = QPixmap::fromImage(image);
#ifdef Q_WS_X11
- if (pixmap.pixmapData()->classId() == QPixmapData::X11Class && !pixmap.x11PictureHandle())
+ if (pixmap.handle()->classId() == QPlatformPixmap::X11Class && !pixmap.x11PictureHandle())
QSKIP("Requires XRender support", SkipAll);
#endif
const QImage result = pixmap.toImage();
pm = QPixmap(400, 400);
#if defined(Q_WS_X11)
- if (!bitmap && pm.pixmapData()->classId() == QPixmapData::X11Class && !pm.x11PictureHandle())
+ if (!bitmap && pm.handle()->classId() == QPlatformPixmap::X11Class && !pm.x11PictureHandle())
QSKIP("Requires XRender support", SkipSingle);
#endif
{
QPixmap pixmap(10, 10);
#ifdef Q_WS_X11
- if (pixmap.pixmapData()->classId() == QPixmapData::X11Class && !pixmap.x11PictureHandle())
+ if (pixmap.handle()->classId() == QPlatformPixmap::X11Class && !pixmap.x11PictureHandle())
QSKIP("Requires XRender support", SkipAll);
#endif
pixmap.fill(Qt::transparent);
void tst_QPixmap::convertFromImageNoDetach()
{
QPixmap randomPixmap(10, 10);
- if (randomPixmap.pixmapData()->classId() != QPixmapData::RasterClass)
+ if (randomPixmap.handle()->classId() != QPlatformPixmap::RasterClass)
QSKIP("Test only valid for raster pixmaps", SkipAll);
//first get the screen format
delete img;
}
-//This is testing QPixmapData::createCompatiblePixmapData - see QTBUG-5977
+//This is testing QPlatformPixmap::createCompatiblePlatformPixmap - see QTBUG-5977
void tst_QPixmap::splash_crash()
{
QPixmap pix;
#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
Q_OPENVG_EXPORT VGImage qPixmapToVGImage(const QPixmap& pixmap);
-class FriendlyVGPixmapData : public QVGPixmapData
+class FriendlyVGPlatformPixmap : public QVGPlatformPixmap
{
public:
- FriendlyVGPixmapData(PixelType type) : QVGPixmapData(type) { }
+ FriendlyVGPlatformPixmap(PixelType type) : QVGPlatformPixmap(type) { }
bool sourceIsNull() { return source.isNull(); }
friend QPixmap pixmapFromVGImage(VGImage image);
};
if (image != VG_INVALID_HANDLE) {
int w = vgGetParameteri(image, VG_IMAGE_WIDTH);
int h = vgGetParameteri(image, VG_IMAGE_HEIGHT);
- FriendlyVGPixmapData *pd = new FriendlyVGPixmapData(QPixmapData::PixmapType);
+ FriendlyVGPlatformPixmap *pd = new FriendlyVGPlatformPixmap(QPlatformPixmap::PixmapType);
pd->resize(w, h);
pd->vgImage = image;
pd->recreate = false;
} else { // second phase: check if readback works
painter.drawPixmap(0, 0, pm);
// Drawing should not cause readback, this is important for performance;
- noreadback_ok = static_cast<FriendlyVGPixmapData *>(pm.pixmapData())->sourceIsNull();
+ noreadback_ok = static_cast<FriendlyVGPlatformPixmap *>(pm.handle())->sourceIsNull();
// However toImage() requires readback.
QImage img = pm.toImage();
readback_ok = img.width() == pm.width();
readback_ok &= img.height() == pm.height();
- readback_ok &= !static_cast<FriendlyVGPixmapData *>(pm.pixmapData())->sourceIsNull();
+ readback_ok &= !static_cast<FriendlyVGPlatformPixmap *>(pm.handle())->sourceIsNull();
uint pix = img.pixel(1, 1);
content_ok = qRed(pix) == testPixel.red();
content_ok &= qGreen(pix) == testPixel.green();
void tst_QPixmap::vgImageReadBack()
{
QPixmap tmp(10, 20);
- if (tmp.pixmapData()->classId() == QPixmapData::OpenVGClass) {
+ if (tmp.handle()->classId() == QPlatformPixmap::OpenVGClass) {
Content c;
c.w = 50;
c.h = 60;
QCOMPARE(pm.width(), c.w);
QCOMPARE(pm.height(), c.h);
QVERIFY(qPixmapToVGImage(pm) == c.vgimage);
- QVERIFY(static_cast<FriendlyVGPixmapData *>(pm.pixmapData())->sourceIsNull());
+ QVERIFY(static_cast<FriendlyVGPlatformPixmap *>(pm.handle())->sourceIsNull());
c.pm = pm;
// Make sure the second phase in paintEvent is executed too.
c.hide();
QPixmap rasterPixmap(int width, int height)
{
- QPixmapData *data =
- new QRasterPixmapData(QPixmapData::PixmapType);
+ QPlatformPixmap *data =
+ new QRasterPlatformPixmap(QPlatformPixmap::PixmapType);
data->resize(width, height);
QPixmap rasterPixmap(const QImage &image)
{
- QPixmapData *data =
- new QRasterPixmapData(QPixmapData::PixmapType);
+ QPlatformPixmap *data =
+ new QRasterPlatformPixmap(QPlatformPixmap::PixmapType);
data->fromImage(image, Qt::AutoColor);
QPixmap rasterPixmap(int width, int height)
{
- QPixmapData *data =
- new QRasterPixmapData(QPixmapData::PixmapType);
+ QPlatformPixmap *data =
+ new QRasterPlatformPixmap(QPlatformPixmap::PixmapType);
data->resize(width, height);
QPixmap rasterPixmap(const QImage &image)
{
- QPixmapData *data =
- new QRasterPixmapData(QPixmapData::PixmapType);
+ QPlatformPixmap *data =
+ new QRasterPlatformPixmap(QPlatformPixmap::PixmapType);
data->fromImage(image, Qt::AutoColor);