Open
Conversation
Idea to have interface which handle painting of many segments at once. On platforms like X11 drawing of many lines at once can be performed with single call
Apply clip condition, draw on virtualx and virtualps
Here no clipping is required, for VirtualPS coordinates need to be recalculated
Make lambda to paint ticks at specified index/position So reduce code duplication when painting extra ticks on left and right sides. Prepare code to fill buffers for segments painting
First collect all ticks and grids positions in the vector and then call function at the end
In SVG files all grids lines drawn together after all ticks so order is changed. But produced image will not change while grids always drawn on the top of the ticks PS image can reduce in size while now attributes not switched between ticks and grids all the time
Provide default implementation to ensure that all possible derived classes will work with new code
So first recalculate/clip buffers and then call methods
Test Results 21 files 21 suites 3d 0h 16m 41s ⏱️ For more details on these failures, see this check. Results for commit 12e657b. ♻️ This comment has been updated with latest results. |
Provide default implementation which makes simple drawing of N individual lines. While method `DrawSegments` with low-level API is already exist use name `DrawLinesSegments`
Like with TGX11::DrawPolyLine, split drawing on smaller portions if more than 500000 segments provide at a time. Use direct cast from `TPoint *` to `XSegment *` while segment is just two points one after another
Now native graphics can use faster X11 routine
It should allow to optimize drawing of the segments on SVG/PDF outputs
Recalculate buffer when using NDC - while PS always used only user coordinates
Many segments of similar line style combined now together in same svg:path element
stressGraphics.ref changed while dummy segments (zero-size length) not drawn at all. So ticks of zero size not appear in PS and PDF files as well. In svg_ref now axis ticks drawn as segments so now is the only svg:path for all axis ticks are placed. Main content of SVG files did not change so it is minimal amount of data commited into repository
While labels and grid/ticks painting was mixed, move produced labels in intermediate buffer to paint them between ticks and grids
After change in TGaxis segments for log scale are used. This makes more compact SVG and also PS can be shorter while all ticks drawn before all grids
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce methods to provide meaningful access to X11
XDrawSegmentsfunctionalityThis should reduce total number of X11 calls and improve performance of slow remote X11 displays
But for that one really need to use such functionality in the code
As first exercise try to modify
TGaxispainter where many ticks were drawn with separate calls.Now they collected together in temporary buffer and
gPad->DrawSegmentsat the end.Provide specific implementation for
TGX11::DrawLinesSegments- using current device and line attributes.If there are too many segments (>500K) - operation splitted on several - same like for poly-line
Provide specific
TSVG::DrawSegments()implementation to create singlesvg:pathelement.At the same time in
TVirtualX::DrawLinesSegments()and inTVirtualPS::DrawSegments()providedefault implementation which just call N times DrawLine method. So any derived classes - internal and external - not need to be modified at all.
Ref files for
stressGraphicsare changed while svg for axis ticks is now more compact.Also PS and PDF files can be smaller while dummy segments (zero length) are not drawn at all
After the PR several other places can be significantly improved minimizing total number of X11 calls