RFR: 8275715: D3D pipeline processes multiple PaintEvent at initial drawing

Sergey Bylokhov serb at openjdk.java.net
Sat Oct 23 19:44:00 UTC 2021


On Thu, 21 Oct 2021 12:19:43 GMT, Masanori Yano <myano at openjdk.org> wrote:

> Could you please review the 8275715 bug fixes?
> 
> I think D3DScreenUpdateManager posts unnecessary PaintEvent during processing PaintEvent. When the validate method is called from createGraphics, repaintPeerTarget should not be called.

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

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.

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

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

PR: https://git.openjdk.java.net/jdk/pull/6064



More information about the client-libs-dev mailing list