summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-03-10 17:27:25 +0200
committerTor Lillqvist <tml@collabora.com>2014-03-10 17:38:07 +0200
commit440b90c9949631846c1d1c886d2ea029b17d0ffa (patch)
treec74cbbe6ce2e350c575382a555f1cf05e9168f8a
parentbff2ddbbfb8a4cebee2cc223c3bba6a8d9ebc038 (diff)
Avoid "delayed" rendering in the tiled rendering case
Obviously, when using tiled rendering, all of the tile should be rendered at once during the call to lo_touch_draw_tile(). Nothing should be delayed to happen later (when the PaintTimer fires). The main culprit causing such "delayed" rendering, at least in a certain test document, seems to be SmartArt objects. It is not 100% clear how to determine whether tiled rendering is being used, though. For now, let's assume it is always the case on non-desktop (i.e. iOS and Android, even if for Android we dont actually do it). For desktop platforms, including liblibreoffice, will have to figure out later how we want to do it, assume never for now. Change-Id: I0f7e7172e7a699a0c6752ee465776f9da5c3098e
-rw-r--r--unotools/source/config/fltrcfg.cxx17
-rw-r--r--vcl/source/window/window.cxx32
2 files changed, 41 insertions, 8 deletions
diff --git a/unotools/source/config/fltrcfg.cxx b/unotools/source/config/fltrcfg.cxx
index f8e1f843ff33..54e5453b5a80 100644
--- a/unotools/source/config/fltrcfg.cxx
+++ b/unotools/source/config/fltrcfg.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_features.h>
#include <unotools/fltrcfg.hxx>
#include <tools/debug.hxx>
@@ -601,10 +602,24 @@ void SvtFilterOptions::SetImpress2PowerPoint( bool bFlag )
SetModified();
}
-
+static bool lcl_DoTiledRendering()
+{
+#if !HAVE_FEATURE_DESKTOP
+ // We do tiled rendering only for iOS at the moment, actually, but
+ // let's see what happens if we assume it for Android, too.
+ return true;
+#else
+ // We need some way to know globally if this process will use
+ // tiled rendering or not. Or should this be a per-window setting?
+ // Or what?
+ return false;
+#endif
+}
bool SvtFilterOptions::IsSmartArt2Shape() const
{
+ if (lcl_DoTiledRendering())
+ return true;
return pImp->IsFlag( FILTERCFG_SMARTART_SHAPE_LOAD );
}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 20518cad888d..bb2e652283d1 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -731,6 +731,20 @@ void Window::ImplInitWindowData( WindowType nType )
+static bool ImplDoTiledRendering()
+{
+#if !HAVE_FEATURE_DESKTOP
+ // We do tiled rendering only for iOS at the moment, actually, but
+ // let's see what happens if we assume it for Android, too.
+ return true;
+#else
+ // We need some way to know globally if this process will use
+ // tiled rendering or not. Or should this be a per-window setting?
+ // Or what?
+ return false;
+#endif
+}
+
void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData )
{
DBG_ASSERT( mpWindowImpl->mbFrame || pParent, "Window::Window(): pParent == NULL" );
@@ -906,10 +920,13 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
mpWindowImpl->mpFrameData->mbInSysObjFocusHdl = false;
mpWindowImpl->mpFrameData->mbInSysObjToTopHdl = false;
mpWindowImpl->mpFrameData->mbSysObjFocus = false;
- mpWindowImpl->mpFrameData->maPaintTimer.SetTimeout( 30 );
- mpWindowImpl->mpFrameData->maPaintTimer.SetTimeoutHdl( LINK( this, Window, ImplHandlePaintHdl ) );
- mpWindowImpl->mpFrameData->maResizeTimer.SetTimeout( 50 );
- mpWindowImpl->mpFrameData->maResizeTimer.SetTimeoutHdl( LINK( this, Window, ImplHandleResizeTimerHdl ) );
+ if (!ImplDoTiledRendering())
+ {
+ mpWindowImpl->mpFrameData->maPaintTimer.SetTimeout( 30 );
+ mpWindowImpl->mpFrameData->maPaintTimer.SetTimeoutHdl( LINK( this, Window, ImplHandlePaintHdl ) );
+ mpWindowImpl->mpFrameData->maResizeTimer.SetTimeout( 50 );
+ mpWindowImpl->mpFrameData->maResizeTimer.SetTimeoutHdl( LINK( this, Window, ImplHandleResizeTimerHdl ) );
+ }
mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = false;
if ( pRealParent && IsTopWindow() )
@@ -2580,7 +2597,7 @@ void Window::ImplCallOverlapPaint()
void Window::ImplPostPaint()
{
- if ( !mpWindowImpl->mpFrameData->maPaintTimer.IsActive() )
+ if ( !ImplDoTiledRendering() && !mpWindowImpl->mpFrameData->maPaintTimer.IsActive() )
mpWindowImpl->mpFrameData->maPaintTimer.Start();
}
@@ -2589,14 +2606,15 @@ void Window::ImplPostPaint()
IMPL_LINK_NOARG(Window, ImplHandlePaintHdl)
{
// save paint events until layout is done
- if (IsDialog() && static_cast<const Dialog*>(this)->hasPendingLayout())
+ if (!ImplDoTiledRendering() && IsDialog() && static_cast<const Dialog*>(this)->hasPendingLayout())
{
mpWindowImpl->mpFrameData->maPaintTimer.Start();
return 0;
}
// save paint events until resizing is done
- if( mpWindowImpl->mbFrame && mpWindowImpl->mpFrameData->maResizeTimer.IsActive() )
+ if( !ImplDoTiledRendering() &&
+ mpWindowImpl->mbFrame && mpWindowImpl->mpFrameData->maResizeTimer.IsActive() )
mpWindowImpl->mpFrameData->maPaintTimer.Start();
else if ( mpWindowImpl->mbReallyVisible )
ImplCallOverlapPaint();