diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-07-15 14:07:12 +0200 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2011-07-19 09:50:37 +0200 |
commit | 310519d6d11da546b23c1cba307f37c24e0a5c0b (patch) | |
tree | 3118b6539107ba0541abd09005bacc4e592a27e0 /tests | |
parent | 5abf4f55b1bd1180ea2dbfb867a48364bc89af80 (diff) | |
download | qtbase-310519d6d11da546b23c1cba307f37c24e0a5c0b.tar.gz |
Rename QPixmapData to QPlatformPixmap.
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>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/nativeimagehandleprovider/tst_nativeimagehandleprovider.cpp | 12 | ||||
-rw-r--r-- | tests/auto/qgl/tst_qgl.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qpixmap/tst_qpixmap.cpp | 26 | ||||
-rw-r--r-- | tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp | 8 | ||||
-rw-r--r-- | tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp | 8 |
6 files changed, 30 insertions, 30 deletions
diff --git a/tests/auto/nativeimagehandleprovider/tst_nativeimagehandleprovider.cpp b/tests/auto/nativeimagehandleprovider/tst_nativeimagehandleprovider.cpp index 3d198c7b12..d58e9fd8bc 100644 --- a/tests/auto/nativeimagehandleprovider/tst_nativeimagehandleprovider.cpp +++ b/tests/auto/nativeimagehandleprovider/tst_nativeimagehandleprovider.cpp @@ -56,8 +56,8 @@ QPixmap pixmapFromNativeImageHandleProvider(QNativeImageHandleProvider *source) #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); @@ -136,7 +136,7 @@ void tst_NativeImageHandleProvider::create() 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); @@ -151,7 +151,7 @@ void tst_NativeImageHandleProvider::bitmap() { #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. @@ -198,7 +198,7 @@ void tst_NativeImageHandleProvider::hibernate() { #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); @@ -206,7 +206,7 @@ void tst_NativeImageHandleProvider::hibernate() 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); diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index 7d46ada820..d66cc3bc25 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -55,8 +55,8 @@ #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 diff --git a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp index 2cd1a1dca6..b4b09fc6db 100644 --- a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp +++ b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp @@ -533,8 +533,8 @@ public: 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; } diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index a3d599ce1f..1365f080cc 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -51,7 +51,7 @@ #include <qtreewidget.h> #include <qsplashscreen.h> -#include <private/qpixmapdata_p.h> +#include <qplatformpixmap_qpa.h> #include <private/qdrawhelper_p.h> #include <QSet> @@ -299,7 +299,7 @@ void tst_QPixmap::fromImage() 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(); @@ -530,7 +530,7 @@ void tst_QPixmap::fill() 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 @@ -560,7 +560,7 @@ void tst_QPixmap::fill_transparent() { 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); @@ -861,7 +861,7 @@ void tst_QPixmap::isNull() 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 @@ -1431,7 +1431,7 @@ void tst_QPixmap::fromImage_crash() 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; @@ -1673,10 +1673,10 @@ void tst_QPixmap::toImageDeepCopy() #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); }; @@ -1685,7 +1685,7 @@ 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; @@ -1714,12 +1714,12 @@ public: } 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(); @@ -1741,7 +1741,7 @@ public: 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; @@ -1755,7 +1755,7 @@ void tst_QPixmap::vgImageReadBack() 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(); diff --git a/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp b/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp index 2ea6d23ba3..904177bff7 100644 --- a/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp +++ b/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp @@ -76,8 +76,8 @@ Q_DECLARE_METATYPE(Qt::TransformationMode) QPixmap rasterPixmap(int width, int height) { - QPixmapData *data = - new QRasterPixmapData(QPixmapData::PixmapType); + QPlatformPixmap *data = + new QRasterPlatformPixmap(QPlatformPixmap::PixmapType); data->resize(width, height); @@ -91,8 +91,8 @@ QPixmap rasterPixmap(const QSize &size) QPixmap rasterPixmap(const QImage &image) { - QPixmapData *data = - new QRasterPixmapData(QPixmapData::PixmapType); + QPlatformPixmap *data = + new QRasterPlatformPixmap(QPlatformPixmap::PixmapType); data->fromImage(image, Qt::AutoColor); diff --git a/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp b/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp index 5032936ce1..37a8329151 100644 --- a/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp @@ -130,8 +130,8 @@ struct PrimitiveSet { QPixmap rasterPixmap(int width, int height) { - QPixmapData *data = - new QRasterPixmapData(QPixmapData::PixmapType); + QPlatformPixmap *data = + new QRasterPlatformPixmap(QPlatformPixmap::PixmapType); data->resize(width, height); @@ -145,8 +145,8 @@ QPixmap rasterPixmap(const QSize &size) QPixmap rasterPixmap(const QImage &image) { - QPixmapData *data = - new QRasterPixmapData(QPixmapData::PixmapType); + QPlatformPixmap *data = + new QRasterPlatformPixmap(QPlatformPixmap::PixmapType); data->fromImage(image, Qt::AutoColor); |