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

Tor Lillqvist tml at collabora.com
Mon Nov 4 01:13:26 CET 2013


 ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.m |    4 ++--
 sw/source/core/view/viewsh.cxx                                                      |   10 +++++++---
 2 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit b0ec4330653aaa6ec0cb3425e1b869cad8a69a44
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Nov 4 01:16:24 2013 +0200

    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

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index ac88413..a46291b 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1798,6 +1798,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:
         //
@@ -1805,7 +1808,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
@@ -1815,7 +1817,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();
@@ -1827,7 +1828,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();
commit 30d92c5ddea2df08fe15218684b7215f0ebd2bbd
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Nov 4 01:00:31 2013 +0200

    Keep tile top-left corner fixed, don't center it
    
    Makes it easier to see what happens when the parameters are tweaked.
    
    Change-Id: Ia69c0de74ccf3fcc8a5095a7cc62c6b4185cf9d6

diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.m
index f8fcadb..1b25648 100644
--- a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.m
+++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.m
@@ -31,8 +31,8 @@
 }
 
 +(CGRect)resized:(MLOAppRoleTileTester *)tester{
-    return CGRectMake(  (tester.renderer.view.frame.size.width -tester.params.contextWidth)/2.0f,
-                        (tester.renderer.view.frame.size.height -tester.params.contextHeight)/2.0f,
+    return CGRectMake(  10,
+                        10,
                         tester.params.contextWidth,
                         tester.params.contextHeight);
 }


More information about the Libreoffice-commits mailing list