[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-openjfx-dev
Subject: Re: [Rev 01] RFR: 8234471: Canvas in webview displayed with wrong scale on Windows
From: Kevin Rushforth <kcr () openjdk ! java ! net>
Date: 2020-03-24 14:21:37
Message-ID: eHwRBbSMrAUg3EgnsGL4DQO0R6oXlmmBBGKAIo-ZddI=.26296391-a367-4a01-9338-58b54812ab22 () github ! com
[Download RAW message or body]
On Tue, 25 Feb 2020 07:11:43 GMT, Arun Joseph <ajoseph@openjdk.org> wrote:
> > This bug can be reproduced when the screen resolution is at 125%, 150% and 175% \
> > for Windows, which correpsonds to `pixelScale` values of 1.25, 1.5 and 1.75, \
> > respectively.
> > Issue: The rectangle inside canvas is rendered on `pixelScale` while the borders \
> > are rendered on `Math.ceil(pixelScale)`
> > Fix: Use `Math.ceil(pixelScale)` for calculating `pixelScaleTransform`
>
> Arun Joseph has updated the pull request incrementally with one additional commit \
> since the last revision:
> Added CanvasTest
The fix looks good to me. I left one comment on the test.
tests/system/src/test/java/test/javafx/scene/web/CanvasTest.java line 125:
> 124: assertEquals("Rect bottom-right corner", redColor, (int) \
> webView.getEngine().executeScript(
> 125: \
> "document.getElementById('canvas').getContext('2d').getImageData(99, 99, 1, \
> 1).data[0]"));
> 126: webViewStateLatch.countDown();
An assertion failure here will not be propagated outside the listener. A failure will \
be reported as a timeout rather than an assertion failure.
I recommend moving the above two assertion checks to a `Util.runAndWait` block at the \
end of this method -- after the await call for `webViewStateLatch`.
-------------
PR: https://git.openjdk.java.net/jfx/pull/62
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic