diff options
author | Ptyl Dragon <ptyl@cloudon.com> | 2013-10-28 09:24:57 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2013-11-15 16:51:53 +0100 |
commit | 896f76f5e1ef8d74a9bc4ee5810fdced7f359714 (patch) | |
tree | 26f7f62f3f9e93a032e6622aa186f73fe2d9bdb8 /sw | |
parent | 2c4d552eb7230180aabab4a1aa2cf3b283d87163 (diff) |
iOS uses virtual device too
Change-Id: I468b41268f97af444974e05bc38fa5ca975a9d31
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index dd44c929d11b..845ffc501d57 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -1782,13 +1782,16 @@ void touch_lo_draw_tile(void * context, int contextWidth, int contextHeight, int // TODO create a VirtualDevice based on SystemGraphicsData instead so // that we get direct rendering; something like: // - // SystemGraphicsData aData; - // [setup the aData] - // VirtualDevice aDevice(&aData, [color depth]); - //VirtualDevice aDevice; - //aDevice.SetOutputSizePixel(Size(contextWidth, contextHeight)); - pViewShell->PaintTile(pViewShell->GetOut(), Rectangle(tilePosX, tilePosY, tileWidth, tileHeight)); - Bitmap aBitmap(pViewShell->GetOut()->GetBitmap(Point(0,0), pViewShell->GetOut()->PixelToLogic(Size(contextWidth, contextHeight)))); + VirtualDevice aDevice; + MapMode aMapMode(aDevice.GetMapMode()); + aMapMode.SetMapUnit(MAP_TWIP); + aMapMode.SetOrigin(Point(-tilePosX, -tilePosY)); + aDevice.SetMapMode(aMapMode); + aDevice.SetOutputSizePixel(aDevice.PixelToLogic(Size(contextWidth, contextHeight))); + // draw + pViewShell->PaintTile(&aDevice, Rectangle(Point(tilePosX, tilePosY), Size(tileWidth, tileHeight))); + // copy the aDevice content to mpImage + Bitmap aBitmap(aDevice.GetBitmap(aDevice.PixelToLogic(Point(0,0)), aDevice.PixelToLogic(Size(contextWidth, contextHeight)))); BitmapReadAccess * readAccess = aBitmap.AcquireReadAccess(); touch_lo_copy_buffer((void *) readAccess->GetBuffer(), tileWidth, |