[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - 2 commits - desktop/source include/vcl svx/source vcl/source

Miklos Vajna vmiklos at collabora.co.uk
Thu Feb 19 04:10:03 PST 2015


 desktop/source/lib/init.cxx   |    1 +
 include/vcl/outdev.hxx        |    7 +++++++
 svx/source/svdraw/svdedxv.cxx |    2 +-
 svx/source/svdraw/svdpntv.cxx |    9 +++++++++
 vcl/source/outdev/outdev.cxx  |   11 +++++++++++
 5 files changed, 29 insertions(+), 1 deletion(-)

New commits:
commit 8e52f9e32290c61d7d24d87dca2db6d10b4d3eea
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Feb 19 12:48:27 2015 +0100

    svx: paint TextEdit to the output device in case of tiled rendering
    
    With this, we still miss invalidations when the user types characters
    into a TextEdit, but at least when manually triggering a full redraw we
    gets the typed characters without finishing the editing.
    
    Change-Id: I3ab8991a86c99fe3910ddc5e4f795b802c07c9a9

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index d3dcf97..62f6303 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -308,7 +308,7 @@ void SdrObjEditView::TextEditDrawing(SdrPaintWindow& rPaintWindow) const
                 {
                     OutlinerView* pOLV = pActiveOutliner->GetView(i);
 
-                    if(pOLV->GetWindow() == &rPaintWindow.GetOutputDevice())
+                    if(pOLV->GetWindow() == &rPaintWindow.GetOutputDevice() || rPaintWindow.GetOutputDevice().isTiledRendering())
                     {
                         ImpPaintOutlinerView(*pOLV, aCheckRect, rPaintWindow.GetTargetOutputDevice());
                         return;
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 0643992..a3c294d 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <memory>
 #include <com/sun/star/awt/XWindow.hpp>
 #include <svx/svdpntv.hxx>
 #include <vcl/msgbox.hxx>
@@ -734,6 +735,14 @@ void SdrPaintView::DoCompleteRedraw(SdrPaintWindow& rPaintWindow, const vcl::Reg
 
 void SdrPaintView::EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer)
 {
+    std::unique_ptr<SdrPaintWindow> pPaintWindow;
+    if (rPaintWindow.GetOutputDevice().isTiledRendering() && rPaintWindow.getTemporaryTarget())
+    {
+        // Tiled rendering, we must paint the TextEdit to the output device.
+        pPaintWindow.reset(&rPaintWindow);
+        pPaintWindow->setTemporaryTarget(false);
+    }
+
     if(rPaintWindow.getTemporaryTarget())
     {
         // get rid of temp target again
commit 928a6eaa0cfe160718f6d7dbf762f2097a31b0a1
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Feb 19 12:12:34 2015 +0100

    Add OutputDevice::isTiledRendering()
    
    This is similar to SwViewShell::isTiledRendering, but while SwViewShell
    describes a state of the application, this one describes a state of the
    output device. The output device may be created by LOK client code,
    while the view shell may not be accessible from lower layers of the
    stack, so we need both.
    
    Change-Id: I82f7755eb73603bd79283272fba4970dccae8784

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index bd3a80a..9ceb4d2 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -594,6 +594,7 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
     aDevice.SetOutputSizePixelScaleOffsetAndBuffer(
                 Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(),
                 aBuffer, true );
+    aDevice.setTiledRendering(true);
 
     pDoc->paintTile(aDevice, nCanvasWidth, nCanvasHeight,
                     nTilePosX, nTilePosY, nTileWidth, nTileHeight);
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 6a2aaa2..76b65bd 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -273,6 +273,8 @@ private:
     ImplOutDevData*                 mpOutDevData;
     std::vector< VCLXGraphics* >*   mpUnoGraphicsList;
     vcl::PDFWriterImpl*             mpPDFWriter;
+    /// Set if we are doing the tiled rendering.
+    bool                            mbTiledRendering;
     vcl::ExtOutDevData*             mpExtOutDevData;
 
     // TEMP TEMP TEMP
@@ -474,6 +476,11 @@ public:
     void                        SetExtOutDevData( vcl::ExtOutDevData* pExtOutDevData ) { mpExtOutDevData = pExtOutDevData; }
     vcl::ExtOutDevData*         GetExtOutDevData() const { return mpExtOutDevData; }
 
+    /// Set if we are doing tiled rendering.
+    void setTiledRendering(bool bTiledRendering);
+    /// Are we doing tiled rendering?
+    bool isTiledRendering() const;
+
     ///@}
 
 
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 0305c94..85a222c 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -99,6 +99,7 @@ OutputDevice::OutputDevice() :
     mpOutDevStateStack              = new OutDevStateStack;
     mpPDFWriter                     = NULL;
     mpAlphaVDev                     = NULL;
+    mbTiledRendering                = false;
     mpExtOutDevData                 = NULL;
     mnOutOffX                       = 0;
     mnOutOffY                       = 0;
@@ -397,6 +398,16 @@ bool OutputDevice::SupportsOperation( OutDevSupportType eType ) const
     return bHasSupport;
 }
 
+void OutputDevice::setTiledRendering(bool bTiledRendering)
+{
+    mbTiledRendering = bTiledRendering;
+}
+
+bool OutputDevice::isTiledRendering() const
+{
+    return mbTiledRendering;
+}
+
 // Direct OutputDevice drawing public functions
 
 void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,


More information about the Libreoffice-commits mailing list