diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-06-26 11:08:22 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-06-26 11:08:22 +0000 |
commit | 50536de838791114f498d871e7fe888f02eccbbc (patch) | |
tree | 97e95ff565c77d8f946e9754f7a49373be4ecaab | |
parent | aa1eb741383d5b7d4a3dfefd2ebd8136ec18b258 (diff) |
INTEGRATION: CWS aw046 (1.5.2); FILE MERGED
2007/05/30 14:35:46 aw 1.5.2.4: #i74769# code cleanups
2007/04/26 10:26:01 aw 1.5.2.3: #i74769#
2007/04/03 10:02:30 aw 1.5.2.2: #i74769# removed ExpandPaintClipRegion
2007/03/06 16:01:48 aw 1.5.2.1: #i74769# in-between progess state
-rw-r--r-- | svx/source/svdraw/sdrpaintwindow.cxx | 50 |
1 files changed, 32 insertions, 18 deletions
diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx index 2b08b57b83..0f18f66afb 100644 --- a/svx/source/svdraw/sdrpaintwindow.cxx +++ b/svx/source/svdraw/sdrpaintwindow.cxx @@ -4,9 +4,9 @@ * * $RCSfile: sdrpaintwindow.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: kz $ $Date: 2007-02-12 14:40:57 $ + * last change: $Author: hr $ $Date: 2007-06-26 12:08:22 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -88,28 +88,42 @@ void SdrPreRenderDevice::PreparePreRenderDevice() void SdrPreRenderDevice::OutputPreRenderDevice(const Region& rExpandedRegion) { - // expand the ClipRegion if it's a window and we are in paint - if(!(rExpandedRegion.IsEmpty() || rExpandedRegion.IsNull()) - && OUTDEV_WINDOW == mrOutputDevice.GetOutDevType()) - { - ((Window&)mrOutputDevice).ExpandPaintClipRegion(rExpandedRegion); - } - - // calculate the to-be-refreshed rectangle - Rectangle aPaintRect(rExpandedRegion.GetBoundRect()); - Rectangle aPaintRectPixel = mrOutputDevice.LogicToPixel(aPaintRect); + // region to pixels + Region aRegionPixel(mrOutputDevice.LogicToPixel(rExpandedRegion)); + RegionHandle aRegionHandle(aRegionPixel.BeginEnumRects()); + Rectangle aRegionRectanglePixel; - // paint using prepared, pre-rendered VirtualDevice + // MapModes off sal_Bool bMapModeWasEnabledDest(mrOutputDevice.IsMapModeEnabled()); sal_Bool bMapModeWasEnabledSource(maPreRenderDevice.IsMapModeEnabled()); mrOutputDevice.EnableMapMode(sal_False); maPreRenderDevice.EnableMapMode(sal_False); - Size aPaintSizePixel = aPaintRectPixel.GetSize(); - mrOutputDevice.DrawOutDev( - aPaintRectPixel.TopLeft(), aPaintSizePixel, - aPaintRectPixel.TopLeft(), aPaintSizePixel, - maPreRenderDevice); + while(aRegionPixel.GetEnumRects(aRegionHandle, aRegionRectanglePixel)) + { + // for each rectangle, copy the area + const Point aTopLeft(aRegionRectanglePixel.TopLeft()); + const Size aSize(aRegionRectanglePixel.GetSize()); + + mrOutputDevice.DrawOutDev( + aTopLeft, aSize, + aTopLeft, aSize, + maPreRenderDevice); + +#ifdef DBG_UTIL + // #i74769# + static bool bDoPaintForVisualControlRegion(false); + if(bDoPaintForVisualControlRegion) + { + Color aColor((((((rand()&0x7f)|0x80)<<8L)|((rand()&0x7f)|0x80))<<8L)|((rand()&0x7f)|0x80)); + mrOutputDevice.SetLineColor(aColor); + mrOutputDevice.SetFillColor(); + mrOutputDevice.DrawRect(aRegionRectanglePixel); + } +#endif + } + + aRegionPixel.EndEnumRects(aRegionHandle); mrOutputDevice.EnableMapMode(bMapModeWasEnabledDest); maPreRenderDevice.EnableMapMode(bMapModeWasEnabledSource); |