[OpenJDK 2D-Dev] RFR: 8166038 BufferedImage methods getTileGridXOffset() and getTileGridYOffset() return a non 0 value for sub images
Martin Desruisseaux
martin.desruisseaux at geomatys.com
Sat May 16 08:28:26 UTC 2020
Hello Jay
Le 16/05/2020 à 06:33, Jayathirth D v a écrit :
> Apologies for late reply(mail got lost and I forgot about checking it).
No problem, thanks for the reply. In the meantime I have sent an updated
version of the test case to Sergey, with test for arbitrary
RenderedImage as a separated method.
> I was under the impression that we have another implementation of
> RenderedImage which we can use, but looks like there are none.
I have found in Java2D source code that SunGraphics2D.getTileIndex(int,
int, int) method is using the same formula than JAI. Consequently I
think it is possible to demonstrate BufferedImage problem by wrapping it
behind another RenderedImage (just delegating all method calls to the
wrapped BufferedImage) for forcing SunGraphics2D to execute the general
case instead that its optimizations for BufferedImage special case. That
test would demonstrate that without the fix, attempt to draw a wrapped
BufferedImage.subSubImage(…) with Graphics2D.drawRenderedImage(…) causes
an IndexOutOfBoundsException to be thrown. Please let me know if such
test is desired.
Martin
More information about the 2d-dev
mailing list