On Tue, 1 Sep 2026 18:29:11 GMT, Andy Goryachev <[email protected]> wrote:

>> John Hendrikx has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Use actual painted pixels to compute dirty rects
>
> modules/javafx.graphics/src/main/java/com/sun/prism/sw/SWDrawingContext.java 
> line 1153:
> 
>> 1151: 
>> 1152:             if (stroke) {
>> 1153:                 graphics.draw(strike.getOutline(run, 
>> BaseTransform.getTranslateInstance(runX, runY)));
> 
> a wide stroke will go outside the min/max dirty bounds used later in L1167, 
> possibly corrupting the pixels.

Although I think I actually fixed the original concern already with a previous 
commit (accounting for the stroke), I've refactored this to be simpler now.

I now use the actual rendered pixels (via `SWGraphics`) to determine the dirty 
rect. A deeper investigation turns out that the system basically already knows 
this, and it is more accurate than the estimation code that I had before (ie. 
expand by stroke/miter/etc). It only required relatively minor changes, and 
removes a lot of "guess" code from `SWDrawingContext`.

I've confirmed this also by supporting italic fonts in the font stubs (a simple 
guess there won't take overhang of glyphs into account). The test failed before 
and now passes.

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

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

Reply via email to