summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2013-11-15 16:18:42 +0100
committerJan Holesovsky <kendy@collabora.com>2013-11-15 16:52:08 +0100
commitc9705f000086439b444e448d3c0e84b6dab1a522 (patch)
tree530b41b481b22ce0097bb57b2e111460d0c61bb6 /sw
parent8b9246b98aac039b8dbc4fb9e78efdb3bc3e9420 (diff)
Tiled rendering: Make the tiled rendering work together with normal render.
Not an ideal solution, but cleaning up the amount of output devices we have around would take me quite some time, and would be not too safe just before the feature freeze, so let's live with mbTiledRendering flag for now. Change-Id: I93616df18c790d8ce1251194b0c8b09442f5a265
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/viewsh.hxx1
-rw-r--r--sw/source/core/view/viewsh.cxx19
-rw-r--r--sw/source/core/view/vnew.cxx1
3 files changed, 12 insertions, 9 deletions
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index d7e41343e067..57d3b1b37623 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -159,6 +159,7 @@ class SW_DLLPUBLIC SwViewShell : public Ring
// boolean, indicating that class in in constructor.
bool mbInConstructor:1;
+ bool mbTiledRendering:1; ///< Set if we are doing the tiled rendering (using PaintTile()).
SdrPaintWindow* mpTargetPaintWindow;
OutputDevice* mpBufferedOut;
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 049bffaa3dcc..32db8806e137 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -150,7 +150,7 @@ void SwViewShell::DLPrePaint2(const Region& rRegion)
MakeDrawView();
// Prefer window; if tot available, get mpOut (e.g. printer)
- mpPrePostOutDev = (GetWin() ? GetWin() : GetOut());
+ mpPrePostOutDev = (GetWin() && !mbTiledRendering)? GetWin(): GetOut();
// #i74769# use SdrPaintWindow now direct
mpTargetPaintWindow = Imp()->GetDrawView()->BeginDrawLayers(mpPrePostOutDev, rRegion);
@@ -160,9 +160,7 @@ void SwViewShell::DLPrePaint2(const Region& rRegion)
if(mpTargetPaintWindow->GetPreRenderDevice())
{
mpBufferedOut = mpOut;
-#ifndef IOS
mpOut = &(mpTargetPaintWindow->GetTargetOutputDevice());
-#endif
}
// remember original paint MapMode for wrapped FlyFrame paints
@@ -192,13 +190,11 @@ void SwViewShell::DLPostPaint2(bool bPaintFormLayer)
mPrePostPaintRegions.pop(); // clear
if(0 != mpTargetPaintWindow)
{
-#ifndef IOS
// #i74769# restore buffered OutDev
if(mpTargetPaintWindow->GetPreRenderDevice())
{
mpOut = mpBufferedOut;
}
-#endif
// #i74769# use SdrPaintWindow now direct
Imp()->GetDrawView()->EndDrawLayers(*mpTargetPaintWindow, bPaintFormLayer);
@@ -1760,13 +1756,18 @@ void SwViewShell::PaintTile(OutputDevice *pOut, const Rectangle &rRect)
assert(pOut);
// now we need to setup the SwViewShell's output device
- // TODO clean up SwViewShell's approach to output devices
- OutputDevice *pSaveOut = GetOut();
- SetOutDev(this, pOut);
+ // TODO clean up SwViewShell's approach to output devices (the many of
+ // them - mpBufferedOut, mpOut, mpWin, ..., and get rid of
+ // mbTiledRendering)
+ OutputDevice *pSaveOut = mpOut;
+
+ mbTiledRendering = true;
+ mpOut = pOut;
Paint(rRect);
- SetOutDev(this, pSaveOut);
+ mpOut = pSaveOut;
+ mbTiledRendering = false;
}
#if !HAVE_FEATURE_DESKTOP
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 01e909ddfaba..1efee42be630 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -232,6 +232,7 @@ SwViewShell::SwViewShell( SwViewShell& rShell, Window *pWindow,
mbShowHeaderSeparator( false ),
mbShowFooterSeparator( false ),
mbHeaderFooterEdit( false ),
+ mbTiledRendering(false),
mpTargetPaintWindow(0), // #i74769#
mpBufferedOut(0), // #i74769#
mpDoc( rShell.GetDoc() ),