diff options
author | Andreas Kling <andreas.kling@nokia.com> | 2010-12-20 12:05:27 (GMT) |
---|---|---|
committer | Andreas Kling <andreas.kling@nokia.com> | 2010-12-20 12:09:00 (GMT) |
commit | 48e7c71d1165f0c60f56e0b769b35df2658e8e96 (patch) | |
tree | cbde54c191881cf4dcb052379b032ee4187888c3 /src/gui | |
parent | 09317dda494a51d101723131c5a01af4149ac5de (diff) | |
download | Qt-48e7c71d1165f0c60f56e0b769b35df2658e8e96.zip Qt-48e7c71d1165f0c60f56e0b769b35df2658e8e96.tar.gz Qt-48e7c71d1165f0c60f56e0b769b35df2658e8e96.tar.bz2 |
Make the QRasterPaintEngineState copy constructor cheaper.
Use initializer syntax to avoid default-constructing a throwaway
QBrush and QPen.
Reviewed-by: Samuel Rødal
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 3186749..7fc90b8 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -662,31 +662,23 @@ QRasterPaintEngineState::QRasterPaintEngineState() QRasterPaintEngineState::QRasterPaintEngineState(QRasterPaintEngineState &s) : QPainterState(s) + , stroker(s.stroker) + , lastBrush(s.lastBrush) + , brushData(s.brushData) + , lastPen(s.lastPen) + , penData(s.penData) + , fillFlags(s.fillFlags) + , strokeFlags(s.strokeFlags) + , pixmapFlags(s.pixmapFlags) + , intOpacity(s.intOpacity) + , txscale(s.txscale) + , flag_bits(s.flag_bits) + , clip(s.clip) + , dirty(s.dirty) { - stroker = s.stroker; - - lastBrush = s.lastBrush; - brushData = s.brushData; brushData.tempImage = 0; - - lastPen = s.lastPen; - penData = s.penData; penData.tempImage = 0; - - fillFlags = s.fillFlags; - strokeFlags = s.strokeFlags; - pixmapFlags = s.pixmapFlags; - - intOpacity = s.intOpacity; - - txscale = s.txscale; - - flag_bits = s.flag_bits; - - clip = s.clip; flags.has_clip_ownership = false; - - dirty = s.dirty; } /*! |