diff options
author | Anders Bakken <anders.bakken@nokia.com> | 2009-04-28 17:22:57 (GMT) |
---|---|---|
committer | Anders Bakken <anders.bakken@nokia.com> | 2009-04-28 17:24:41 (GMT) |
commit | b4caab9d25d1a2a6f95bf4bd15094475586ccf6a (patch) | |
tree | 856d77f286a6aef756b56f937d4757065d96309c /src/plugins | |
parent | cde40ce4a211816bf4222fa5487139c416f7b165 (diff) | |
download | Qt-b4caab9d25d1a2a6f95bf4bd15094475586ccf6a.zip Qt-b4caab9d25d1a2a6f95bf4bd15094475586ccf6a.tar.gz Qt-b4caab9d25d1a2a6f95bf4bd15094475586ccf6a.tar.bz2 |
Cleaned up constness errors
All these drawing functions really shouldn't be const even if some of
them can be. They should never be called from const functions and
when/if they change pen/brush stuff they cease being able to be const.
Also make sure fillRegion() uses the right brush.
Reviewed-by: Donald <qt-info@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index ba5d71a..83c2039 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -270,14 +270,14 @@ public: inline bool dfbCanHandleClip() const; inline bool isSimpleBrush(const QBrush &brush) const; - void drawLines(const QLine *lines, int count) const; - void drawLines(const QLineF *lines, int count) const; + void drawLines(const QLine *lines, int count); + void drawLines(const QLineF *lines, int count); - void fillRegion(const QRegion &r) const; - void fillRects(const QRect *rects, int count) const; - void drawRects(const QRect *rects, int count) const; - void fillRects(const QRectF *rects, int count) const; - void drawRects(const QRectF *rects, int count) const; + void fillRegion(const QRegion &r); + void fillRects(const QRect *rects, int count); + void drawRects(const QRect *rects, int count); + void fillRects(const QRectF *rects, int count); + void drawRects(const QRectF *rects, int count); void drawPixmap(const QRectF &dest, @@ -545,7 +545,7 @@ void QDirectFBPaintEnginePrivate::setDFBColor(const QColor &color) surface->SetDrawingFlags(surface, DFBSurfaceDrawingFlags(drawingFlags)); } -void QDirectFBPaintEnginePrivate::drawLines(const QLine *lines, int n) const +void QDirectFBPaintEnginePrivate::drawLines(const QLine *lines, int n) { for (int i = 0; i < n; ++i) { const QLine l = transform.map(lines[i]); @@ -553,7 +553,7 @@ void QDirectFBPaintEnginePrivate::drawLines(const QLine *lines, int n) const } } -void QDirectFBPaintEnginePrivate::drawLines(const QLineF *lines, int n) const +void QDirectFBPaintEnginePrivate::drawLines(const QLineF *lines, int n) { for (int i = 0; i < n; ++i) { const QLine l = transform.map(lines[i]).toLine(); @@ -561,14 +561,16 @@ void QDirectFBPaintEnginePrivate::drawLines(const QLineF *lines, int n) const } } -void QDirectFBPaintEnginePrivate::fillRegion(const QRegion ®ion) const +void QDirectFBPaintEnginePrivate::fillRegion(const QRegion ®ion) { + Q_ASSERT(isSimpleBrush(q->state()->brush)); + setDFBColor(q->state()->brush.color()); const QVector<QRect> rects = region.rects(); const int n = rects.size(); fillRects(rects.constData(), n); } -void QDirectFBPaintEnginePrivate::fillRects(const QRect *rects, int n) const +void QDirectFBPaintEnginePrivate::fillRects(const QRect *rects, int n) { for (int i = 0; i < n; ++i) { const QRect r = transform.mapRect(rects[i]); @@ -577,7 +579,7 @@ void QDirectFBPaintEnginePrivate::fillRects(const QRect *rects, int n) const } } -void QDirectFBPaintEnginePrivate::fillRects(const QRectF *rects, int n) const +void QDirectFBPaintEnginePrivate::fillRects(const QRectF *rects, int n) { for (int i = 0; i < n; ++i) { const QRect r = transform.mapRect(rects[i]).toRect(); @@ -586,7 +588,7 @@ void QDirectFBPaintEnginePrivate::fillRects(const QRectF *rects, int n) const } } -void QDirectFBPaintEnginePrivate::drawRects(const QRect *rects, int n) const +void QDirectFBPaintEnginePrivate::drawRects(const QRect *rects, int n) { for (int i = 0; i < n; ++i) { const QRect r = transform.mapRect(rects[i]); @@ -595,7 +597,7 @@ void QDirectFBPaintEnginePrivate::drawRects(const QRect *rects, int n) const } } -void QDirectFBPaintEnginePrivate::drawRects(const QRectF *rects, int n) const +void QDirectFBPaintEnginePrivate::drawRects(const QRectF *rects, int n) { for (int i = 0; i < n; ++i) { const QRect r = transform.mapRect(rects[i]).toRect(); |