[Rev 04] RFR: 8088198: Exception thrown from snapshot if dimensions are larger than max texture size
arapte at openjdk.java.net
Thu Jan 30 08:15:49 UTC 2020
On Thu, 30 Jan 2020 08:15:48 GMT, Frederic Thevenet <github.com+7450507+fthevenet at openjdk.org> wrote:
>> This PR aims to address the following issue: JDK-8088198 Exception thrown from snapshot if dimensions are larger than max texture size
>> In order to do that, it simply captures snapshots in multiple tiles of maxTextureSize^2 dimensions (or less, as needed), and then recomposes all the tiles into a a single image.
>> Other than that, the logic used to do the actual snapshot is unchanged.
>> Tests using the existing SnapshotCommon class have been added in a new file named Snapshot3Test under SystemTest/test/javafx/scene.
>> These tests pass with the proposed fix, and fail without, throwing " java.lang.IllegalArgumentException: Unrecognized image loader: null"
> The pull request has been updated with 1 additional commit.
With my basic testing, the change looks good, scaled up and scaled down snapshots seem correct visually.
After this change the tiled snapshot will be limited by dimensions of the `WritableImage`.
We can not create a `WritableImage` of dimension `(8192 * 3, 8192 * 3)` or greater.
`new WritableImage(8192 * 3, 8192 * 3)` causes an exception.
java.lang.IllegalArgumentException: capacity < 0: (-1879048192 < 0)
This is an existing behavior of `WritableImage`.
May be we should consider to wrap and re-throw the exception and update the API JavaDoc.
Anyway not a stopper for this PR.
Marked as reviewed by arapte (Reviewer).
More information about the openjfx-dev