forked from pencil2d/pencil
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the need to allocate an empty QPointF to draw pixmaps
- Loading branch information
Showing
4 changed files
with
17 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f3501ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much overhead are we talking here? And is the pos → posF change for a similar reason?
f3501ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the various paint operations in CanvasPainter, I had 34 ms of overhead to create QPointF objects across a 2 second drawing session. Aside from just painting the pixmaps, this was amongst the slowest operations in my time profiler.
It might seem silly but considering that we'll need it to be as fast as possible to draw a smooth stroke, the optimization seemed reasonable. If you disagree, then i'll remove it again.
Yeah the pos -> posF is the same, although the overhead was smaller, just 11 ms + it would convert it to a QPointF internally for painting every time.
f3501ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, fair enough. Thanks for clarifying!