On Sun, 6 Sep 2026 16:37:22 GMT, Laurent Bourgès <[email protected]> wrote:

>> modules/javafx.graphics/src/main/java/com/sun/prism/sw/SWDrawingContext.java 
>> line 592:
>> 
>>> 590:     private Rectangle transformRect(double x1, double y1, double x2, 
>>> double y2) {
>>> 591:         double[] src = {x1, y1, x2, y1, x1, y2, x2, y2};
>>> 592:         double[] dst = new double[8];
>> 
>> You could use scratch arrays stored in the class to prevent unnecessary 
>> allocations here (maybe reuse `coords`).
>
> Always avoid allocation in hot path...

I will leave this until there is proof it is a performance hazard (this is only 
called by `clipRect`); given that it is likely that the draw operation itself 
is far more expensive, I think we should keep it as plain Java until we have 
reason to change it.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1969#discussion_r3945347188

Reply via email to