[Libreoffice-commits] core.git: Branch 'feature/tiledrendering' - sw/source

Ptyl Dragon ptyl at cloudon.com
Mon Oct 28 00:25:37 PDT 2013


 sw/source/core/view/viewsh.cxx |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

New commits:
commit f13e30c4fbb669f2885c99a676c5905f1356891e
Author: Ptyl Dragon <ptyl at cloudon.com>
Date:   Mon Oct 28 09:24:57 2013 +0200

    iOS uses virtual device too
    
    Change-Id: I468b41268f97af444974e05bc38fa5ca975a9d31

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index cf313f5..e2a8bd6 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1784,13 +1784,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,


More information about the Libreoffice-commits mailing list