Remove manual double buffering in QPainter canvas
ClosedPublic

Authored by alvinhochun on Sep 28 2017, 8:15 PM.

Details

Summary

Qt already does double buffering so it is not needed.

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
alvinhochun created this revision.Sep 28 2017, 8:15 PM
Restricted Application added a subscriber: woltherav. · View Herald TranscriptSep 28 2017, 8:15 PM
rempt added a subscriber: rempt.Sep 29 2017, 8:32 AM

Hm, I'm not sure how safe this is.. I think this was introduced in this commit:

commit fc8a3acfbd845a80993ac8af346069dda582ee7c
Author: Lukáš Tvrdý <lukast.dev@gmail.com>
Date: Thu Sep 10 22:18:12 2009 +0000

Use QImage as buffer for QPainter based canvas. Not the whole image is painted, just changed rect. Now tools can use composite modes to paint their overlays.
This is possible fix for tool overlay and will be tested. If you encounter performence problems, let me know.

This can be turned off safely by commenting line 24 in header file.

svn path=/trunk/koffice/; revision=1022148

And I wonder whether this rationale is still relevant?

In D8044#150355, @rempt wrote:

Hm, I'm not sure how safe this is.. I think this was introduced in this commit:

[...]

And I wonder whether this rationale is still relevant?

I would say no, the painting code from below repaints the whole thing from bottom up no matter what, so the buffer isn't doing anything extra for tool overlays.

rempt added a comment.Sep 29 2017, 9:00 AM

Something is weird here, the patch doesn't apply...

In D8044#150371, @rempt wrote:

Something is weird here, the patch doesn't apply...

Yeah... some of the removed lines were changed in D7973 and I made this patch on top of that...

rempt accepted this revision.Sep 29 2017, 9:13 AM

Yes, everything is indeed still fine.

This revision is now accepted and ready to land.Sep 29 2017, 9:13 AM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.