tdf#157312 and tdf#163945 Lower Skia flush timer priority on macOS
On macOS, flushing with Skia/Metal is noticeably slower than with Skia/Raster. So lower the flush timer priority to TaskPriority::POST_PAINT so that the flush timer runs less frequently but each pass copies a more up-to-date offscreen surface. Unfortunately, lowering the priority causes tdf#163734 to reoccur. When a dockable window is dragged by its titlebar, a rectangle may be drawn in its parent window. However, the Skia flush timer doesn't run until after the mouse button has been released (probably due to lowering of the Skia flush timer's priority to fix tdf#163734). So run the parent frame's Skia flush timer immediately to display the rectangle. Change-Id: I289eab85a087cb76a751dc6b777342b8dee49e1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177190 Reviewed-by: Patrick Luby <guibomacdev@gmail.com> Tested-by: Jenkins
This commit is contained in:
parent
ec775c8ada
commit
16b629cf08
2 changed files with 31 additions and 10 deletions
|
@ -440,6 +440,25 @@ static bool isMouseScrollWheelEvent( NSEvent *pEvent )
|
|||
{
|
||||
mpFrame->UpdateFrameGeometry();
|
||||
mpFrame->CallCallback( SalEvent::Move, nullptr );
|
||||
|
||||
#if HAVE_FEATURE_SKIA
|
||||
// tdf#163734 Flush parent frame when Skia is enabled
|
||||
// When a dockable window is dragged by its titlebar, a rectangle
|
||||
// may be drawn in its parent window. However, the Skia flush
|
||||
// timer doesn't run until after the mouse button has been
|
||||
// released (probably due to lowering of the Skia flush timer's
|
||||
// priority to fix tdf#163734). So run the parent frame's Skia
|
||||
// flush timer immediately to display the rectangle.
|
||||
if ( SkiaHelper::isVCLSkiaEnabled() &&
|
||||
mpFrame->mbShown && mpFrame->mpParent &&
|
||||
AquaSalFrame::isAlive( mpFrame->mpParent ) &&
|
||||
mpFrame->mpParent->mbShown )
|
||||
{
|
||||
AquaSalGraphics* pGraphics = mpFrame->mpParent->mpGraphics;
|
||||
if ( pGraphics )
|
||||
pGraphics->Flush();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -269,16 +269,18 @@ public:
|
|||
{
|
||||
mpGraphics->performFlush();
|
||||
Stop();
|
||||
// tdf#163945 Lower priority of Skia flush timer
|
||||
// Commit f4c2c7c79cfe4464ac596afda37b8904d06969db fixed tdf#157312
|
||||
// by lowering the timer priority to TaskPriority::POST_PAINT. But
|
||||
// it caused tdf#163734 so it was reverted to TaskPriority::HIGHEST
|
||||
// in commit 5a38e4f9798c5ff247aa57581adf2671485627fd.
|
||||
// While reverting to TaskPriority::HIGHEST did not cause tdf#157312
|
||||
// to reoccur, it did cause tdf#163945 so set the timer priority to
|
||||
// TaskPriority::HIGH_IDLE. This priority appears to be low enough to
|
||||
// fix tdf#16394 without causing tdf#163734 to reoccur.
|
||||
SetPriority(TaskPriority::HIGH_IDLE);
|
||||
#ifdef MACOSX
|
||||
// tdf#157312 and tdf#163945 Lower Skia flush timer priority on macOS
|
||||
// On macOS, flushing with Skia/Metal is noticeably slower than
|
||||
// with Skia/Raster. So lower the flush timer priority to
|
||||
// TaskPriority::POST_PAINT so that the flush timer runs less
|
||||
// frequently but each pass copies a more up-to-date offscreen
|
||||
// surface.
|
||||
// TODO: fix tdf#163734 on macOS
|
||||
SetPriority(TaskPriority::POST_PAINT);
|
||||
#else
|
||||
SetPriority(TaskPriority::HIGHEST);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue