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

Miklos Vajna vmiklos at collabora.co.uk
Thu Feb 19 09:38:30 PST 2015


 desktop/source/lib/init.cxx         |    1 -
 editeng/source/editeng/editview.cxx |   10 ++++++++++
 editeng/source/editeng/impedit.cxx  |   11 +++++++++++
 editeng/source/editeng/impedit.hxx  |    4 ++++
 editeng/source/editeng/impedit3.cxx |    3 ++-
 editeng/source/outliner/outlvw.cxx  |    4 ++++
 include/editeng/editview.hxx        |    3 +++
 include/editeng/outliner.hxx        |    3 +++
 include/svx/svdmodel.hxx            |    6 ++++++
 include/vcl/outdev.hxx              |    7 -------
 sd/source/ui/unoidl/unomodel.cxx    |    1 +
 svx/source/svdraw/svdedxv.cxx       |    3 ++-
 svx/source/svdraw/svdmodel.cxx      |   11 +++++++++++
 svx/source/svdraw/svdpntv.cxx       |    2 +-
 vcl/source/outdev/outdev.cxx        |   11 -----------
 15 files changed, 58 insertions(+), 22 deletions(-)

New commits:
commit 3259b2d73f071acd0c487df9799a3ab76357c08c
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Feb 19 18:36:17 2015 +0100

    Use SdrModel::isTiledRendering()
    
    It turns out that in case the is-tiled-rendering flag is part of the sdr
    model, then that's enough for all the places where so far used a flag on
    the output device for this purpose, so change the two users of that
    method to use SdrModel::isTiledRendering(), and clean up the now unused
    one.
    
    Change-Id: Ife6d3d7e093c04b707497d9588942b38bcd8742d

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 9ceb4d2..bd3a80a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -594,7 +594,6 @@ 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 76b65bd..6a2aaa2 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -273,8 +273,6 @@ 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
@@ -476,11 +474,6 @@ 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/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 6675d16..5ccf6db 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() || rPaintWindow.GetOutputDevice().isTiledRendering())
+                    if(pOLV->GetWindow() == &rPaintWindow.GetOutputDevice() || GetModel()->isTiledRendering())
                     {
                         ImpPaintOutlinerView(*pOLV, aCheckRect, rPaintWindow.GetTargetOutputDevice());
                         return;
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index a3c294d..346f74c 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -736,7 +736,7 @@ 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())
+    if (GetModel()->isTiledRendering() && rPaintWindow.getTemporaryTarget())
     {
         // Tiled rendering, we must paint the TextEdit to the output device.
         pPaintWindow.reset(&rPaintWindow);
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 85a222c..0305c94 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -99,7 +99,6 @@ OutputDevice::OutputDevice() :
     mpOutDevStateStack              = new OutDevStateStack;
     mpPDFWriter                     = NULL;
     mpAlphaVDev                     = NULL;
-    mbTiledRendering                = false;
     mpExtOutDevData                 = NULL;
     mnOutOffX                       = 0;
     mnOutOffY                       = 0;
@@ -398,16 +397,6 @@ 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,
commit 0b74889adcf98dee1524b29183de059d22017f32
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Feb 19 14:38:53 2015 +0100

    ImpEditEngine::UpdateViews: need to go via Invalidate() for tiled rendering
    
    This makes typed characters appear as you type it (and not only after
    the editing of the shape text is finished) in Impress.
    
    Change-Id: Id47efe8223ddfdbad36f436366c9c8c8e0cb45f4

diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index cc3db19..cfd4fc5 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -572,6 +572,16 @@ Color EditView::GetBackgroundColor() const
     return pImpEditView->GetBackgroundColor();
 }
 
+void EditView::setTiledRendering(bool bTiledRendering)
+{
+    pImpEditView->setTiledRendering(bTiledRendering);
+}
+
+bool EditView::isTiledRendering()
+{
+    return pImpEditView->isTiledRendering();
+}
+
 void EditView::SetControlWord( sal_uInt32 nWord )
 {
     pImpEditView->nControl = nWord;
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 4ec83bb..ed543cb 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -75,6 +75,7 @@ ImpEditView::ImpEditView( EditView* pView, EditEngine* pEng, vcl::Window* pWindo
     pOutWin             = pWindow;
     pPointer            = NULL;
     pBackgroundColor    = NULL;
+    mbTiledRendering    = false;
     nScrollDiffX        = 0;
     nExtraCursorFlags   = 0;
     nCursorBidiLevel    = CURSOR_BIDILEVEL_DONTKNOW;
@@ -112,6 +113,16 @@ void ImpEditView::SetBackgroundColor( const Color& rColor )
     pBackgroundColor = new Color( rColor );
 }
 
+void ImpEditView::setTiledRendering(bool bTiledRendering)
+{
+    mbTiledRendering = bTiledRendering;
+}
+
+bool ImpEditView::isTiledRendering() const
+{
+    return mbTiledRendering;
+}
+
 void ImpEditView::SetEditSelection( const EditSelection& rEditSelection )
 {
     // set state before notification
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 78128ab..0bcaa38 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -215,6 +215,7 @@ private:
     EditView*           pEditView;
     vcl::Cursor*        pCursor;
     Color*              pBackgroundColor;
+    bool                mbTiledRendering;
     EditEngine*         pEditEngine;
     vcl::Window*             pOutWin;
     Pointer*            pPointer;
@@ -363,6 +364,9 @@ public:
     const Color&    GetBackgroundColor() const {
                         return ( pBackgroundColor ? *pBackgroundColor : pOutWin->GetBackground().GetColor() ); }
 
+    void            setTiledRendering(bool bTiledRendering);
+    bool            isTiledRendering() const;
+
     bool        IsWrongSpelledWord( const EditPaM& rPaM, bool bMarkIfWrong );
     OUString        SpellIgnoreOrAddWord( bool bAdd );
 
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index d98efb5..6c3dd12 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -290,7 +290,8 @@ void ImpEditEngine::UpdateViews( EditView* pCurView )
             // convert to window coordinates ....
             aClipRect = pView->pImpEditView->GetWindowPos( aClipRect );
 
-            if ( pView == pCurView )
+            // For tiled rendering, we have to always go via Invalidate().
+            if ( pView == pCurView && !pView->isTiledRendering())
                 Paint( pView->pImpEditView, aClipRect, 0, true );
             else
                 pView->GetWindow()->Invalidate( aClipRect );
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index 652fcaa..e545e9f 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -1420,6 +1420,10 @@ void OutlinerView::SetBackgroundColor( const Color& rColor )
     pEditView->SetBackgroundColor( rColor );
 }
 
+void OutlinerView::setTiledRendering(bool bTiledRendering)
+{
+    pEditView->setTiledRendering(bTiledRendering);
+}
 
 Color OutlinerView::GetBackgroundColor()
 {
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index 3f7c637..439f63b 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -169,6 +169,9 @@ public:
     void            SetBackgroundColor( const Color& rColor );
     Color           GetBackgroundColor() const;
 
+    void            setTiledRendering(bool bTiledRendering);
+    bool            isTiledRendering();
+
     void            SetControlWord( sal_uInt32 nWord );
     sal_uInt32      GetControlWord() const;
 
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 075fdeb..d63d884 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -257,6 +257,9 @@ public:
     void        SetBackgroundColor( const Color& rColor );
     Color       GetBackgroundColor();
 
+    /// Set if we are doing tiled rendering.
+    void        setTiledRendering(bool bTiledRendering);
+
     SfxItemSet  GetAttribs();
 
     void        Cut();
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index ddcd369..cdad8a1 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -171,6 +171,8 @@ protected:
     SdrOutliner*    pHitTestOutliner;// an Outliner for the HitTest
     sal_uIntPtr           nDefTextHgt;    // Default text heigth in logical units
     OutputDevice*   pRefOutDev;     // ReferenceDevice for the EditEngine
+    /// Set if we are doing tiled rendering.
+    bool mbTiledRendering;
     sal_uIntPtr           nProgressAkt;   // for the
     sal_uIntPtr           nProgressMax;   // ProgressBar-
     sal_uIntPtr           nProgressOfs;   // -Handler
@@ -334,6 +336,10 @@ public:
     // ReferenceDevice for the EditEngine
     void                 SetRefDevice(OutputDevice* pDev);
     OutputDevice*        GetRefDevice() const                   { return pRefOutDev; }
+    /// Set if we are doing tiled rendering.
+    void setTiledRendering(bool bTiledRendering);
+    /// Are we doing tiled rendering?
+    bool isTiledRendering() const;
     // If a new MapMode is set on the RefDevice (or similar)
     void                 RefDeviceChanged(); // not yet implemented
     // default font heigth in logical units
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 76717a5..e939d3b 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2352,6 +2352,7 @@ void SdXImpressDocument::initializeForTiledRendering()
     SolarMutexGuard aGuard;
     // tiled rendering works only when we are in the 'Normal' view, switch to that
     mpDocShell->GetViewShell()->GetViewFrame()->GetDispatcher()->Execute(SID_VIEWSHELL0, SfxCallMode::SYNCHRON | SfxCallMode::RECORD);
+    mpDoc->setTiledRendering(true);
 }
 
 void SdXImpressDocument::registerCallback(LibreOfficeKitCallback pCallback, void* pData)
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 62f6303..6675d16 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -446,6 +446,7 @@ OutlinerView* SdrObjEditView::ImpMakeOutlinerView(vcl::Window* pWin, bool /*bNoP
     }
     pOutlView->SetControlWord(nStat);
     pOutlView->SetBackgroundColor( aBackground );
+    pOutlView->setTiledRendering(GetModel()->isTiledRendering());
     if (pText!=NULL)
     {
         pOutlView->SetAnchorMode((EVAnchorMode)(pText->GetOutlinerViewAnchorMode()));
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 64a5304..c444fa5 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -124,6 +124,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe
     pDrawOutliner=NULL;
     pHitTestOutliner=NULL;
     pRefOutDev=NULL;
+    mbTiledRendering = false;
     nProgressAkt=0;
     nProgressMax=0;
     nProgressOfs=0;
@@ -795,6 +796,16 @@ void SdrModel::SetRefDevice(OutputDevice* pDev)
     RefDeviceChanged();
 }
 
+void SdrModel::setTiledRendering(bool bTiledRendering)
+{
+    mbTiledRendering = bTiledRendering;
+}
+
+bool SdrModel::isTiledRendering() const
+{
+    return mbTiledRendering;
+}
+
 void SdrModel::ImpReformatAllTextObjects()
 {
     if( isLocked() )


More information about the Libreoffice-commits mailing list