[Libreoffice-commits] core.git: 5 commits - libreofficekit/qa sw/inc sw/source

Andrzej Hunt andrzej.hunt at collabora.com
Sat Jul 26 06:45:25 PDT 2014


 libreofficekit/qa/unit/tiledrendering.cxx |    4 ++--
 sw/inc/viewsh.hxx                         |    1 -
 sw/source/core/draw/dflyobj.cxx           |    4 +---
 sw/source/core/view/viewsh.cxx            |    7 +++++--
 4 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit e5dd2e8826433566e223d0572ed73f21d0b992f1
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Thu Jul 24 21:38:12 2014 +0200

    We're using the same rectangle for both calls, let's reuse it.
    
    Change-Id: I884832fc92e0fe9c10711d9fdaf103076a05f721

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index daf5304..e545651 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1785,6 +1785,9 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex
         Imp()->GetDrawView()->AddWindowToPaintView(&rDevice);
     }
 
+    Rectangle aOutRect = Rectangle(Point(tilePosX, tilePosY),
+                                   rDevice.PixelToLogic(Size(contextWidth, contextHeight)));
+
     // Make the requested area visible -- we can't use MakeVisible as that will
     // only scroll the contents, but won't zoom/resize if needed.
     // Without this, items/text that are outside the visible area (in the SwView)
@@ -1792,10 +1795,10 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex
     // tiledrendering app, or the gtktiledviewer) -- although ultimately we
     // probably want to fix things so that the SwView's area doesn't affect
     // tiled rendering?
-    VisPortChgd(SwRect(Point(tilePosX, tilePosY), rDevice.PixelToLogic(Size(contextWidth, contextHeight))));
+    VisPortChgd(SwRect(aOutRect));
 
     // draw - works in logic coordinates
-    Paint(Rectangle(Point(tilePosX, tilePosY), rDevice.PixelToLogic(Size(contextWidth, contextHeight))));
+    Paint(aOutRect);
 
     // Remove this device in DrawLayer
     if (Imp()->GetDrawView())
commit bfad9f5b7bbcb93af46cae535120795ead1f4f0a
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Thu Jul 24 21:27:43 2014 +0200

    libreofficekit_tilederendering: test all 4 tiles.
    
    The use of VisPortChgd ensures that the tiles all render as
    expected, i.e. that the pixels match 1:1 irrespective of actual tile
    size (for identical zoom factors and document areas).
    
    Change-Id: Ib1e1df4f8257546c2f7993a8160c309a52037d8b

diff --git a/libreofficekit/qa/unit/tiledrendering.cxx b/libreofficekit/qa/unit/tiledrendering.cxx
index cec35ed..b231eb0 100644
--- a/libreofficekit/qa/unit/tiledrendering.cxx
+++ b/libreofficekit/qa/unit/tiledrendering.cxx
@@ -134,9 +134,9 @@ void TiledRenderingTest::testOverlay()
         // Iterate over our array of tiles
         // However for now we only bother with the top-left
         // tile as the other ones don't match yet...
-        for ( int x = 0; x < 1; x++ )
+        for ( int x = 0; x < 2; x++ )
         {
-            for ( int y = 0; y < 1; y++ )
+            for ( int y = 0; y < 2; y++ )
             {
                 int xLarge = (x * (4 * nTotalWidthPix / 2)) + xSmall;
                 int yLarge = (y * (nTotalHeightPix / 2)) + ySmall;
commit 94c720830c0f95bd9776ea3f21623bb949b9bbfe
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Thu Jul 24 21:15:49 2014 +0200

    Tiled Rendering: ensure rendered area is visible correctly.
    
    Using SetVisArea can cause problems due to various internal
    state getting confused, however this gives correct output
    without viewport assertion problems or missing content.
    
    Change-Id: I8d206ab201167ea96a0ac853187861e8c3d541e5

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 6ffdbbf..daf5304 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1785,8 +1785,14 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex
         Imp()->GetDrawView()->AddWindowToPaintView(&rDevice);
     }
 
-    // scroll the requested area into view if necessary
-    MakeVisible(SwRect(Point(tilePosX, tilePosY), rDevice.PixelToLogic(Size(contextWidth, contextHeight))));
+    // Make the requested area visible -- we can't use MakeVisible as that will
+    // only scroll the contents, but won't zoom/resize if needed.
+    // Without this, items/text that are outside the visible area (in the SwView)
+    // won't be painted when rendering tiles (at least when using either the
+    // tiledrendering app, or the gtktiledviewer) -- although ultimately we
+    // probably want to fix things so that the SwView's area doesn't affect
+    // tiled rendering?
+    VisPortChgd(SwRect(Point(tilePosX, tilePosY), rDevice.PixelToLogic(Size(contextWidth, contextHeight))));
 
     // draw - works in logic coordinates
     Paint(Rectangle(Point(tilePosX, tilePosY), rDevice.PixelToLogic(Size(contextWidth, contextHeight))));
commit 7bf98caddda048db0f39048af178621294aa0665
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Thu Jul 24 14:34:49 2014 +0200

    Revert "Tiled Rendering: ensure rendered area is visible."
    
    This reverts commit ff6a38b76df80d0f907f2f92cb851dea43c91d81.

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 6571a5f..6ffdbbf 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1785,14 +1785,8 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex
         Imp()->GetDrawView()->AddWindowToPaintView(&rDevice);
     }
 
-    // Make the requested area visible -- we can't use MakeVisible as that will
-    // only scroll the contents, but won't zoom/resize if needed.
-    // Without this, items/text that are outside the visible area (in the SwView)
-    // won't be painted when rendering tiles (at least when using either the
-    // tiledrendering app, or the gtktiledviewer) -- although ultimately we
-    // probably want to fix things so that the SwView's area doesn't affect
-    // tiled rendering?
-    mpDoc->GetDocShell()->SetVisArea(Rectangle(Point(tilePosX, tilePosY), rDevice.PixelToLogic(Size(contextWidth, contextHeight))));
+    // scroll the requested area into view if necessary
+    MakeVisible(SwRect(Point(tilePosX, tilePosY), rDevice.PixelToLogic(Size(contextWidth, contextHeight))));
 
     // draw - works in logic coordinates
     Paint(Rectangle(Point(tilePosX, tilePosY), rDevice.PixelToLogic(Size(contextWidth, contextHeight))));
commit 2d4037529bb5b831907eabb85650126349595cc9
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Wed Jul 23 08:06:05 2014 +0200

    Revert "CppunitTest_tiledrendering: disable SwVirtFlyDrawObj assert for now"
    
    This is a real problem, which is fixed in a following commit -- tiled
    rendering does not currently set the viewport at all, which can result
    in an empty (or otherwise incorrect viewport), so this assert is definitely
    valid.
    
    This reverts commit fb0b42b89af95b42cc6caadf8c22321e5c9386e8.

diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index b40a648..f839b35 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -571,7 +571,6 @@ public:
     bool IsShowHeaderFooterSeparator( FrameControlType eControl ) { return (eControl == Header)? mbShowHeaderSeparator: mbShowFooterSeparator; }
     virtual void SetShowHeaderFooterSeparator( FrameControlType eControl, bool bShow ) { if ( eControl == Header ) mbShowHeaderSeparator = bShow; else mbShowFooterSeparator = bShow; }
     bool IsSelectAll() { return mbSelectAll; }
-    bool IsTiledRendering() { return mbTiledRendering; }
 };
 
 // manages global ShellPointer
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index c8177a9..bc043ed 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -469,9 +469,7 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject(
             // if there's no viewport set, all fly-frames will be painted,
             // which is slow, wastes memory, and can cause other trouble.
             (void) rViewInformation; // suppress "unused parameter" warning
-            if (!pShell->IsTiledRendering())
-                // FIXME is it OK to have no viewport during tiled rendering?
-                assert(!rViewInformation.getViewport().isEmpty());
+            assert(!rViewInformation.getViewport().isEmpty());
             if ( !pFlyFrm->IsFlyInCntFrm() )
             {
                 // it is also necessary to restore the VCL MapMode from ViewInformation since e.g.


More information about the Libreoffice-commits mailing list