On Wed, 13 Mar 2024 08:56:13 GMT, Jayathirth D V <j...@openjdk.org> wrote:

> Updated test to get screen capture in different platforms to see how we are 
> picking colors. Found that this test fails because it assumes that red,green 
> & blue bands in the test image are of equal size and picks color based on 
> that assumption.
> 
> If we take 20 * 20 aligned image, each scanline is 3 red pixels -> 3 green 
> pixels -> 8 blue pixels -> 3 green pixels -> 3 red pixels. So the blue pixels 
> actually acquire more space in a scanline. Even in y direction pattern is 
> same.
> 
> If we 48 * 48 unaligned image, each scanline is 7 red pixels -> 8 green 
> pixels -> 19 blue pixels -> 7 green pixels -> 7 red pixels. So the blue 
> pixels actually acquire more space in a scanline. Even in y direction pattern 
> is same.
> 
> So when this 48 * 48 image is scaled to 336 * 336 in case of 
> unalignedImage_Cover, we are calculating picking point for green color in 
> such a way that it is hitting border of green and blue bands and test is 
> failing. Only in this specific scenario we are scaling by large amount and 
> the inappropriate color picking logic is failing.
> 
> Updated color picking logic in such a way that appropriate weightage is given 
> to each color and we pick that color properly even when we have large 
> scaling. With this change test is passing on all platforms and there are no 
> regressions seen in all test run.

This pull request has now been integrated.

Changeset: c196454e
Author:    Jayathirth D V <j...@openjdk.org>
Committer: Ajit Ghaisas <aghai...@openjdk.org>
URL:       
https://git.openjdk.org/jfx/commit/c196454e76dec1cbcd028e12d99f052981a63a4e
Stats:     7 lines in 1 file changed: 1 ins; 1 del; 5 mod

8255679: RegionBackgroundImageUITest.unalignedImage_Cover fails because of 
wrong color

Reviewed-by: aghaisas

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

PR: https://git.openjdk.org/jfx/pull/1400

Reply via email to