From 9e0d732959ef01d7f009ea68826daafa04fa4a2b Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 16 Apr 2019 11:50:38 -0300 Subject: [PATCH] Reduce the case where we've to invalidate the whole dstImage --- src/app/tools/tool_loop_manager.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/app/tools/tool_loop_manager.cpp b/src/app/tools/tool_loop_manager.cpp index 3985cc10f..627cabc66 100644 --- a/src/app/tools/tool_loop_manager.cpp +++ b/src/app/tools/tool_loop_manager.cpp @@ -206,8 +206,15 @@ void ToolLoopManager::doLoopStep(bool lastStep) // freehand algorithm needs this trace policy to redraw only the // last dirty area, which can vary in one pixel from the previous // tool loop cycle). - m_toolLoop->invalidateDstImage(); - m_toolLoop->validateDstImage(gfx::Region(m_toolLoop->getDstImage()->bounds())); + if (m_toolLoop->getBrush()->type() != kImageBrushType) { + m_toolLoop->invalidateDstImage(m_dirtyArea); + } + // For custom brush we revalidate the whole destination area so + // the whole trace is redrawn from scratch. + else { + m_toolLoop->invalidateDstImage(); + m_toolLoop->validateDstImage(gfx::Region(m_toolLoop->getDstImage()->bounds())); + } } m_toolLoop->validateDstImage(m_dirtyArea);