summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2013-11-04 01:16:24 +0200
committerJan Holesovsky <kendy@collabora.com>2013-11-15 16:52:05 +0100
commit294c3e7c20d8cc4381cf36c0769cb447217426d6 (patch)
treeff5b8207f2dbc667aa40c921e50c9690c77d9e83 /sw/source
parent19fb3b39984ebe1665e42cc14bd1b0f5c3659c03 (diff)
Make the use of tileWidth/Height in the call to PaintTile() optional
It seems to work better to use contextWidth/Height here, too, converted to logical units. The code apparently will never render more than what has been passed earlier to SetOutputSizePixel() anyway. Or something. Change-Id: I69ff4f3c9a61391882e5d530140903786bb4a16b
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/view/viewsh.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 7cb914fd0fc8..c9f961691830 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1796,6 +1796,9 @@ void touch_lo_draw_tile(void *context, int contextWidth, int contextHeight, MLOD
Application::AcquireSolarMutex(1);
if (pViewShell)
{
+ static bool bUseTileSize = getenv("USETILESIZE") != NULL;
+ static bool bCallSetScale = bUseTileSize && (getenv("CALLSETSCALE") != NULL);
+ static bool bCallSetSwVisArea = bUseTileSize && getenv("CALLSETSWVISAREA") != NULL;
// TODO create a VirtualDevice based on SystemGraphicsData instead so
// that we get direct rendering; something like:
//
@@ -1803,7 +1806,6 @@ void touch_lo_draw_tile(void *context, int contextWidth, int contextHeight, MLOD
MapMode aMapMode(aDevice.GetMapMode());
aMapMode.SetMapUnit(MAP_TWIP);
aMapMode.SetOrigin(Point(-tilePosX, -tilePosY));
- static bool bCallSetScale = getenv("CALLSETSCALE") != NULL;
if (bCallSetScale)
{
// scaling
@@ -1813,7 +1815,6 @@ void touch_lo_draw_tile(void *context, int contextWidth, int contextHeight, MLOD
aMapMode.SetScaleY(scaleY);
}
aDevice.SetMapMode(aMapMode);
- static bool bCallSetSwVisArea = getenv("CALLSETSWVISAREA") != NULL;
if (bCallSetSwVisArea)
{
SwRect foo = pViewShell->VisArea();
@@ -1825,7 +1826,10 @@ void touch_lo_draw_tile(void *context, int contextWidth, int contextHeight, MLOD
// resizes the virtual device so to contain the entrie context
aDevice.SetOutputSizePixel(Size(contextWidth, contextHeight));
// draw - works in logic coordinates
- pViewShell->PaintTile(&aDevice, Rectangle(Point(tilePosX, tilePosY), Size(tileWidth, tileHeight)));
+ if (bUseTileSize)
+ pViewShell->PaintTile(&aDevice, Rectangle(Point(tilePosX, tilePosY), Size(tileWidth, tileHeight)));
+ else
+ pViewShell->PaintTile(&aDevice, Rectangle(Point(tilePosX, tilePosY), aDevice.PixelToLogic(Size(contextWidth, contextHeight))));
// copy the aDevice content to mpImage
Bitmap aBitmap(aDevice.GetBitmap(aDevice.PixelToLogic(Point(0,0)), aDevice.PixelToLogic(Size(contextWidth, contextHeight))));
BitmapReadAccess * readAccess = aBitmap.AcquireReadAccess();