RFR: 8275715: D3D pipeline processes multiple PaintEvent at initial drawing [v2]
Masanori Yano
myano at openjdk.java.net
Thu Oct 28 08:27:51 UTC 2021
On Sat, 23 Oct 2021 19:40:59 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
>> Masanori Yano has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8275715: D3D pipeline processes multiple PaintEvent at initial drawing
>
> src/java.desktop/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java line 455:
>
>> 453: rq.unlock();
>> 454: }
>> 455: } else if (!validate(sd, true)) {
>
> The comment below says that "the surface will also trigger a repaint", will it be possible we will trigger it inside validate here and then later inside "replaceSurfaceDataLater"?
Yes, this run() is called on "D3D Screen Updater" thread. It is reasonable that a new PaintEvent is posted when SurfaceData is replaced on this thread. I would limit posting new PaintEvent via createGraphics() only.
> test/jdk/sun/java2d/DirectX/MultiPaintEventTest/MultiPaintEventTest.java line 36:
>
>> 34: public class MultiPaintEventTest extends Canvas {
>> 35:
>> 36: private int count = 0;
>
> Some synchronization is needed, the field is updated on EDT and checked on the main thread.
I fixed a test as it was pointed out to me.
> test/jdk/sun/java2d/DirectX/MultiPaintEventTest/MultiPaintEventTest.java line 75:
>
>> 73: throw new RuntimeException("Processed unnecessary paint().");
>> 74: }
>> 75: } catch (InterruptedException ex) {
>
> Do not ignore an exception
I fixed a test as it was pointed out to me.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6064
More information about the client-libs-dev
mailing list