summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-05-05 22:22:08 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-05-05 22:22:08 (GMT)
commit8ad9a7f781f1f092a2120773dccce4e8f50e675a (patch)
tree8d8f5303b1392aa2f157bfd3009ecc80a49a5535 /src
parent508f241a6a56b0a31472ed99ad60eb3a22388c20 (diff)
downloadQt-8ad9a7f781f1f092a2120773dccce4e8f50e675a.zip
Qt-8ad9a7f781f1f092a2120773dccce4e8f50e675a.tar.gz
Qt-8ad9a7f781f1f092a2120773dccce4e8f50e675a.tar.bz2
Cleaned up code
Put all variables in the same area for QDirectFBPaintEnginePrivate. Make QDirectFBPaintEngine a friend. Also, do away with setClipDirty and replace it with d->clipDirty = true; Reviewed-by: TrustMe
Diffstat (limited to 'src')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp44
1 files changed, 20 insertions, 24 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
index bc8efdd..6d8f617 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -214,18 +214,6 @@ public:
QDirectFBPaintEnginePrivate(QDirectFBPaintEngine *p);
~QDirectFBPaintEnginePrivate();
- IDirectFBSurface *surface;
-
- QPen pen;
-
- bool antialiased;
- bool forceRasterPrimitives;
-
- bool simplePen;
-
- bool matrixRotShear;
- enum Scale { NoScale, Scaled, NegativeScale } scale;
-
void setTransform(const QTransform &m);
void setPen(const QPen &pen);
void setCompositionMode(QPainter::CompositionMode mode);
@@ -255,7 +243,6 @@ public:
void blit(const QRectF &dest, IDirectFBSurface *surface, const QRectF &src);
inline void updateClip();
- inline void setClipDirty();
void systemStateChanged();
void begin(QPaintDevice *device);
@@ -268,10 +255,23 @@ public:
#endif
void prepareForBlit(bool alpha);
+private:
+ IDirectFBSurface *surface;
+
+ QPen pen;
+
+ bool antialiased;
+ bool forceRasterPrimitives;
+
+ bool simplePen;
+
+ bool matrixRotShear;
+ enum Scale { NoScale, Scaled, NegativeScale } scale;
+
SurfaceCache *surfaceCache;
QTransform transform;
int lastLockedHeight;
-private:
+
IDirectFB *fb;
DFBSurfaceDescription fbDescription;
int fbWidth;
@@ -289,6 +289,7 @@ private:
void *lockedMemory;
QDirectFBPaintEngine *q;
+ friend class QDirectFBPaintEngine;
};
QDirectFBPaintEngine::QDirectFBPaintEngine(QPaintDevice *device)
@@ -322,7 +323,7 @@ bool QDirectFBPaintEngine::end()
void QDirectFBPaintEngine::clipEnabledChanged()
{
Q_D(QDirectFBPaintEngine);
- d->setClipDirty();
+ d->dirtyClip = true;
QRasterPaintEngine::clipEnabledChanged();
}
@@ -370,7 +371,7 @@ void QDirectFBPaintEngine::setState(QPainterState *s)
{
Q_D(QDirectFBPaintEngine);
QRasterPaintEngine::setState(s);
- d->setClipDirty();
+ d->dirtyClip = true;
d->setPen(state()->pen);
d->setOpacity(quint8(state()->opacity * 255));
d->setCompositionMode(state()->compositionMode());
@@ -380,7 +381,7 @@ void QDirectFBPaintEngine::setState(QPainterState *s)
void QDirectFBPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op)
{
Q_D(QDirectFBPaintEngine);
- d->setClipDirty();
+ d->dirtyClip = true;
const QPoint bottom = d->transform.map(QPoint(0, path.controlPointRect().y2));
if (bottom.y() >= d->lastLockedHeight)
d->lock();
@@ -390,7 +391,7 @@ void QDirectFBPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op)
void QDirectFBPaintEngine::clip(const QRect &rect, Qt::ClipOperation op)
{
Q_D(QDirectFBPaintEngine);
- d->setClipDirty();
+ d->dirtyClip = true;
if (d->clip() && !d->clip()->hasRectClip && d->clip()->enabled) {
const QPoint bottom = d->transform.map(QPoint(0, rect.bottom()));
if (bottom.y() >= d->lastLockedHeight)
@@ -839,11 +840,6 @@ bool QDirectFBPaintEnginePrivate::isSimpleBrush(const QBrush &brush) const
return (brush.style() == Qt::NoBrush) || (brush.style() == Qt::SolidPattern && !antialiased);
}
-void QDirectFBPaintEnginePrivate::setClipDirty()
-{
- dirtyClip = true;
-}
-
void QDirectFBPaintEnginePrivate::lock()
{
// We will potentially get a new pointer to the buffer after a
@@ -1235,7 +1231,7 @@ void QDirectFBPaintEnginePrivate::updateClip()
void QDirectFBPaintEnginePrivate::systemStateChanged()
{
- setClipDirty();
+ dirtyClip = true;
QRasterPaintEnginePrivate::systemStateChanged();
}