summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-05-11 06:30:34 (GMT)
committeraxis <qt-info@nokia.com>2009-05-11 06:30:34 (GMT)
commit804a0ff4ad8c27ece2d403b8d9a4f6f65cdcf867 (patch)
tree0258fb5f685ccaa710f8ea8ec9da9b6aa9f91d35 /src/gui/painting
parentefb3e7288eec748db11c35de87239a1eff4d457c (diff)
parent842ba1b3878c2973b24936b18a7ee55bdd980be6 (diff)
downloadQt-804a0ff4ad8c27ece2d403b8d9a4f6f65cdcf867.zip
Qt-804a0ff4ad8c27ece2d403b8d9a4f6f65cdcf867.tar.gz
Qt-804a0ff4ad8c27ece2d403b8d9a4f6f65cdcf867.tar.bz2
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt
Conflicts: tests/auto/qtemporaryfile/qtemporaryfile.pro
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qbackingstore.cpp3
-rw-r--r--src/gui/painting/qblendfunctions.cpp12
-rw-r--r--src/gui/painting/qdrawhelper.cpp3
-rw-r--r--src/gui/painting/qpaintdevice_qws.cpp3
-rw-r--r--src/gui/painting/qpaintdevice_win.cpp5
-rw-r--r--src/gui/painting/qpaintdevice_x11.cpp216
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp17
-rw-r--r--src/gui/painting/qpaintengine_x11.cpp26
-rw-r--r--src/gui/painting/qpainter.cpp248
-rw-r--r--src/gui/painting/qprinter.cpp10
-rw-r--r--src/gui/painting/qwindowsurface_raster.cpp4
11 files changed, 302 insertions, 245 deletions
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp
index 8fb7a12..0a3a8dd 100644
--- a/src/gui/painting/qbackingstore.cpp
+++ b/src/gui/painting/qbackingstore.cpp
@@ -492,7 +492,8 @@ static inline void sendUpdateRequest(QWidget *widget, bool updateImmediately)
return;
#if defined(Q_WS_WIN) && !defined(Q_OS_WINCE)
- if (QApplicationPrivate::inSizeMove && widget->internalWinId() && !updateImmediately) {
+ if (QApplicationPrivate::inSizeMove && widget->internalWinId() && !updateImmediately
+ && !widget->testAttribute(Qt::WA_DontShowOnScreen)) {
// Tell Windows to send us a paint event if we're in WM_SIZE/WM_MOVE; posted events
// are blocked until the mouse button is released. See task 146849.
const QRegion rgn(qt_dirtyRegion(widget));
diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp
index dd7b016..93f11e1 100644
--- a/src/gui/painting/qblendfunctions.cpp
+++ b/src/gui/painting/qblendfunctions.cpp
@@ -44,8 +44,6 @@
QT_BEGIN_NAMESPACE
-static const qreal aliasedCoordinateDelta = 0.5 - 0.015625;
-
struct SourceOnlyAlpha
{
inline uchar alpha(uchar src) const { return src; }
@@ -140,14 +138,11 @@ struct Blend_ARGB32_on_RGB16_SourceAndConstAlpha {
template <typename SRC, typename T>
void qt_scale_image_16bit(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
- const QRectF &target,
+ const QRectF &targetRect,
const QRectF &srcRect,
const QRect &clip,
T blender)
{
- const QRectF targetRect = target.translated(aliasedCoordinateDelta,
- aliasedCoordinateDelta);
-
qreal sx = targetRect.width() / (qreal) srcRect.width();
qreal sy = targetRect.height() / (qreal) srcRect.height();
@@ -618,14 +613,11 @@ struct Blend_ARGB32_on_ARGB32_SourceAndConstAlpha {
template <typename T> void qt_scale_image_32bit(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
- const QRectF &target,
+ const QRectF &targetRect,
const QRectF &srcRect,
const QRect &clip,
T blender)
{
- const QRectF targetRect = target.translated(aliasedCoordinateDelta,
- aliasedCoordinateDelta);
-
qreal sx = targetRect.width() / (qreal) srcRect.width();
qreal sy = targetRect.height() / (qreal) srcRect.height();
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 36e4300..ed4dd57 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -2527,8 +2527,7 @@ static inline int color_burn_op(int dst, int src, int da, int sa)
if (src == 0 || src_da + dst_sa <= sa_da)
return qt_div_255(temp);
- else
- return qt_div_255(sa * (src_da + dst_sa - sa_da) / src + temp);
+ return qt_div_255(sa * (src_da + dst_sa - sa_da) / src + temp);
}
template <typename T>
diff --git a/src/gui/painting/qpaintdevice_qws.cpp b/src/gui/painting/qpaintdevice_qws.cpp
index 6a68d28..c67be86 100644
--- a/src/gui/painting/qpaintdevice_qws.cpp
+++ b/src/gui/painting/qpaintdevice_qws.cpp
@@ -81,9 +81,6 @@ int QPaintDevice::metric(PaintDeviceMetric m) const
}
}
-/*!
- \internal
-*/
QWSDisplay *QPaintDevice::qwsDisplay()
{
return qt_fbdpy;
diff --git a/src/gui/painting/qpaintdevice_win.cpp b/src/gui/painting/qpaintdevice_win.cpp
index 6cae744..7cd3392 100644
--- a/src/gui/painting/qpaintdevice_win.cpp
+++ b/src/gui/painting/qpaintdevice_win.cpp
@@ -71,16 +71,11 @@ int QPaintDevice::metric(PaintDeviceMetric) const
return 0;
}
-
-/*! \internal
-*/
HDC QPaintDevice::getDC() const
{
return 0;
}
-/*! \internal
-*/
void QPaintDevice::releaseDC(HDC) const
{
}
diff --git a/src/gui/painting/qpaintdevice_x11.cpp b/src/gui/painting/qpaintdevice_x11.cpp
index 4ea9f57..95cb115 100644
--- a/src/gui/painting/qpaintdevice_x11.cpp
+++ b/src/gui/painting/qpaintdevice_x11.cpp
@@ -106,33 +106,11 @@ int QPaintDevice::metric(PaintDeviceMetric) const
#ifdef QT3_SUPPORT
-/*!
- Use QX11Info::display() instead.
-
- \oldcode
- Display *display = widget->x11Display();
- \newcode
- Display *display = QX11Info::display();
- \endcode
-
- \sa QWidget::x11Info(), QX11Info::display()
-*/
Display *QPaintDevice::x11Display() const
{
return X11->display;
}
-/*!
- Use QX11Info::screen() instead.
-
- \oldcode
- int screen = widget->x11Screen();
- \newcode
- int screen = widget->x11Info().screen();
- \endcode
-
- \sa QWidget::x11Info(), QPixmap::x11Info()
-*/
int QPaintDevice::x11Screen() const
{
const QX11Info *info = qt_x11Info(this);
@@ -141,17 +119,6 @@ int QPaintDevice::x11Screen() const
return QX11Info::appScreen();
}
-/*!
- Use QX11Info::visual() instead.
-
- \oldcode
- void *visual = widget->x11Visual();
- \newcode
- void *visual = widget->x11Info().visual();
- \endcode
-
- \sa QWidget::x11Info(), QPixmap::x11Info()
-*/
void *QPaintDevice::x11Visual() const
{
const QX11Info *info = qt_x11Info(this);
@@ -160,17 +127,6 @@ void *QPaintDevice::x11Visual() const
return QX11Info::appVisual();
}
-/*!
- Use QX11Info::depth() instead.
-
- \oldcode
- int depth = widget->x11Depth();
- \newcode
- int depth = widget->x11Info().depth();
- \endcode
-
- \sa QWidget::x11Info(), QPixmap::x11Info()
-*/
int QPaintDevice::x11Depth() const
{
const QX11Info *info = qt_x11Info(this);
@@ -179,17 +135,6 @@ int QPaintDevice::x11Depth() const
return QX11Info::appDepth();
}
-/*!
- Use QX11Info::cells() instead.
-
- \oldcode
- int cells = widget->x11Cells();
- \newcode
- int cells = widget->x11Info().cells();
- \endcode
-
- \sa QWidget::x11Info(), QPixmap::x11Info()
-*/
int QPaintDevice::x11Cells() const
{
const QX11Info *info = qt_x11Info(this);
@@ -198,17 +143,6 @@ int QPaintDevice::x11Cells() const
return QX11Info::appCells();
}
-/*!
- Use QX11Info::colormap() instead.
-
- \oldcode
- unsigned long screen = widget->x11Colormap();
- \newcode
- unsigned long screen = widget->x11Info().colormap();
- \endcode
-
- \sa QWidget::x11Info(), QPixmap::x11Info()
-*/
Qt::HANDLE QPaintDevice::x11Colormap() const
{
const QX11Info *info = qt_x11Info(this);
@@ -217,17 +151,6 @@ Qt::HANDLE QPaintDevice::x11Colormap() const
return QX11Info::appColormap();
}
-/*!
- Use QX11Info::defaultColormap() instead.
-
- \oldcode
- bool isDefault = widget->x11DefaultColormap();
- \newcode
- bool isDefault = widget->x11Info().defaultColormap();
- \endcode
-
- \sa QWidget::x11Info(), QPixmap::x11Info()
-*/
bool QPaintDevice::x11DefaultColormap() const
{
const QX11Info *info = qt_x11Info(this);
@@ -236,17 +159,6 @@ bool QPaintDevice::x11DefaultColormap() const
return QX11Info::appDefaultColormap();
}
-/*!
- Use QX11Info::defaultVisual() instead.
-
- \oldcode
- bool isDefault = widget->x11DefaultVisual();
- \newcode
- bool isDefault = widget->x11Info().defaultVisual();
- \endcode
-
- \sa QWidget::x11Info(), QPixmap::x11Info()
-*/
bool QPaintDevice::x11DefaultVisual() const
{
const QX11Info *info = qt_x11Info(this);
@@ -255,176 +167,48 @@ bool QPaintDevice::x11DefaultVisual() const
return QX11Info::appDefaultVisual();
}
-/*!
- Use QX11Info::visual() instead.
-
- \oldcode
- void *visual = QPaintDevice::x11AppVisual(screen);
- \newcode
- void *visual = qApp->x11Info(screen).visual();
- \endcode
-
- \sa QWidget::x11Info(), QPixmap::x11Info()
-*/
void *QPaintDevice::x11AppVisual(int screen)
{ return QX11Info::appVisual(screen); }
-/*!
- Use QX11Info::colormap() instead.
-
- \oldcode
- unsigned long colormap = QPaintDevice::x11AppColormap(screen);
- \newcode
- unsigned long colormap = qApp->x11Info(screen).colormap();
- \endcode
-
- \sa QWidget::x11Info(), QPixmap::x11Info()
-*/
Qt::HANDLE QPaintDevice::x11AppColormap(int screen)
{ return QX11Info::appColormap(screen); }
-/*!
- Use QX11Info::display() instead.
-
- \oldcode
- Display *display = QPaintDevice::x11AppDisplay();
- \newcode
- Display *display = qApp->x11Info().display();
- \endcode
-
- \sa QWidget::x11Info(), QPixmap::x11Info()
-*/
Display *QPaintDevice::x11AppDisplay()
{ return QX11Info::display(); }
-/*!
- Use QX11Info::screen() instead.
-
- \oldcode
- int screen = QPaintDevice::x11AppScreen();
- \newcode
- int screen = qApp->x11Info().screen();
- \endcode
-
- \sa QWidget::x11Info(), QPixmap::x11Info()
-*/
int QPaintDevice::x11AppScreen()
{ return QX11Info::appScreen(); }
-/*!
- Use QX11Info::depth() instead.
-
- \oldcode
- int depth = QPaintDevice::x11AppDepth(screen);
- \newcode
- int depth = qApp->x11Info(screen).depth();
- \endcode
-
- \sa QWidget::x11Info(), QPixmap::x11Info()
-*/
int QPaintDevice::x11AppDepth(int screen)
{ return QX11Info::appDepth(screen); }
-/*!
- Use QX11Info::cells() instead.
-
- \oldcode
- int cells = QPaintDevice::x11AppCells(screen);
- \newcode
- int cells = qApp->x11Info(screen).cells();
- \endcode
-
- \sa QWidget::x11Info(), QPixmap::x11Info()
-*/
int QPaintDevice::x11AppCells(int screen)
{ return QX11Info::appCells(screen); }
-/*!
- Use QX11Info::appRootWindow() instead.
-
- \oldcode
- unsigned long window = QPaintDevice::x11AppRootWindow(screen);
- \newcode
- unsigned long window = qApp->x11Info(screen).appRootWindow();
- \endcode
-
- \sa QWidget::x11Info(), QPixmap::x11Info()
-*/
Qt::HANDLE QPaintDevice::x11AppRootWindow(int screen)
{ return QX11Info::appRootWindow(screen); }
-/*!
- Use QX11Info::defaultColormap() instead.
-
- \oldcode
- bool isDefault = QPaintDevice::x11AppDefaultColormap(screen);
- \newcode
- bool isDefault = qApp->x11Info(screen).defaultColormap();
- \endcode
-
- \sa QWidget::x11Info(), QPixmap::x11Info()
-*/
bool QPaintDevice::x11AppDefaultColormap(int screen)
{ return QX11Info::appDefaultColormap(screen); }
-/*!
- Use QX11Info::defaultVisual() instead.
-
- \oldcode
- bool isDefault = QPaintDevice::x11AppDefaultVisual(screen);
- \newcode
- bool isDefault = qApp->x11Info(screen).defaultVisual();
- \endcode
-
- \sa QWidget::x11Info(), QPixmap::x11Info()
-*/
bool QPaintDevice::x11AppDefaultVisual(int screen)
{ return QX11Info::appDefaultVisual(screen); }
-/*!
- Use QX11Info::setAppDpiX() instead.
-*/
void QPaintDevice::x11SetAppDpiX(int dpi, int screen)
{
QX11Info::setAppDpiX(dpi, screen);
}
-/*!
- Use QX11Info::setAppDpiY() instead.
-*/
void QPaintDevice::x11SetAppDpiY(int dpi, int screen)
{
QX11Info::setAppDpiY(dpi, screen);
}
-
-/*!
- Use QX11Info::appDpiX() instead.
-
- \oldcode
- bool isDefault = QPaintDevice::x11AppDpiX(screen);
- \newcode
- bool isDefault = qApp->x11Info(screen).appDpiX();
- \endcode
-
- \sa QWidget::x11Info(), QPixmap::x11Info()
-*/
int QPaintDevice::x11AppDpiX(int screen)
{
return QX11Info::appDpiX(screen);
}
-/*!
- Use QX11Info::appDpiY() instead.
-
- \oldcode
- bool isDefault = QPaintDevice::x11AppDpiY(screen);
- \newcode
- bool isDefault = qApp->x11Info(screen).appDpiY();
- \endcode
-
- \sa QWidget::x11Info(), QPixmap::x11Info()
-*/
int QPaintDevice::x11AppDpiY(int screen)
{
return QX11Info::appDpiY(screen);
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index ba8f2a3..1192a58 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -2575,7 +2575,12 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
QRasterPaintEngineState *s = state();
const bool aa = s->flags.antialiased || s->flags.bilinear;
if (!aa && sr.size() == QSize(1, 1)) {
+ // as fillRect will apply the aliased coordinate delta we need to
+ // subtract it here as we don't use it for image drawing
+ QTransform old = s->matrix;
+ s->matrix = s->matrix * QTransform::fromTranslate(-aliasedCoordinateDelta, -aliasedCoordinateDelta);
fillRect(r, QColor::fromRgba(img.pixel(sr.x(), sr.y())));
+ s->matrix = old;
return;
}
@@ -2609,6 +2614,18 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
return;
d->image_filler_xform.setupMatrix(copy, s->flags.bilinear);
+ if (!aa && s->matrix.type() == QTransform::TxScale) {
+ QRectF rr = s->matrix.mapRect(r);
+
+ const int x1 = qRound(rr.x());
+ const int y1 = qRound(rr.y());
+ const int x2 = qRound(rr.right());
+ const int y2 = qRound(rr.bottom());
+
+ fillRect_normalized(QRect(x1, y1, x2-x1, y2-y1), &d->image_filler_xform, d);
+ return;
+ }
+
#ifdef QT_FAST_SPANS
ensureState();
if (s->flags.tx_noshear || s->matrix.type() == QTransform::TxScale) {
diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp
index 4b2fbca..9cc9683 100644
--- a/src/gui/painting/qpaintengine_x11.cpp
+++ b/src/gui/painting/qpaintengine_x11.cpp
@@ -1543,6 +1543,8 @@ void QX11PaintEnginePrivate::fillPolygon_dev(const QPointF *polygonPoints, int p
QX11PaintEnginePrivate::GCMode gcMode,
QPaintEngine::PolygonDrawMode mode)
{
+ Q_Q(QX11PaintEngine);
+
int clippedCount = 0;
qt_float_point *clippedPoints = 0;
@@ -1617,7 +1619,29 @@ void QX11PaintEnginePrivate::fillPolygon_dev(const QPointF *polygonPoints, int p
} else
#endif
if (fill.style() != Qt::NoBrush) {
- if (clippedCount > 0) {
+ if (clippedCount > 200000) {
+ QPolygon poly;
+ for (int i = 0; i < clippedCount; ++i)
+ poly << QPoint(qFloor(clippedPoints[i].x), qFloor(clippedPoints[i].y));
+
+ const QRect bounds = poly.boundingRect();
+ const QRect aligned = bounds
+ & QRect(QPoint(), QSize(pdev->width(), pdev->height()));
+
+ QImage img(aligned.size(), QImage::Format_ARGB32_Premultiplied);
+ img.fill(0);
+
+ QPainter painter(&img);
+ painter.translate(-aligned.x(), -aligned.y());
+ painter.setPen(Qt::NoPen);
+ painter.setBrush(fill);
+ if (gcMode == BrushGC)
+ painter.setBrushOrigin(q->painter()->brushOrigin());
+ painter.drawPolygon(poly);
+ painter.end();
+
+ q->drawImage(aligned, img, img.rect(), Qt::AutoColor);
+ } else if (clippedCount > 0) {
QVarLengthArray<XPoint> xpoints(clippedCount);
for (int i = 0; i < clippedCount; ++i) {
xpoints[i].x = qFloor(clippedPoints[i].x);
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index afc4211..baa9ce3 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -8571,4 +8571,252 @@ void qt_draw_helper(QPainterPrivate *p, const QPainterPath &path, QPainterPrivat
p->draw_helper(path, operation);
}
+/*! \fn Display *QPaintDevice::x11Display() const
+ Use QX11Info::display() instead.
+
+ \oldcode
+ Display *display = widget->x11Display();
+ \newcode
+ Display *display = QX11Info::display();
+ \endcode
+
+ \sa QWidget::x11Info(), QX11Info::display()
+*/
+
+/*! \fn int QPaintDevice::x11Screen() const
+ Use QX11Info::screen() instead.
+
+ \oldcode
+ int screen = widget->x11Screen();
+ \newcode
+ int screen = widget->x11Info().screen();
+ \endcode
+
+ \sa QWidget::x11Info(), QPixmap::x11Info()
+*/
+
+/*! \fn void *QPaintDevice::x11Visual() const
+ Use QX11Info::visual() instead.
+
+ \oldcode
+ void *visual = widget->x11Visual();
+ \newcode
+ void *visual = widget->x11Info().visual();
+ \endcode
+
+ \sa QWidget::x11Info(), QPixmap::x11Info()
+*/
+
+/*! \fn int QPaintDevice::x11Depth() const
+ Use QX11Info::depth() instead.
+
+ \oldcode
+ int depth = widget->x11Depth();
+ \newcode
+ int depth = widget->x11Info().depth();
+ \endcode
+
+ \sa QWidget::x11Info(), QPixmap::x11Info()
+*/
+
+/*! \fn int QPaintDevice::x11Cells() const
+ Use QX11Info::cells() instead.
+
+ \oldcode
+ int cells = widget->x11Cells();
+ \newcode
+ int cells = widget->x11Info().cells();
+ \endcode
+
+ \sa QWidget::x11Info(), QPixmap::x11Info()
+*/
+
+/*! \fn Qt::HANDLE QPaintDevice::x11Colormap() const
+ Use QX11Info::colormap() instead.
+
+ \oldcode
+ unsigned long screen = widget->x11Colormap();
+ \newcode
+ unsigned long screen = widget->x11Info().colormap();
+ \endcode
+
+ \sa QWidget::x11Info(), QPixmap::x11Info()
+*/
+
+/*! \fn bool QPaintDevice::x11DefaultColormap() const
+ Use QX11Info::defaultColormap() instead.
+
+ \oldcode
+ bool isDefault = widget->x11DefaultColormap();
+ \newcode
+ bool isDefault = widget->x11Info().defaultColormap();
+ \endcode
+
+ \sa QWidget::x11Info(), QPixmap::x11Info()
+*/
+
+/*! \fn bool QPaintDevice::x11DefaultVisual() const
+ Use QX11Info::defaultVisual() instead.
+
+ \oldcode
+ bool isDefault = widget->x11DefaultVisual();
+ \newcode
+ bool isDefault = widget->x11Info().defaultVisual();
+ \endcode
+
+ \sa QWidget::x11Info(), QPixmap::x11Info()
+*/
+
+/*! \fn void *QPaintDevice::x11AppVisual(int screen)
+ Use QX11Info::visual() instead.
+
+ \oldcode
+ void *visual = QPaintDevice::x11AppVisual(screen);
+ \newcode
+ void *visual = qApp->x11Info(screen).visual();
+ \endcode
+
+ \sa QWidget::x11Info(), QPixmap::x11Info()
+*/
+
+/*! \fn Qt::HANDLE QPaintDevice::x11AppColormap(int screen)
+ Use QX11Info::colormap() instead.
+
+ \oldcode
+ unsigned long colormap = QPaintDevice::x11AppColormap(screen);
+ \newcode
+ unsigned long colormap = qApp->x11Info(screen).colormap();
+ \endcode
+
+ \sa QWidget::x11Info(), QPixmap::x11Info()
+*/
+
+/*! \fn Display *QPaintDevice::x11AppDisplay()
+ Use QX11Info::display() instead.
+
+ \oldcode
+ Display *display = QPaintDevice::x11AppDisplay();
+ \newcode
+ Display *display = qApp->x11Info().display();
+ \endcode
+
+ \sa QWidget::x11Info(), QPixmap::x11Info()
+*/
+
+/*! \fn int QPaintDevice::x11AppScreen()
+ Use QX11Info::screen() instead.
+
+ \oldcode
+ int screen = QPaintDevice::x11AppScreen();
+ \newcode
+ int screen = qApp->x11Info().screen();
+ \endcode
+
+ \sa QWidget::x11Info(), QPixmap::x11Info()
+*/
+
+/*! \fn int QPaintDevice::x11AppDepth(int screen)
+ Use QX11Info::depth() instead.
+
+ \oldcode
+ int depth = QPaintDevice::x11AppDepth(screen);
+ \newcode
+ int depth = qApp->x11Info(screen).depth();
+ \endcode
+
+ \sa QWidget::x11Info(), QPixmap::x11Info()
+*/
+
+/*! \fn int QPaintDevice::x11AppCells(int screen)
+ Use QX11Info::cells() instead.
+
+ \oldcode
+ int cells = QPaintDevice::x11AppCells(screen);
+ \newcode
+ int cells = qApp->x11Info(screen).cells();
+ \endcode
+
+ \sa QWidget::x11Info(), QPixmap::x11Info()
+*/
+
+/*! \fn Qt::HANDLE QPaintDevice::x11AppRootWindow(int screen)
+ Use QX11Info::appRootWindow() instead.
+
+ \oldcode
+ unsigned long window = QPaintDevice::x11AppRootWindow(screen);
+ \newcode
+ unsigned long window = qApp->x11Info(screen).appRootWindow();
+ \endcode
+
+ \sa QWidget::x11Info(), QPixmap::x11Info()
+*/
+
+/*! \fn bool QPaintDevice::x11AppDefaultColormap(int screen)
+ Use QX11Info::defaultColormap() instead.
+
+ \oldcode
+ bool isDefault = QPaintDevice::x11AppDefaultColormap(screen);
+ \newcode
+ bool isDefault = qApp->x11Info(screen).defaultColormap();
+ \endcode
+
+ \sa QWidget::x11Info(), QPixmap::x11Info()
+*/
+
+/*! \fn bool QPaintDevice::x11AppDefaultVisual(int screen)
+ Use QX11Info::defaultVisual() instead.
+
+ \oldcode
+ bool isDefault = QPaintDevice::x11AppDefaultVisual(screen);
+ \newcode
+ bool isDefault = qApp->x11Info(screen).defaultVisual();
+ \endcode
+
+ \sa QWidget::x11Info(), QPixmap::x11Info()
+*/
+
+/*! \fn void QPaintDevice::x11SetAppDpiX(int dpi, int screen)
+ Use QX11Info::setAppDpiX() instead.
+*/
+
+/*! \fn void QPaintDevice::x11SetAppDpiY(int dpi, int screen)
+ Use QX11Info::setAppDpiY() instead.
+*/
+
+/*! \fn int QPaintDevice::x11AppDpiX(int screen)
+ Use QX11Info::appDpiX() instead.
+
+ \oldcode
+ bool isDefault = QPaintDevice::x11AppDpiX(screen);
+ \newcode
+ bool isDefault = qApp->x11Info(screen).appDpiX();
+ \endcode
+
+ \sa QWidget::x11Info(), QPixmap::x11Info()
+*/
+
+/*! \fn int QPaintDevice::x11AppDpiY(int screen)
+ Use QX11Info::appDpiY() instead.
+
+ \oldcode
+ bool isDefault = QPaintDevice::x11AppDpiY(screen);
+ \newcode
+ bool isDefault = qApp->x11Info(screen).appDpiY();
+ \endcode
+
+ \sa QWidget::x11Info(), QPixmap::x11Info()
+*/
+
+/*! \fn HDC QPaintDevice::getDC() const
+ \internal
+*/
+
+/*! \fn void QPaintDevice::releaseDC(HDC) const
+ \internal
+*/
+
+/*! \fn QWSDisplay *QPaintDevice::qwsDisplay()
+ \internal
+*/
+
QT_END_NAMESPACE
diff --git a/src/gui/painting/qprinter.cpp b/src/gui/painting/qprinter.cpp
index 4f3e71c..5090b3a 100644
--- a/src/gui/painting/qprinter.cpp
+++ b/src/gui/painting/qprinter.cpp
@@ -284,8 +284,8 @@ void QPrinterPrivate::addToManualSetList(QPrintEngine::PrintEnginePropertyKey ke
to send PostScript or PDF output to the printer. As an alternative,
the printProgram() function can be used to specify the command or utility
to use instead of the system default.
-
- Note that setting parameters like paper size and resolution on an
+
+ Note that setting parameters like paper size and resolution on an
invalid printer is undefined. You can use QPrinter::isValid() to
verify this before changing any parameters.
@@ -744,7 +744,7 @@ void QPrinter::setOutputFormat(OutputFormat format)
#ifndef QT_NO_PDF
Q_D(QPrinter);
- if (d->outputFormat == format)
+ if (d->validPrinter && d->outputFormat == format)
return;
d->outputFormat = format;
@@ -773,8 +773,8 @@ void QPrinter::setOutputFormat(OutputFormat format)
if (def_engine)
delete oldPrintEngine;
- d->validPrinter = d->outputFormat == QPrinter::PdfFormat || d->outputFormat == QPrinter::PostScriptFormat;
-
+ if (d->outputFormat == QPrinter::PdfFormat || d->outputFormat == QPrinter::PostScriptFormat)
+ d->validPrinter = true;
#else
Q_UNUSED(format);
#endif
diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp
index 7a74fe0..110ba2f 100644
--- a/src/gui/painting/qwindowsurface_raster.cpp
+++ b/src/gui/painting/qwindowsurface_raster.cpp
@@ -142,8 +142,7 @@ void QRasterWindowSurface::beginPaint(const QRegion &rgn)
p.fillRect(*it, blank);
}
}
-#endif
-#if defined(Q_OS_WINCE)
+#else
Q_UNUSED(rgn);
#endif
}
@@ -250,6 +249,7 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi
// d->image->image.save("flush.png");
+ Q_UNUSED(offset);
// Get a context for the widget.
#ifndef QT_MAC_USE_COCOA
CGContextRef context;