RFR: 8323108: BufferedImage.setData(Raster) should not cast float and double values to integers

Sergey Bylokhov serb at openjdk.org
Sun Jan 7 23:32:53 UTC 2024


On Tue, 7 Nov 2023 11:09:08 GMT, Martin Desruisseaux <duke at openjdk.org> wrote:

>would be replaced by the following (this code contains a call to getBounds() overrideable method):

That call could be eliminated if you create the new rect using "minX, minY, width, height". But the new code adds allocation of two new objects which immediately become garbage, probably we can change the code w/o using Rectangle?

> But anyway, the cost of Rectangle allocation is probably small comparatively to the cost of copying some thousands of pixel values.

But can we solve both issues, add optimization w/o creating the new objects?

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

PR Comment: https://git.openjdk.org/jdk/pull/13797#issuecomment-1800203841
PR Comment: https://git.openjdk.org/jdk/pull/13797#issuecomment-1804319579


More information about the client-libs-dev mailing list