On Wed, 28 Oct 2026 22:34:06 GMT, Andy Goryachev <[email protected]> wrote:

>> Martin Fox has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   LCD rendering option is now increasecontrast
>
> modules/javafx.graphics/src/main/java/com/sun/prism/impl/ps/BaseShaderGraphics.java
>  line 2123:
> 
>> 2121:                         (float)Math.pow(selectColor.getGreen(), 
>> invgamma),
>> 2122:                         (float)Math.pow(selectColor.getBlue(),  
>> invgamma),
>> 2123:                         (float)selectColor.getAlpha());
> 
> the existing shader still applies inverse gamma at 
> PaintTextureSecondPassLCD.jsl L116.  also, this change seems to ignore 
> `useContrast` logic

Alpha is linear and should never be gamma corrected. But you're right, this is 
a change to the existing path. For textColor it doesn't make a difference since 
it has to have an alpha of 1.0 (line 2019). I don't see any code that enforces 
the same restriction on selectColor even though it's handled by the same 
shader. I'll keep digging. Still, gamma should not be applied to alpha.

> modules/javafx.graphics/src/main/jsl-prism/PaintTextureSecondPassLCDNew.jsl 
> line 70:
> 
>> 68:     float3 w = float3(0.21, 0.72, 0.07);
>> 69:     float srcLightness = dot(c.rgb, w);
>> 70:     float dstLightness = dot(dstClr.rgb, w);
> 
> `dstClr.rgb` is linearized later on L128 - could this adjust the contrast 
> incorrectly?

Good catch. I'll fix that.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2284#discussion_r4414845277
PR Review Comment: https://git.openjdk.org/jfx/pull/2284#discussion_r4414848084

Reply via email to