Java2D rendering primitives can be logged using the following Java VM property

    -Dsun.java2d.trace=[log[,timestamp]],[count],[out:<filename>],[help],[verbose]
 
See oracle docs describing the particular options.
This logging has been extended in JetBrains runtime for better tracking performance problems in IDEA platform-based products.
The extended version looks like this:
    -Dsun.java2d.trace=[log[,timestamp]],[count],[ptime],[name:<substr pattern>],[out:<filename>],[td=<threshold>],[help],[verbose]
 

Also, the logging now tracks some pure native routines such as working with LCD glyph cache. Here is an example

 

-Dsun.java2d.trace=log,ptime,name:OGLTR_AddToGlyphCache,out:/Users/user/trace2d.txt