Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache tile mode rects #443

Merged
merged 3 commits into from
Jan 28, 2021
Merged

Cache tile mode rects #443

merged 3 commits into from
Jan 28, 2021

Conversation

kleonc
Copy link
Contributor

@kleonc kleonc commented Jan 28, 2021

When drawing in a tile mode get_tile_mode_rect is being called as many times as _set_pixel. This PR make tile mode rects being cached for a little speedup.


Example performance comparison for 128x128 canvas size and single clicks with 100x100 pencil tool:

  • Before:
    9H3pH8lyEc

  • After:
    eAhZrX015f

- typo
- formatting
- moved unlock() call to the method where matching lock() was called
Copy link
Member

@OverloadedOrama OverloadedOrama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@OverloadedOrama OverloadedOrama merged commit 4001a32 into Orama-Interactive:master Jan 28, 2021
@kleonc kleonc deleted the cache_tile_mode_rects branch January 28, 2021 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants