[Rev 01] RFR: 8088198: Exception thrown from snapshot if dimensions are larger than max texture size

Ambarish Rapte arapte at openjdk.java.net
Thu Jan 16 11:28:52 UTC 2020


On Thu, 16 Jan 2020 10:55:11 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:

>> The pull request has been updated with 1 additional commit.
> 
> modules/javafx.graphics/src/main/java/javafx/scene/Scene.java line 1306:
> 
>> 1305:             int verticalTileNb = (int) Math.ceil(height / (double) maxTextureSize);
>> 1306:             int horizontalTileNb = (int) Math.ceil(width / (double) maxTextureSize);
>> 1307:             for (int i = 0; i < horizontalTileNb; i++) {
> 
> A suggestion for this arithmetic.
> int verticalTileNb = height / maxTextureSize + 1;
> int horizontalTileNb = width / maxTextureSize + 1;
> This will avoid the type casting and floating point operations. However I leave it to you to change or not.

Assuming `Nb` in `verticalTileNb` stands for number, I would recommend to change the names as `numVerticalTiles` and `numHorizontalTiles`

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

PR: https://git.openjdk.java.net/jfx/pull/68


More information about the openjfx-dev mailing list