On Fri, 10 Jun 2022 12:26:20 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:

>> 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.
>
>> 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.

> 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?

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

PR: https://git.openjdk.org/jdk/pull/9011

Reply via email to