[pad] Improve TCanvas::FeedbackMode - #23312
Open
linev wants to merge 22 commits into
Open
Conversation
Feedback mode used to implement specialized interactive painters like projections display. On some platforms (like web or GL) such invert painting not implemented. Therefore one can dismiss such interactive painting completely. Method now will return kTRUE when mode was really changed. Also provide method already in the TVirtualPad and redirect call to the canvas.
Before direct gVirtualX calls were used
Do not perform drawing when functionality not available
Like in other places, use pad painter instead direct gVirtualX calls
Allows to requests doublebuffer flag for the pad instance without accessing canvas
Disable invert painting when double buffer was active. Happens when in-between other interactive actions performed on the pad - like resize of dragging of stats box/title. Avoids artifacts on the pad because of remaining invert zone
Was used to draw outline when TH1 bincontent was modifying Reduce number of used static variables Only bin position defined by px1 is relevant for the handling
Do not use unique_ptr while gPad can remove/delete object. Instead set kCanDelete bit indicating that object can be deleted any time. Every time check that gPad contains zooming box Support non-opaque zooming when box not redrawn with all primitives, but painted directly in inverse mode
In such mode drawing must be done differently and completely fails when GL painter is activated
Instead use of plain gVirtualX convert 3D coordinates into fictional X/Y coordinates and use pp->DrawPolyLine method Use indicies for calculating coordinates which extremely simplifies logic Fully avoid use of gVirtualX in hist painter
linev
requested review from
bellenot,
couet,
dpiparo,
guitargeek,
hageboeck,
jblomer and
pcanal
as code owners
September 9, 2026 11:59
Search for the position using view->WCtoNDC conversion instead of heuristic code. Not most efficient, but reliable way to detect axes bins for building projection. Compress code around creating projection
Correctly decode options arguement Use canv->Add methods
Instead direclty use gPad->FeedbackMode and gPad->PaintLine methods. Via return value of FeedbackMode method one can detect if inverse drawing in the canvas is possible
No need to check and access TCanvas pointer
Before it was hapenning in TCanvas::Close() but we removing gVirtualX from there. Therefore do it explicitely already in TRootCanvas::Close()
Inform that painting can switch to invert mode which used in different interactive drawings
For both gVirtualX-based painting and GL painting it is supported, all other - not
If invert painting can be performed, one returns false.
Now it happens in the canvas implementation and therefore not necessary.
no need to check web or batch flags
Test Results 18 files 18 suites 3d 1h 15m 35s ⏱️ For more details on these failures, see this check. Results for commit d4cebdb. |
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.
Method now return boolean, which indicates if such mode supported by canvas.
It requires usage of invert painting and double-buffer support.
For now it works in plain and GL painters
Pad painter has boolean method which indicates if invert painting method is supported.
Fully rewrite
THistPainter::ShowProjection3(). It was invented 20 years ago and uses wrong pixel -> lego coordinates conversion. Plus many direct gVirtualX calls. Now histpainter fully free fromgVirtualXusage.Continue removing
gVirtualXfrom canvas and pad.When closing canvas, one select canvas window right before calling
gVirtualX->CloseWindow().