On Wed, 21 May 2025 03:17:34 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> wrote:
> Graphics copyArea overflow check bails out of copying pixels if there is > overflow. > The spec says ""If a portion of the source rectangle lies outside the bounds > of the component, or is obscured by another window or component, {@code > copyArea} *will be unable to copy* the associated pixels" > > which suggests that we should always copy the parts inside the bounds and > never the parts outside the bounds > but it seems currently, in the case of overflow it no longer copies any > pixels, including the parts that are inside. > So, the fix clips the copyarea region to clip bounds so it will only affect > pixels within the valid bounds, and any pixels outside will be ignored. src/java.desktop/share/native/libawt/java2d/loops/Blit.c line 88: > 86: ? clipInfo.bounds.y2 : (dsty + height); > 87: if (UNSAFE_TO_SUB(srcx, dstx) || > 88: UNSAFE_TO_SUB(srcy, dsty)) { we also should check this part of the code, is it correct to simply exit here, or should we instead calculate and use the maximum distance we can handle? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25340#discussion_r2114891163