Diffusion Krita 2fea6a9b28f5

Implement KisRegion with optimized rects compression

Authored by dkazakov on Jan 31 2020, 1:29 PM.

Description

Implement KisRegion with optimized rects compression

The patch fixes two bugs:

  1. Freezes when zooming with Intant Preview enabled. The freezes happened due to a very long QRegion calculation in KisSyncLodCacheStrokeStrategy::createJobsData(). Now KisRegion does the calculation 50 times fister.
  1. Short 200ms delay in the end of every stroke in KisIndirectPaintingSupport::writeMergeData().

What is KisRegion?

The main difference between KisRegion and QRegion is that KisRegion,
once created, doesn't allow adding/removing rectangles. It lets us
use optimized algorithm for merging rectanges, which is 50-100 times
faster than iterational algorithm used in QRegion.

When to use KisRegion?

By default, use KisRegion. If you need any boolean operation
not supported by KisRegion, then use QRegion. KisRegion can be
converted to/from QRegion via toQRegion() and fromQRegion() calls.

NOTE: these conversion were intentionally made explicit, *not* implicit, because accidental use of QRegion may affect performance significantly.

CCBUG:414576

Details

Committed
dkazakovJan 31 2020, 2:06 PM
Parents
R37:0ca332c7089c: Fix hiccups when doing canvas actions
Branches
Unknown
Tags
Unknown