-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8287743: javax/swing/text/CSSBorder/6796710/bug6796710.java failed #9011
Conversation
👋 Welcome back psadhukhan! A progress list of the required criteria for merging this PR into |
Webrevs
|
This test does not check the resulted color against the golden value. It validates the same area of the window which is captured twice, so even monitor color profile cannot affect it. Why do we have a difference of 1? Is it an issue in the rendering or robot? |
Used |
return robot.createScreenCapture(rect); | ||
MultiResolutionImage img = robot.createMultiResolutionScreenCapture(rect); | ||
return (BufferedImage)img.getResolutionVariant(rect.width, rect.height); | ||
//return robot.createScreenCapture(rect); |
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.
Isn't the old and new code should get the same result? The old createScreenCapture always creates an image of the low dpi quality. The createMultiResolutionScreenCapture creates two images low/hi dpi, but since you request the same size "rect" the low dpi image is returned, no?
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.
Maybe it's different in iMac systems..I dont have access to this system to analyse further nor do I have much knowledge on this 2D/awt multiresolution image side of things..
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.
If I remember correctly, MRI will contain only one image captured by Robot, so it would return the only image it stores, which would not be scaled down if High DPI is in effect.
However, the test is supposed to run with UIScale=1
, so this should make any difference.
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.
On the HiDPI screen that MRI will have two images, and my expectation is that the image requested by the updated test and the image used before the fix should be the same.
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.
How to find those 2 bufferedimages returned by createMultiResolutionScreenCapture
and createScreenCapture
are same or not apart from pixel check (which shows obviously they are not same and color differ by 1)?
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.
Probably we can apply the defensive fix of color tolerance as per 1st iteration ?
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 still fails once or twice with createMultiResolutionScreenCapture if the test iteration is increased, so I think color tolerance, even if defensive, is the one to go for.
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.
On the HiDPI screen that MRI will have two images, and my expectation is that the image requested by the updated test and the image used before the fix should be the same.
In this case, yes, the image will be the same as before: a scaled down bitmap you get with regular createScreenCapture
.
How to find those 2 bufferedimages returned by createMultiResolutionScreenCapture and createScreenCapture are same or not apart from pixel check (which shows obviously they are not same and color differ by 1)?
You can get the largest variant, and compare colors there. Yet the size of the two images will be different, most likely.
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 still fails once or twice with createMultiResolutionScreenCapture if the test iteration is increased, so I think color tolerance, even if defensive, is the one to go for.
So we return back to the initial question, why the code which capture same window rendered in same color in the same location produce different results? Why the tolerance is needed, Is it possible that the robot or rendering generate some garbage or override/read something wrong in memory?
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.
Shall the copyright year be updated?
@prsadhuk 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 321 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 fcb35ed.
Your commit was automatically rebased without conflicts. |
Test is failing in iMac CI systems owing to color difference of 1
x 0 y 0 rgb1: fff0f0f0 rgb2: fff0eff0
Added minor color tolerance check. CI testing is green
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9011/head:pull/9011
$ git checkout pull/9011
Update a local copy of the PR:
$ git checkout pull/9011
$ git pull https://git.openjdk.org/jdk pull/9011/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 9011
View PR using the GUI difftool:
$ git pr show -t 9011
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9011.diff