diff options
author | tsahi glik <tsahi.glik@cloudon.com> | 2013-08-30 13:18:23 -0700 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2013-09-12 12:25:01 +0000 |
commit | 015a0a652f89c05ccef2b23af3d81604b990ba33 (patch) | |
tree | 208d7a0912df28d83713fabe1fed6f02e06e2e4f /vcl/ios/iosinst.cxx | |
parent | a2979511ce81fb848f5696836066a8243ec14209 (diff) |
in iOS avoid copying covered windows to screen
Change-Id: Iebf53e5c2e3909e068739351ccce497ca91b67a5
Reviewed-on: https://gerrit.libreoffice.org/5710
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'vcl/ios/iosinst.cxx')
-rw-r--r-- | vcl/ios/iosinst.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/vcl/ios/iosinst.cxx b/vcl/ios/iosinst.cxx index 8b654a58003a..dd92c6e5af2c 100644 --- a/vcl/ios/iosinst.cxx +++ b/vcl/ios/iosinst.cxx @@ -332,14 +332,16 @@ IMPL_LINK( IosSalInstance, RenderWindows, RenderWindowsArg*, arg ) rc = pthread_mutex_lock( &m_aRenderMutex ); SAL_WARN_IF( rc != 0, "vcl.ios", "pthread_mutex_lock failed: " << strerror( rc ) ); - for( std::list< SalFrame* >::const_iterator it = getFrames().begin(); - it != getFrames().end(); + CGRect invalidRect = arg->rect; + + for( std::list< SalFrame* >::const_reverse_iterator it = getFrames().rbegin(); + it != getFrames().rend(); it++ ) { IosSalFrame *pFrame = static_cast<IosSalFrame *>(*it); SalFrameGeometry aGeom = pFrame->GetGeometry(); CGRect bbox = CGRectMake( aGeom.nX, aGeom.nY, aGeom.nWidth, aGeom.nHeight ); if ( pFrame->IsVisible() && - CGRectIntersectsRect( arg->rect, bbox ) ) { + CGRectIntersectsRect( invalidRect, bbox ) ) { const basebmp::BitmapDeviceSharedPtr aDevice = pFrame->getDevice(); CGDataProviderRef provider = @@ -358,6 +360,12 @@ IMPL_LINK( IosSalInstance, RenderWindows, RenderWindowsArg*, arg ) kCGRenderingIntentDefault ); CGContextDrawImage( arg->context, bbox, image ); + // if current frame covers the whole invalidRect then break + if (CGRectEqualToRect(CGRectIntersection(invalidRect, bbox), invalidRect)) + { + break; + } + pFrame->resetDamaged(); } } |