-
Notifications
You must be signed in to change notification settings - Fork 544
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
Optimize Plotter Fills #1391
base: master
Are you sure you want to change the base?
Optimize Plotter Fills #1391
Conversation
On my machine this strategy is a lot slower, than drawing the fill with |
i played around with fillRect and it appears to work nicely, so i'm putting that back. the only optimization i left was to do that bulk fill for the region below the lowest part of the polyline. the bad performance before i believe was related to QT_THREAD_PARALLEL_FILLS being used, but something about the solid colors (instead of the alpha blending) seems to be avoiding that code path and making things faster. https://github.com/qt/qtbase/blob/b2e0ff4bca5d81205c8425cdc528e5c2a2988172/src/gui/painting/qdrawhelper.cpp#L3967 cc @markjfine if this does not work, i'll just revert fully to whatever it was before. |
@argilo i also checked 2.17.5 and found that it was actually also off by a pixel there too, but i have fixed this. once again points in polygons can be in the middle of pixels, but the rectangles cannot it appears. |
fixes #1386
something about the polygon fills is not super efficient. i would imagine there is some sort of flood filling happening which is overkill since we know each pixels state. for this reason, i used drawPixel. i also go left to right row by row since that has the best performance. i also made the fill below a fillRect which is efficient for bulk regions.
UPDATE:
used vertical lines instead