From 310519d6d11da546b23c1cba307f37c24e0a5c0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 15 Jul 2011 14:07:12 +0200 Subject: Rename QPixmapData to QPlatformPixmap. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jørgen Lind --- .../tst_nativeimagehandleprovider.cpp | 12 +++++----- tests/auto/qgl/tst_qgl.cpp | 2 +- tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp | 4 ++-- tests/auto/qpixmap/tst_qpixmap.cpp | 26 +++++++++++----------- tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp | 8 +++---- .../gui/painting/qpainter/tst_qpainter.cpp | 8 +++---- 6 files changed, 30 insertions(+), 30 deletions(-) (limited to 'tests') 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 pd(QPixmapData::create(0, 0, QPixmapData::PixmapType)); - pd->fromNativeType(source, QPixmapData::NativeImageHandleProvider); + QScopedPointer 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(pm.pixmapData()); + QVGPlatformPixmap *vgpd = static_cast(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 #ifdef QT_BUILD_INTERNAL +#include #include -#include #include #include #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 #include -#include +#include #include #include @@ -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(pm.pixmapData())->sourceIsNull(); + noreadback_ok = static_cast(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(pm.pixmapData())->sourceIsNull(); + readback_ok &= !static_cast(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(pm.pixmapData())->sourceIsNull()); + QVERIFY(static_cast(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); -- cgit v1.2.3