RFR: 8275715: D3D pipeline processes multiple PaintEvent at initial drawing [v2]

Masanori Yano myano at openjdk.java.net
Thu Feb 10 07:42:09 UTC 2022


On Sun, 6 Feb 2022 21:46:37 GMT, Phil Race <prr 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
>
> The problem I have with this is that this being in createGraphics() isn't obviously relevant to me.
> The repaintPeerTarget() is called only if the surface is lost which means it needs repainting.
> Or does surface lost here perhaps mean "surface has not yet been created", because we aren't
> yet showing the window contents at all and we really should wait for the first paint event ?

@prrace createGraphics() is called to create surface during "the first paint event" processing. And validate() posts new PaintEvent with repaintPeerTarget() when creates surface.

Current stack trace is here:

  [1] java.awt.event.PaintEvent.<init> (PaintEvent.java:106)
  [2] sun.awt.PaintEventDispatcher.createPaintEvent (PaintEventDispatcher.java:80)
  [3] sun.awt.windows.WComponentPeer.postPaintIfNecessary (WComponentPeer.java:892)
  [4] sun.awt.windows.WComponentPeer.handlePaint (WComponentPeer.java:886)
  [5] sun.java2d.d3d.D3DScreenUpdateManager.repaintPeerTarget (D3DScreenUpdateManager.java:283)
  [6] sun.java2d.d3d.D3DScreenUpdateManager.validate (D3DScreenUpdateManager.java:492)
  [7] sun.java2d.d3d.D3DScreenUpdateManager.createGraphics (D3DScreenUpdateManager.java:260)
  [8] sun.awt.windows.WComponentPeer.getGraphics (WComponentPeer.java:646)
  [9] java.awt.Component.getGraphics (Component.java:3,128)
  [10] sun.awt.RepaintArea.paint (RepaintArea.java:227)
  [11] sun.awt.windows.WComponentPeer.handleEvent (WComponentPeer.java:371)
  [12] java.awt.Component.dispatchEventImpl (Component.java:5,056)
  [13] java.awt.Container.dispatchEventImpl (Container.java:2,325)
  [14] java.awt.Window.dispatchEventImpl (Window.java:2,775)
  [15] java.awt.Component.dispatchEvent (Component.java:4,827)
  [16] java.awt.EventQueue.dispatchEventImpl (EventQueue.java:772)

Created surface is normally handled in this processing PaintEvent, so I think there is no need to call repaintPeerTarget(). Also ScreenUpdateManager class which is used for GDI rendering (and parent class of D3DScreenUpdateManager) does not post new PaintEvent at createGraphics(). This validate() is called from createGraphics(), so I hope to reduce to create another PaintEvent at this route only.

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

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



More information about the client-libs-dev mailing list