Kaydet (Commit) 015a0a65 authored tarafından tsahi glik's avatar tsahi glik Kaydeden (comit) Tor Lillqvist

in iOS avoid copying covered windows to screen

Change-Id: Iebf53e5c2e3909e068739351ccce497ca91b67a5
Reviewed-on: https://gerrit.libreoffice.org/5710Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
Tested-by: 's avatarTor Lillqvist <tml@collabora.com>
üst a2979511
...@@ -332,14 +332,16 @@ IMPL_LINK( IosSalInstance, RenderWindows, RenderWindowsArg*, arg ) ...@@ -332,14 +332,16 @@ IMPL_LINK( IosSalInstance, RenderWindows, RenderWindowsArg*, arg )
rc = pthread_mutex_lock( &m_aRenderMutex ); rc = pthread_mutex_lock( &m_aRenderMutex );
SAL_WARN_IF( rc != 0, "vcl.ios", "pthread_mutex_lock failed: " << strerror( rc ) ); SAL_WARN_IF( rc != 0, "vcl.ios", "pthread_mutex_lock failed: " << strerror( rc ) );
for( std::list< SalFrame* >::const_iterator it = getFrames().begin(); CGRect invalidRect = arg->rect;
it != getFrames().end();
for( std::list< SalFrame* >::const_reverse_iterator it = getFrames().rbegin();
it != getFrames().rend();
it++ ) { it++ ) {
IosSalFrame *pFrame = static_cast<IosSalFrame *>(*it); IosSalFrame *pFrame = static_cast<IosSalFrame *>(*it);
SalFrameGeometry aGeom = pFrame->GetGeometry(); SalFrameGeometry aGeom = pFrame->GetGeometry();
CGRect bbox = CGRectMake( aGeom.nX, aGeom.nY, aGeom.nWidth, aGeom.nHeight ); CGRect bbox = CGRectMake( aGeom.nX, aGeom.nY, aGeom.nWidth, aGeom.nHeight );
if ( pFrame->IsVisible() && if ( pFrame->IsVisible() &&
CGRectIntersectsRect( arg->rect, bbox ) ) { CGRectIntersectsRect( invalidRect, bbox ) ) {
const basebmp::BitmapDeviceSharedPtr aDevice = pFrame->getDevice(); const basebmp::BitmapDeviceSharedPtr aDevice = pFrame->getDevice();
CGDataProviderRef provider = CGDataProviderRef provider =
...@@ -358,6 +360,12 @@ IMPL_LINK( IosSalInstance, RenderWindows, RenderWindowsArg*, arg ) ...@@ -358,6 +360,12 @@ IMPL_LINK( IosSalInstance, RenderWindows, RenderWindowsArg*, arg )
kCGRenderingIntentDefault ); kCGRenderingIntentDefault );
CGContextDrawImage( arg->context, bbox, image ); CGContextDrawImage( arg->context, bbox, image );
// if current frame covers the whole invalidRect then break
if (CGRectEqualToRect(CGRectIntersection(invalidRect, bbox), invalidRect))
{
break;
}
pFrame->resetDamaged(); pFrame->resetDamaged();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment