summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@nokia.com>2011-06-24 09:52:41 (GMT)
committerLiang Qi <liang.qi@nokia.com>2011-06-24 09:52:41 (GMT)
commitcf2f72f4f61f3a9e0e7573379c33bb341eeba7be (patch)
tree06fbd459f62f87344e7db973a0a9f3050cece825 /src/gui/painting
parent164728f711136356a6c3482f762321b01c9d82dd (diff)
parent705b0f958a6071341b10cbd51917e1378356491b (diff)
downloadQt-cf2f72f4f61f3a9e0e7573379c33bb341eeba7be.zip
Qt-cf2f72f4f61f3a9e0e7573379c33bb341eeba7be.tar.gz
Qt-cf2f72f4f61f3a9e0e7573379c33bb341eeba7be.tar.bz2
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Conflicts: src/gui/image/qpixmap_raster_symbian.cpp src/gui/image/qpixmapdatafactory.cpp src/gui/painting/qgraphicssystem.cpp src/gui/styles/qs60style.cpp src/network/bearer/qnetworkconfigmanager_p.h src/s60installs/bwins/QtGuiu.def src/s60installs/bwins/QtOpenGLu.def src/s60installs/bwins/QtOpenVGu.def src/s60installs/eabi/QtGuiu.def src/s60installs/eabi/QtOpenVGu.def tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/painting.pri4
-rw-r--r--src/gui/painting/qgraphicssystem.cpp4
-rw-r--r--src/gui/painting/qgraphicssystem_raster.cpp4
-rw-r--r--src/gui/painting/qpaintengine_raster_symbian.cpp (renamed from src/gui/painting/qpaintengine_s60.cpp)64
-rw-r--r--src/gui/painting/qpaintengine_raster_symbian_p.h (renamed from src/gui/painting/qpaintengine_s60_p.h)18
-rw-r--r--src/gui/painting/qwindowsurface_s60.cpp14
6 files changed, 55 insertions, 53 deletions
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index d5ae364..27b1bf2 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -198,12 +198,12 @@ qpa {
symbian {
SOURCES += \
- painting/qpaintengine_s60.cpp \
+ painting/qpaintengine_raster_symbian.cpp \
painting/qregion_s60.cpp \
painting/qcolormap_s60.cpp
HEADERS += \
- painting/qpaintengine_s60_p.h
+ painting/qpaintengine_raster_symbian_p.h
}
x11|embedded|qpa {
diff --git a/src/gui/painting/qgraphicssystem.cpp b/src/gui/painting/qgraphicssystem.cpp
index d4a8015..04e45d2 100644
--- a/src/gui/painting/qgraphicssystem.cpp
+++ b/src/gui/painting/qgraphicssystem.cpp
@@ -54,7 +54,7 @@
# include <QtGui/private/qapplication_p.h>
#endif
#ifdef Q_OS_SYMBIAN
-# include <private/qpixmap_s60_p.h>
+# include <private/qpixmap_raster_symbian_p.h>
# include <private/qgraphicssystemex_symbian_p.h>
#else
# include <private/qgraphicssystemex_p.h>
@@ -80,7 +80,7 @@ QPixmapData *QGraphicsSystem::createDefaultPixmapData(QPixmapData::PixelType typ
#elif defined(Q_WS_QPA)
return QApplicationPrivate::platformIntegration()->createPixmapData(type);
#elif defined(Q_OS_SYMBIAN)
- return new QS60PixmapData(type);
+ return new QSymbianRasterPixmapData(type);
#elif !defined(Q_WS_QWS)
#error QGraphicsSystem::createDefaultPixmapData() not implemented
#endif
diff --git a/src/gui/painting/qgraphicssystem_raster.cpp b/src/gui/painting/qgraphicssystem_raster.cpp
index 0edbe9f..addfff7 100644
--- a/src/gui/painting/qgraphicssystem_raster.cpp
+++ b/src/gui/painting/qgraphicssystem_raster.cpp
@@ -42,7 +42,7 @@
#include "qgraphicssystem_raster_p.h"
#ifdef Q_OS_SYMBIAN
-#include "private/qpixmap_s60_p.h"
+#include "private/qpixmap_raster_symbian_p.h"
#include "private/qwindowsurface_s60_p.h"
#else
#include "private/qpixmap_raster_p.h"
@@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
QPixmapData *QRasterGraphicsSystem::createPixmapData(QPixmapData::PixelType type) const
{
#ifdef Q_OS_SYMBIAN
- return new QS60PixmapData(type);
+ return new QSymbianRasterPixmapData(type);
#else
return new QRasterPixmapData(type);
#endif
diff --git a/src/gui/painting/qpaintengine_s60.cpp b/src/gui/painting/qpaintengine_raster_symbian.cpp
index 091e2e6..3b27077 100644
--- a/src/gui/painting/qpaintengine_s60.cpp
+++ b/src/gui/painting/qpaintengine_raster_symbian.cpp
@@ -38,29 +38,30 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include <private/qpaintengine_s60_p.h>
-#include <private/qpixmap_s60_p.h>
+
+#include <private/qpaintengine_raster_symbian_p.h>
+#include <private/qpixmap_raster_symbian_p.h>
#include <private/qt_s60_p.h>
#include <private/qvolatileimage_p.h>
QT_BEGIN_NAMESPACE
-class QS60PaintEnginePrivate : public QRasterPaintEnginePrivate
+class QSymbianRasterPaintEnginePrivate : public QRasterPaintEnginePrivate
{
public:
- QS60PaintEnginePrivate() {}
+ QSymbianRasterPaintEnginePrivate() {}
};
-QS60PaintEngine::QS60PaintEngine(QPaintDevice *device, QS60PixmapData *data)
- : QRasterPaintEngine(*(new QS60PaintEnginePrivate), device), pixmapData(data)
+QSymbianRasterPaintEngine::QSymbianRasterPaintEngine(QPaintDevice *device, QSymbianRasterPixmapData *data)
+ : QRasterPaintEngine(*(new QSymbianRasterPaintEnginePrivate), device), pixmapData(data)
{
}
-bool QS60PaintEngine::begin(QPaintDevice *device)
+bool QSymbianRasterPaintEngine::begin(QPaintDevice *device)
{
- Q_D(QS60PaintEngine);
+ Q_D(QSymbianRasterPaintEngine);
- if (pixmapData->classId() == QPixmapData::RasterClass) {
+ if (pixmapData && pixmapData->classId() == QPixmapData::RasterClass) {
pixmapData->beginDataAccess();
bool ret = QRasterPaintEngine::begin(device);
// Make sure QPaintEngine::paintDevice() returns the proper device.
@@ -69,13 +70,12 @@ bool QS60PaintEngine::begin(QPaintDevice *device)
d->pdev = device;
return ret;
}
-
return QRasterPaintEngine::begin(device);
}
-bool QS60PaintEngine::end()
+bool QSymbianRasterPaintEngine::end()
{
- if (pixmapData->classId() == QPixmapData::RasterClass) {
+ if (pixmapData && pixmapData->classId() == QPixmapData::RasterClass) {
bool ret = QRasterPaintEngine::end();
pixmapData->endDataAccess();
return ret;
@@ -83,50 +83,51 @@ bool QS60PaintEngine::end()
return QRasterPaintEngine::end();
}
-void QS60PaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm)
+void QSymbianRasterPaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm)
{
if (pm.pixmapData()->classId() == QPixmapData::RasterClass) {
- QS60PixmapData *srcData = static_cast<QS60PixmapData *>(pm.pixmapData());
+ QSymbianRasterPixmapData *srcData = static_cast<QSymbianRasterPixmapData *>(pm.pixmapData());
srcData->beginDataAccess();
QRasterPaintEngine::drawPixmap(p, pm);
srcData->endDataAccess();
} else {
- void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage);
- if (nativeData) {
- QVolatileImage *img = static_cast<QVolatileImage *>(nativeData);
- img->beginDataAccess();
- QRasterPaintEngine::drawImage(p, img->imageRef());
- img->endDataAccess(true);
+ QVolatileImage img = pm.pixmapData()->toVolatileImage();
+ if (!img.isNull()) {
+ img.beginDataAccess();
+ // imageRef() would detach and since we received the QVolatileImage
+ // from toVolatileImage() by value, it would cause a copy which
+ // would ruin our goal. So use constImageRef() instead.
+ QRasterPaintEngine::drawImage(p, img.constImageRef());
+ img.endDataAccess(true);
} else {
QRasterPaintEngine::drawPixmap(p, pm);
}
}
}
-void QS60PaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr)
+void QSymbianRasterPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr)
{
if (pm.pixmapData()->classId() == QPixmapData::RasterClass) {
- QS60PixmapData *srcData = static_cast<QS60PixmapData *>(pm.pixmapData());
+ QSymbianRasterPixmapData *srcData = static_cast<QSymbianRasterPixmapData *>(pm.pixmapData());
srcData->beginDataAccess();
QRasterPaintEngine::drawPixmap(r, pm, sr);
srcData->endDataAccess();
} else {
- void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage);
- if (nativeData) {
- QVolatileImage *img = static_cast<QVolatileImage *>(nativeData);
- img->beginDataAccess();
- QRasterPaintEngine::drawImage(r, img->imageRef(), sr);
- img->endDataAccess(true);
+ QVolatileImage img = pm.pixmapData()->toVolatileImage();
+ if (!img.isNull()) {
+ img.beginDataAccess();
+ QRasterPaintEngine::drawImage(r, img.constImageRef(), sr);
+ img.endDataAccess(true);
} else {
QRasterPaintEngine::drawPixmap(r, pm, sr);
}
}
}
-void QS60PaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr)
+void QSymbianRasterPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr)
{
if (pm.pixmapData()->classId() == QPixmapData::RasterClass) {
- QS60PixmapData *srcData = static_cast<QS60PixmapData *>(pm.pixmapData());
+ QSymbianRasterPixmapData *srcData = static_cast<QSymbianRasterPixmapData *>(pm.pixmapData());
srcData->beginDataAccess();
QRasterPaintEngine::drawTiledPixmap(r, pm, sr);
srcData->endDataAccess();
@@ -135,7 +136,8 @@ void QS60PaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, const
}
}
-void QS60PaintEngine::prepare(QImage *image)
+// used by QSymbianRasterPixmapData::beginDataAccess()
+void QSymbianRasterPaintEngine::prepare(QImage *image)
{
QRasterBuffer *buffer = d_func()->rasterBuffer.data();
if (buffer)
diff --git a/src/gui/painting/qpaintengine_s60_p.h b/src/gui/painting/qpaintengine_raster_symbian_p.h
index 2a3b443..cb51ecb 100644
--- a/src/gui/painting/qpaintengine_s60_p.h
+++ b/src/gui/painting/qpaintengine_raster_symbian_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QPAINTENGINE_S60_P_H
-#define QPAINTENGINE_S60_P_H
+#ifndef QPAINTENGINE_RASTER_SYMBIAN_P_H
+#define QPAINTENGINE_RASTER_SYMBIAN_P_H
//
// W A R N I N G
@@ -57,15 +57,15 @@
QT_BEGIN_NAMESPACE
-class QS60PaintEnginePrivate;
-class QS60PixmapData;
+class QSymbianRasterPaintEnginePrivate;
+class QSymbianRasterPixmapData;
-class QS60PaintEngine : public QRasterPaintEngine
+class QSymbianRasterPaintEngine : public QRasterPaintEngine
{
- Q_DECLARE_PRIVATE(QS60PaintEngine)
+ Q_DECLARE_PRIVATE(QSymbianRasterPaintEngine)
public:
- QS60PaintEngine(QPaintDevice *device, QS60PixmapData* data);
+ QSymbianRasterPaintEngine(QPaintDevice *device, QSymbianRasterPixmapData *data = 0);
bool begin(QPaintDevice *device);
bool end();
@@ -76,9 +76,9 @@ public:
void prepare(QImage* image);
private:
- QS60PixmapData *pixmapData;
+ QSymbianRasterPixmapData *pixmapData;
};
QT_END_NAMESPACE
-#endif // QPAINTENGINE_S60_P_H
+#endif // QPAINTENGINE_RASTER_SYMBIAN_P_H
diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp
index 8801d75..d1ac926 100644
--- a/src/gui/painting/qwindowsurface_s60.cpp
+++ b/src/gui/painting/qwindowsurface_s60.cpp
@@ -44,7 +44,7 @@
#include <QtGui/qpaintdevice.h>
#include <private/qwidget_p.h>
#include <private/qwindowsurface_s60_p.h>
-#include <private/qpixmap_s60_p.h>
+#include <private/qpixmap_raster_symbian_p.h>
#include <private/qt_s60_p.h>
#include <private/qapplication_p.h>
#include <private/qdrawhelper_p.h>
@@ -92,7 +92,7 @@ QS60WindowSurface::QS60WindowSurface(QWidget* widget)
Q_CHECK_PTR(bitmap);
qt_symbian_throwIfError( bitmap->Create( TSize(0, 0), mode ) );
- QS60PixmapData *data = new QS60PixmapData(QPixmapData::PixmapType);
+ QSymbianRasterPixmapData *data = new QSymbianRasterPixmapData(QPixmapData::PixmapType);
if (data) {
data->fromSymbianBitmap(bitmap, true);
d_ptr->device = QPixmap(data);
@@ -131,7 +131,7 @@ void QS60WindowSurface::beginPaint(const QRegion &rgn)
QWidgetPrivate *windowPrivate = qt_widget_private(window());
if (!windowPrivate->isOpaque || blitWriteAlpha(windowPrivate)) {
- QS60PixmapData *pixmapData = static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data());
+ QSymbianRasterPixmapData *pixmapData = static_cast<QSymbianRasterPixmapData *>(d_ptr->device.data_ptr().data());
TDisplayMode mode = displayMode(false);
if (pixmapData->cfbsBitmap->DisplayMode() != mode)
@@ -169,7 +169,7 @@ QImage* QS60WindowSurface::buffer(const QWidget *widget)
return 0;
const QPoint off = offset(widget);
- QImage *img = &(static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data())->image);
+ QImage *img = &(static_cast<QSymbianRasterPixmapData *>(d_ptr->device.data_ptr().data())->image);
QRect rect(off, widget->size());
rect &= QRect(QPoint(), img->size());
@@ -217,7 +217,7 @@ bool QS60WindowSurface::scroll(const QRegion &area, int dx, int dy)
if (d_ptr->device.isNull())
return false;
- QS60PixmapData *data = static_cast<QS60PixmapData*>(d_ptr->device.data_ptr().data());
+ QSymbianRasterPixmapData *data = static_cast<QSymbianRasterPixmapData*>(d_ptr->device.data_ptr().data());
data->scroll(dx, dy, rect);
return true;
@@ -233,7 +233,7 @@ void QS60WindowSurface::setGeometry(const QRect& rect)
if (rect == geometry())
return;
- QS60PixmapData *data = static_cast<QS60PixmapData*>(d_ptr->device.data_ptr().data());
+ QSymbianRasterPixmapData *data = static_cast<QSymbianRasterPixmapData*>(d_ptr->device.data_ptr().data());
data->resize(rect.width(), rect.height());
QWindowSurface::setGeometry(rect);
@@ -246,7 +246,7 @@ QWindowSurface::WindowSurfaceFeatures QS60WindowSurface::features() const
CFbsBitmap* QS60WindowSurface::symbianBitmap() const
{
- QS60PixmapData *data = static_cast<QS60PixmapData*>(d_ptr->device.data_ptr().data());
+ QSymbianRasterPixmapData *data = static_cast<QSymbianRasterPixmapData*>(d_ptr->device.data_ptr().data());
return data->cfbsBitmap;
}