summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpaintengineex.cpp
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2010-02-23 09:11:03 (GMT)
committerTrond Kjernåsen <trond@trolltech.com>2010-02-23 09:11:03 (GMT)
commit58533cbc7322c4f821f24043028e47925b537419 (patch)
tree6821780e44a2a603e828b10e6c7307b06ec1e8e3 /src/gui/painting/qpaintengineex.cpp
parenta948f901b196bab121cb8b5736204b4ce0c09e94 (diff)
downloadQt-58533cbc7322c4f821f24043028e47925b537419.zip
Qt-58533cbc7322c4f821f24043028e47925b537419.tar.gz
Qt-58533cbc7322c4f821f24043028e47925b537419.tar.bz2
Made the qDrawPixmaps() API public (with modifications).
QPainter has now gotten a drawPixmapFragments() function together with a Fragment class that describes how each pixmap fragment is supposed to be drawn. Reviewed-by: Gunnar Reviewed-by: Samuel
Diffstat (limited to 'src/gui/painting/qpaintengineex.cpp')
-rw-r--r--src/gui/painting/qpaintengineex.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index 4f2fffa..ad486ba 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -970,23 +970,26 @@ void QPaintEngineEx::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, con
fill(path, brush);
}
-void QPaintEngineEx::drawPixmaps(const QDrawPixmaps::Data *drawingData, int dataCount, const QPixmap &pixmap, QDrawPixmaps::DrawingHints /*hints*/)
+void QPaintEngineEx::drawPixmapFragments(const QPainter::Fragment *fragments, int fragmentCount,
+ const QPixmap &pixmap, QPainter::FragmentHints /*hints*/)
{
qreal oldOpacity = state()->opacity;
QTransform oldTransform = state()->matrix;
- for (int i = 0; i < dataCount; ++i) {
+ for (int i = 0; i < fragmentCount; ++i) {
QTransform transform = oldTransform;
- transform.translate(drawingData[i].point.x(), drawingData[i].point.y());
- transform.rotate(drawingData[i].rotation);
- state()->opacity = oldOpacity * drawingData[i].opacity;
+ transform.translate(fragments[i].x, fragments[i].y);
+ transform.rotate(fragments[i].rotation);
+ state()->opacity = oldOpacity * fragments[i].opacity;
state()->matrix = transform;
opacityChanged();
transformChanged();
- qreal w = drawingData[i].scaleX * drawingData[i].source.width();
- qreal h = drawingData[i].scaleY * drawingData[i].source.height();
- drawPixmap(QRectF(-0.5 * w, -0.5 * h, w, h), pixmap, drawingData[i].source);
+ qreal w = fragments[i].scaleX * fragments[i].width;
+ qreal h = fragments[i].scaleY * fragments[i].height;
+ QRectF sourceRect(fragments[i].sourceLeft, fragments[i].sourceTop,
+ fragments[i].width, fragments[i].height);
+ drawPixmap(QRectF(-0.5 * w, -0.5 * h, w, h), pixmap, sourceRect);
}
state()->opacity = oldOpacity;