On Fri, 9 Oct 2026 21:21:22 GMT, Andy Goryachev <[email protected]> wrote:

>> John Hendrikx has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Fix review comments
>
> modules/javafx.graphics/src/main/java/com/sun/prism/sw/SWDrawingContext.java 
> line 602:
> 
>> 600:         transform.transform(src, 0, dst, 0, 4);
>> 601: 
>> 602:         double minX = Math.max(0, Math.floor(Math.min(Math.min(dst[0], 
>> dst[2]), Math.min(dst[4], dst[6]))));
> 
> what happens when the input is fractional?
> 
> should this case be detected and handled similarly to what `Canvas` is doing 
> (NGCanvas:716)

Canvas supports arbitrary clips, but I think it is a bit out of scope for this 
PR to also support that for the software renderer (although it can be added 
with more effort in the future).

For now I've elected to shrink the clip to whole pixels (so it will never draw 
on top of unintended pixels, which is the conservative solution) and documented 
that this is a limitation.

In the future we may be able to support anti-aliased clips in the software 
renderer as well, and then it is also a small step to support arbitrary clip 
shapes.  I've left the path open in the docs to be able to do so.

> modules/javafx.graphics/src/main/java/com/sun/prism/sw/SWDrawingContext.java 
> line 1265:
> 
>> 1263: 
>> 1264:             graphics.resetPaintBounds();
>> 1265:             graphics.drawTexture(tex, (float)dx, (float)dy, (float)(dx 
>> + dw), (float)(dy + dh), (float)sx, (float)sy, (float)(sx + sw), (float)(sy 
>> + sh));
> 
> should these coordinates account for `prismImage.getPixelScale()` ?

Yes, I've solved it and added a test

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

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

Reply via email to