-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve CameraPainter and BackgroundWidget performance (#1789)
* Canvaspainter improvement WIP * Implement tiled buffer for faster painting WIP * CanvasPainter painting improvements - Split painting for current frame and onion skinning - Introduce blitRect for updating only the dirty portion of the frame - Optimization: Only do an expensive fill when the size changes, otherwise rely on the blitRect to clear the dirty portion. * Only update the dirty potion Aside from cleaning up various extra update methods that are no longer necessary, I've made a minor change in vectorImage, in order to get it's correct dirty region. * Fix vector selection being slightly wider than the overall bounds This was a necessary change in order to calculate the correct bounds that wouldn't draw artifacts. * Fix stroke placement for vector polyline This also fixes some inconsistency in the CanvasPainter that I couldn't make sense of.. * Implement faster hashing * Do some cleanup * Fix next onion skin being drawn on current frame when it's the last * Re-add loadFile if the bitmap image hasn't been loaded yet Although i don't like that this exists in our painter, I believe we added it because for some reason the image hasn't been loaded yet, so let's leave it for now... ideally though i've really like to get rid of such weird mutable things that has little to do with painting. * Update CanvasPainter interface to better match its usage * Cleanup TiledBuffer * Make polyline work * Fix blur logic of smudge tool Additionally this will fix some artifacts when smudging * Replace use of BitmapImage buffer with TiledBuffer - Note that VectorImage hasn't been implemented yet. * Make TiledBuffer work for VectorImage * Cleanup dead code in TiledBuffer * Fix not painting bitmap layers when not on current frame * Add missing license * Remove dead code * Implement blitting in CameraPainter * Fix drawImage would not get proper update bounds * Cleanup TiledBuffer and fix warnings * Fix Eraser should use destinationOut composition * Fix anti aliasing was causing unwanted floating precision error This was causing the gaps to be drawn between the tiled buffer tiles in some cases... particularly when erasing and you had zoomed in or out. * Fix Polyline can't be removed after applying on vector * Fix transformed selection was being painted in wrong order * Cleanup after testing * Fix tabletRestorePrevTool would always ask for a full canvas update * Remove unnecessary clear of cache when setting tool * Fix update artifacts when using dotted cursor - In addition this fix makes it possible to ignore an additional update event which would previously be done by updateCanvasCursor, but because the TiledBuffer will handle this now, we only update the cursor when a tool is not active. * Refactor TiledBuffer - Also add missing onClearTile callback, which is unused but implementation wise is correct now. * Some cleanup * Remove redundant clear of tile before deleting it * Update signal/slot naming convention * Apply some refactoring to tile * Fix blitRect::extend would make tiles odd numbered * Remove unused methods * Avoid invalidating cache till we're done drawing * Remove various dead code from ScribbleArea * Fix ScribbleArea repaint when tiled buffer does not cover update rect * Fix canvas pixmap being too big when using devicePixelRatio > 1 * Apply clip rect logic to BackgroundWidget * Try to fix seams appearing in Qt 6 * Fix canvas not being updated when using camera tool * Cleanup CanvasPainter * Adjust blitRect explanation * Remove the need to allocate an empty QPointF to draw pixmaps * TiledBuffer: Remove unused signals * Use clipRect instead of paint(target, pix, source) in order to support HDPI properly
- Loading branch information
Showing
5 changed files
with
83 additions
and
56 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
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