[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: measuring time to render in javafx
From:       Benjamin Gudehus <hastebrot () gmail ! com>
Date:       2017-06-02 8:33:37
Message-ID: CANdUZf_+YPNy6D7OrSw67m9eJ6jQPzQu4Y-e-O8mEGPNuGHgcg () mail ! gmail ! com
[Download RAW message or body]

Hi Selim,

there was a presentation a while back about PerformanceTracker and the
anatomy of pulses:

   - Oleg Mazurov: "Optimizing JavaFX Applications"
   - https://www.youtube.com/watch?v=dw8se4uA1qc

You can activate the pulse logging using Java start parameters.

If you want something more sophisticated like an render indicator in your
GUI you probably need to access private fields/methods in the classes
responsible for the pulse.

Here is a brief overview of the call hierarchy for
PerformanceTracker.pulse():

   - PerformanceTracker#pulse()
      - Scene#pulse()
      - Toolkit#runPulse()
      - Toolkit#firePulse()
      - QuantumToolkit#pulse()

 And for frameRenderered():

   - PerformanceTracker#frameRendered()
      - Scene.ScenePeerPaintListener#frameRendered()
      - GlassScene#frameRendered()
      - PaintCollector#done(RenderJob)
      - RenderJob#run()
      - QuantumToolkit#addRenderJob()
         - QuantumToolkit#renderToImage(ImageRenderingContext)
      - ViewScene#repaint()
      - PaintCollector#renderAll()
      - QuantumToolkit#pulse()

 And a rough list of start parameters:

   - -Dquantum.pulse=true
   - -Dquantum.debug=trre
   - -Dquantum.verbose=true
   - -Dprism.order=d3d
   - -Dprism.order=sw
   - -Djavafx.pulseLogger=true

(If we had something like the developer tools in modern browsers in JavaFX
10, this would be amazing)

--Benjamin

On Fri, Jun 2, 2017 at 10:18 AM, Selim Dincer <wowselim@gmail.com> wrote:

> Hey,
>
> I am looking for a way to measure how long it takes for JavaFX to render
> something graphically. Say I change the text of a label, then this will
> schedule a new pulse. How can I now actually get feedback when the
> rendering is done?
> In swing I guess I could override the paint or paintComponent methods. In
> JavaFX I found a hacky way in which I supply a Canvas with my own
> implementation of NGCanvas and then override the impl_createPeer() method
> to return my implementation.
> However this is surely not the way to go and it will break in 9 :-)
>
> What would be the preferred way of doing this in JavaFX?
>
> --
> Viele Grüße
> *Selim Dincer*
>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic