Save 5% in KisTextureProperties::apply
ClosedPublic

Authored by poke1024 on Oct 1 2017, 11:34 AM.

Details

Reviewers
rempt
dkazakov
Group Reviewers
Krita
Summary

Currently, in KisTextureProperties::apply the allocation of a KisPaintDevice is quite expensive (it allocates a whole new tile management thingy inside an inner fetch-dab loop).

Without this PR:

With this PR:

Two caveats:

  • I hope that KisPaintDevice::clear() sets the device into a state that is similar to creating it anew; this seems to be the case from trying out the brush in Krita, but it's hard to follow what really happens in the code
  • This assumes that one KisTextureProperties::apply instance is only called from one thread; this seems to be the case (I checked via QThread) and I believe there might be other problems if this assumption is broken?
Test Plan

Draw with a textured brush

Diff Detail

Repository
R37 Krita
Lint
Lint Skipped
Unit
Unit Tests Skipped
poke1024 created this revision.Oct 1 2017, 11:34 AM
rempt accepted this revision as: rempt.Oct 1 2017, 1:48 PM
rempt added a reviewer: dkazakov.
rempt added a subscriber: rempt.

I'm not totally sure whether in Dmitry's branch the dabs are not created in multiple threads, so I've added him as a reviewer. I think it's still safe, though, and it should make a nice improvement indeed.

This revision is now accepted and ready to land.Oct 1 2017, 1:48 PM
rempt closed this revision.Feb 28 2018, 1:52 PM

Meh, this does not apply anymore.