-
Notifications
You must be signed in to change notification settings - Fork 5.8k
7183828: Invalid Image Variant when using anything other than BufferedImage #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Welcome back serb! A progress list of the required criteria for merging this PR into |
@mrserb The following labels will be automatically applied to this pull request: When this pull request is ready to be reviewed, an RFR email will be sent to the corresponding mailing lists. If you would like to change these labels, use the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have very mixed feelings about this whole idea.
InvalidPipeException is being co-opted for a different purpose.
The user no longer gets a clear message that their image type isn't supported.
Is there any specification we can point to ?
We already use this exception in such cases, and I think it is intended for this:
The spec for the Image class:
Or the spec for the VolatileImage
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Fair enough. Please copy those spec. excerpts into the bug report.
@mrserb This change now passes all automated pre-integration checks. In addition to the automated checks, the change must also fulfill all project specific requirements After integration, the commit message will be:
Since the source branch of this PR was last updated there have been 21 commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge ➡️ To integrate this PR with the above commit message to the |
/integrate |
@mrserb Since your change was applied there have been 21 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 8da6c8d. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
8252388: Allocation without ResourceMark in InterpreterOopMap::resource_copy
It is intended that our draw machinery works only on specific image formats that we know we support.
But the user still able to create some image subclasses for their purpose and according to our spec of
Graphics2D.drawImage() we should not throw any exceptions.
I suggest handling this situation in a similar way as we handle some errors during rendering when
the pipeline is in the wrong state, or the ToolkitImage is not loaded yet, just ignore the request and
return false.
All our pipelines have a special meaning of InvalidPipeException, if the pipeline found that it cannot complete the draw
operation throws this exception which is handled by all methods in the SunGraphics2D class.
So as a fix I suggest changing the IllegalArgumentException to the InvalidPipeException.
Also, we need to add a try/catch block to the drawHiDPIImage(it uses the SurfaceManager.getManager method directly)
Old review request:
https://mail.openjdk.java.net/pipermail/2d-dev/2020-August/010995.html
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/85/head:pull/85
$ git checkout pull/85