Skip to content

[cocoa] use window context for graphics#21705

Open
linev wants to merge 21 commits intoroot-project:masterfrom
linev:cocoa_wctxt
Open

[cocoa] use window context for graphics#21705
linev wants to merge 21 commits intoroot-project:masterfrom
linev:cocoa_wctxt

Conversation

@linev
Copy link
Copy Markdown
Member

@linev linev commented Mar 26, 2026

Like for TGX11, provide API methods to draw graphics using window context.
By large extent internal organization was done already so that all graphical operations were handled independently for different windows. Like GC (graphics context) objects were organized per window.
The only big change there - handling of TAtt... classes to be able configure attributes fully independent for different canvases.

Important change which need to be tested is changed XOR operations - like for crosshair cursor.
Now XOR operations accumulated independent for each widget. And display for these operations performed fully asynchronousely using setNeedsDisplay functionality. Before all such operations were accumulated in global fXorOps buffer and redistributed to individual widgets inside gVirtualX->Update(3) call. Now all this not necessary - but need to be tested.

@linev linev self-assigned this Mar 26, 2026
@linev linev marked this pull request as draft March 26, 2026 14:48
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 26, 2026

Test Results

    22 files      22 suites   3d 9h 10m 4s ⏱️
 3 831 tests  3 827 ✅   1 💤 3 ❌
76 534 runs  76 394 ✅ 137 💤 3 ❌

For more details on these failures, see this check.

Results for commit ebbbd30.

♻️ This comment has been updated with latest results.

@linev linev force-pushed the cocoa_wctxt branch 2 times, most recently from 5ac0f6b to fca1901 Compare March 27, 2026 12:08
@linev linev marked this pull request as ready for review March 31, 2026 11:54
@linev linev changed the title [cocoa] use window context for graphics [experimental] [cocoa] use window context for graphics Mar 31, 2026
linev added 16 commits March 31, 2026 16:37
It is main window handle to provide new functionality
It is just pointer to correspondent attributes instance
which can be used to store current set attributes

Provide implementation in QuartWindow, QuartzPixmap and QuartzImage
These should be at the end the only methods for setting attributes
Also implement internal attributes getter methods which later
can be moved in base TVirtualX class
Such approach can be done in the future just in base  TVirtualX class when all implementations support new API
For that intoduce setDrawMode interface for drawable
And implement only for relevant class
Using WinContext_t which delivers own attributes
Attributes handling similar to DrawBoxW
These are last methods which are important for graphics drawing
There is now alternative method used together with WinContext_t argument
Remaining place is text drawing
So potentially one can have independent handling
Simplify internal handling of draw mode
While line/rect XOR drawing performed within window context
argument anyway - manage such buffer in the window.
And in TGCocoa::Update just iterate over existing widgets and flush
XOR operations if exists.
So this view collects all commands and marked as need to be displayed.
linev added 5 commits March 31, 2026 16:37
No need central XOR buffer and many service methods.
One need to call DrawPolyLineW otherwise
context will be lost in default TVirtualX implementation
In this case TTF is used.
And align is stored now in native ROOT format like 22 or 13
Extend Quartz::TextLine. While it is private class, one can change API
No need to fallback to gVirtualX while this is private interface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant