diff options
author | David Boddie <dboddie@trolltech.com> | 2009-08-18 14:25:58 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2009-08-18 14:25:58 (GMT) |
commit | d136f3c444041d07a7a5fe9358c9200c8bdb7602 (patch) | |
tree | 5acceecd6879d3c96fc51c3a9dda89c7e118b55d /src/gui/painting | |
parent | e1869593a4c2a074cc916c770e258d6f2349db01 (diff) | |
parent | 68b7514840fe29f84af8d418538084ed337bd171 (diff) | |
download | Qt-d136f3c444041d07a7a5fe9358c9200c8bdb7602.zip Qt-d136f3c444041d07a7a5fe9358c9200c8bdb7602.tar.gz Qt-d136f3c444041d07a7a5fe9358c9200c8bdb7602.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qpaintdevice.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qpaintdevice_qws.cpp | 33 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 14 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_x11.cpp | 16 |
4 files changed, 28 insertions, 37 deletions
diff --git a/src/gui/painting/qpaintdevice.cpp b/src/gui/painting/qpaintdevice.cpp index 6477952..6a2a4c4 100644 --- a/src/gui/painting/qpaintdevice.cpp +++ b/src/gui/painting/qpaintdevice.cpp @@ -64,3 +64,5 @@ int QPaintDevice::metric(PaintDeviceMetric) const qWarning("QPaintDevice::metrics: Device has no metric information"); return 0; } + +QT_END_NAMESPACE diff --git a/src/gui/painting/qpaintdevice_qws.cpp b/src/gui/painting/qpaintdevice_qws.cpp index 9a6a3d3..b161cb8 100644 --- a/src/gui/painting/qpaintdevice_qws.cpp +++ b/src/gui/painting/qpaintdevice_qws.cpp @@ -48,39 +48,6 @@ QT_BEGIN_NAMESPACE -QPaintDevice::QPaintDevice() -{ - painters = 0; -} - -extern void qt_painter_removePaintDevice(QPaintDevice *); //qpainter.cpp - - -QPaintDevice::~QPaintDevice() -{ - if (paintingActive()) - qWarning("QPaintDevice: Cannot destroy paint device that is being " - "painted"); - qt_painter_removePaintDevice(this); -} - - -int QPaintDevice::metric(PaintDeviceMetric m) const -{ - qWarning("QPaintDevice::metrics: Device has no metric information"); - if (m == PdmDpiX) { - return 72; - } else if (m == PdmDpiY) { - return 72; - } else if (m == PdmNumColors) { - // FIXME: does this need to be a real value? - return 256; - } else { - qDebug("Unrecognised metric %d!",m); - return 0; - } -} - QWSDisplay *QPaintDevice::qwsDisplay() { return qt_fbdpy; diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 8b83f02..547818c 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -5198,6 +5198,13 @@ static void drawLine_midpoint_i(int x1, int y1, int x2, int y2, ProcessSpans spa dy = -dy; } + int x_lower_limit = - 128; + if (x1 < x_lower_limit) { + int cy = dy * (x_lower_limit - x1) / dx + y1; + drawLine_midpoint_i(x_lower_limit, cy, x2, y2, span_func, data, style, devRect); + return; + } + if (style == LineDrawNormal) --x2; @@ -5335,6 +5342,13 @@ static void drawLine_midpoint_i(int x1, int y1, int x2, int y2, ProcessSpans spa dx = -dx; } + int y_lower_limit = - 128; + if (y1 < y_lower_limit) { + int cx = dx * (y_lower_limit - y1) / dy + x1; + drawLine_midpoint_i(cx, y_lower_limit, x2, y2, span_func, data, style, devRect); + return; + } + if (style == LineDrawNormal) --y2; diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp index 6816aac..a4d34b5 100644 --- a/src/gui/painting/qpaintengine_x11.cpp +++ b/src/gui/painting/qpaintengine_x11.cpp @@ -2459,15 +2459,23 @@ void QX11PaintEngine::drawFreetype(const QPointF &p, const QTextItemInt &ti) XRectangle rects[rectcount]; int num_rects = 0; + QPoint delta(qRound(d->matrix.dx()), qRound(d->matrix.dy())); + QRect clip(d->polygonClipper.boundingRect()); for (int i=0; i < path.elementCount(); i+=5) { int x = qRound(path.elementAt(i).x); int y = qRound(path.elementAt(i).y); int w = qRound(path.elementAt(i+1).x) - x; int h = qRound(path.elementAt(i+2).y) - y; - rects[num_rects].x = x + qRound(d->matrix.dx()); - rects[num_rects].y = y + qRound(d->matrix.dy()); - rects[num_rects].width = w; - rects[num_rects].height = h; + + QRect rect = QRect(x + delta.x(), y + delta.y(), w, h); + rect = rect.intersected(clip); + if (rect.isEmpty()) + continue; + + rects[num_rects].x = short(rect.x()); + rects[num_rects].y = short(rect.y()); + rects[num_rects].width = ushort(rect.width()); + rects[num_rects].height = ushort(rect.height()); ++num_rects; if (num_rects == rectcount) { XFillRectangles(d->dpy, d->hd, d->gc, rects, num_rects); |