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

Jan Holesovsky kendy at collabora.com
Thu Oct 24 03:06:24 PDT 2013


 sw/qa/tiledrendering/tiledrendering.cxx |   22 +++++++++++++++++++---
 sw/source/core/view/viewsh.cxx          |    9 +++++----
 2 files changed, 24 insertions(+), 7 deletions(-)

New commits:
commit 3642832fdc21ce71bf8fb103b58a0fa7b9f4eba8
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Thu Oct 24 12:04:18 2013 +0200

    Tiled rendering: Very crude way to "show something".
    
    We are reusing the ViewShell's output device; instead we should provide an
    own, and draw to that one - to be continued...
    
    Change-Id: I4ed1bffbbcedeefa955db1d59eb4b252f4a25a64

diff --git a/sw/qa/tiledrendering/tiledrendering.cxx b/sw/qa/tiledrendering/tiledrendering.cxx
index 6f6e6e1..389e997 100644
--- a/sw/qa/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/tiledrendering/tiledrendering.cxx
@@ -125,13 +125,29 @@ IMPL_LINK ( TiledRenderingDialog, RenderHdl, Button *, EMPTYARG )
         // SystemGraphicsData aData;
         // [setup the aData]
         // VirtualDevice aDevice(&aData, [color depth]);
-        VirtualDevice aDevice;
+/*
+        // FIXME don't use pViewShell()->GetOut() directly, we need an own
+        // device here, something like
+#ifdef IOS
+        VirtualDevice aDevice(8);
+#else
+        VirtualDevice aDevice(1);
+#endif
+
+        aDevice.SetReferenceDevice(VirtualDevice::REFDEV_MODE_MSO1);
+        MapMode aMapMode(aDevice.GetMapMode());
+        aMapMode.SetMapUnit(MAP_TWIP);
+        aDevice.SetMapMode(aMapMode);
+
         aDevice.SetOutputSizePixel(Size(contextWidth, contextHeight));
+*/
 
-        pViewShell->PaintTile(&aDevice, Rectangle(tilePosX, tilePosY, tileWidth, tileHeight));
+        pViewShell->PaintTile(pViewShell->GetOut(), Rectangle(tilePosX, tilePosY, tileWidth, tileHeight));
+        // FIXME pViewShell->PaintTile(&aDevice, Rectangle(tilePosX, tilePosY, tileWidth, tileHeight));
 
         // copy the aDevice content to mpImage
-        BitmapEx aBitmap(aDevice.GetBitmapEx(Point(0,0), aDevice.GetOutputSizePixel()));
+        // FIXME BitmapEx aBitmap(pViewShell->GetOut()->GetBitmapEx(Point(0,0), aDevice.PixelToLogic(Size(contextWidth, contextHeight))));
+        BitmapEx aBitmap(pViewShell->GetOut()->GetBitmapEx(Point(0,0), pViewShell->GetOut()->PixelToLogic(Size(contextWidth, contextHeight))));
         mpImage->SetImage(Image(aBitmap));
 
         // update the dialog size
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 4cdb37d..af6b8af 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1756,17 +1756,18 @@ void ViewShell::PaintTile(OutputDevice *pOut, const Rectangle &rRect)
 {
     assert(pOut);
 
-    pOut->SetPixelOffset(Size(-rRect.TopLeft().X(), -rRect.TopLeft().Y()));
+    pOut->SetPixelOffset(Size(rRect.TopLeft().X(), rRect.TopLeft().Y()));
+
     // TODO make the tileWidth/Height fit the width/height of the pOut device
 
     // now we need to setup the ViewShell's output device
     // TODO clean up ViewShell's approach to output devices
-    OutputDevice *pSaveOut = mpOut;
-    mpOut = pOut;
+    OutputDevice *pSaveOut = GetOut();
+    SetOutDev(this, pOut);
 
     Paint(rRect);
 
-    mpOut = pSaveOut;
+    SetOutDev(this, pSaveOut);
 }
 
 #if !HAVE_FEATURE_DESKTOP


More information about the Libreoffice-commits mailing list