-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8272288: Funky multiresolution image breaks graphics context #11664
Conversation
👋 Welcome back serb! A progress list of the required criteria for merging this PR into |
vi.validate(gc); | ||
Graphics2D g = vi.createGraphics(); | ||
g.setColor(Color.RED); | ||
g.drawImage(image, 0, 0, null); // <- can cause InvalidPipeException |
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.
This drawImage call is expected to through InvalidPipeException all the times or is it intermittent?
If it is intermittent why so? Please explain.
It looks like after 8da6c8d6 we will through InvalidPipeException for all cases of custom images and not intermittently.
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.
It is not really intermittent but depends on the java2d pipeline currently in use. InvalidPipeException is produced by the accelerated pipelines but code works fine on GDI for example.
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.
Thanks for the clarification
* @summary Broken rendering should be reported by the contentsLost() | ||
* | ||
* @requires (os.family == "mac") | ||
* @run main/othervm -Dsun.java2d.opengl=True ReportRenderingError |
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 ran this test in macOS and without the fix it exits after checking only OpenGL pipeline. We dont override restoreContents() in CGLVolatileSurfaceManager/MTLVolatileSurfaceManager so its better if we can force the test to run on all pipelines on individual platforms and not exit on first failure based on jtreg instrcutions. This will make the test more robust.
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.
This java file already contains 4 tests(each can be run/problemlists separately), one covers the default pipeline on all platforms, and the other 3 cover some platform specific just in case.
vi.validate(gc); | ||
Graphics2D g = vi.createGraphics(); | ||
g.setColor(Color.RED); | ||
g.drawImage(image, 0, 0, null); // <- can cause InvalidPipeException |
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.
Thanks for the clarification
@mrserb This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 607 new 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 this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit 5147969.
Your commit was automatically rebased without conflicts. |
This is the next iteration of fixing the issue of rendering "broken" image. The fix for JDK-7183828 changed the possible IllegalArgumentException during rendering to the InvalidPipeException in assumtion that the new exception will be catched by the java2d machinery and the current-accelerated pipeline will be invalidated and software-pipeline will take care about that image.
But that change uncover another bug, the accelerated-pipeline invalidation by the InvalidPipeException works in D3D pipeline only, other pipelines start to use software based surfaces, but do not report about that the client code, as a result the next code does not work as expected, since contentsLost alwys return false:
After this change the correct value will be reported by the contentsLost(), so the RepaintManager will be able to catch that.
But this fix uncovered another bug. That fallback code path in the RepaintManager was not tested on HiDPI screen and does not work well. I'll file a separate bug about that.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11664/head:pull/11664
$ git checkout pull/11664
Update a local copy of the PR:
$ git checkout pull/11664
$ git pull https://git.openjdk.org/jdk pull/11664/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 11664
View PR using the GUI difftool:
$ git pr show -t 11664
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11664.diff