RFR: 8357299: Graphics copyArea doesn't copy any pixels when there is overflow
Phil Race
prr at openjdk.org
Thu May 29 19:06:57 UTC 2025
On Wed, 28 May 2025 03:29:16 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>> src/java.desktop/share/native/libawt/java2d/loops/Blit.c line 85:
>>
>>> 83: dstInfo.bounds.x2 = UNSAFE_TO_ADD(dstx, width)
>>> 84: ? clipInfo.bounds.x2 : (dstx + width);
>>> 85: dstInfo.bounds.y2 = UNSAFE_TO_ADD(dsty, height)
>>
>> why wouldn't you always want to limit it to the clip ?
>> I mean shouldn't it be like this ?
>> dstInfo.bounds.x2 = UNSAFE_TO_ADD(dstx, width) ? clipInfo.bounds.x2 : (((dstx + width) > clipInfo.bounds.x2) ? clipInfo.bounds.x2 : (dstx + width));
>> or maybe a bit more readable as
>> dstInfo.bounds.x2 = ((UNSAFE_TO_ADD(dstx, width) || ((dstx + width) > clipInfo.bounds.x2)) ? clipInfo.bounds.x2 : (dstx + width);
>
> @prrace Since it is going to clip dstInfo.bounds to clipInfo.bounds in SurfaceData_IntersectBounds, I believe is not necessary to do the duplicate clip here.
> Let me know if you think otherwise..
ok
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25340#discussion_r2114574302
More information about the client-libs-dev
mailing list