JDK-8092452 : Move bounds computation to FX scene graph
  • Type: Sub-task
  • Component: javafx
  • Sub-Component: graphics
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2009-08-24
  • Updated: 2015-06-12
  • Resolved: 2009-10-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
fx1.3Fixed
Related Reports
Blocks :  
Description
Currently the state of shapes, etc, is shadowed in the PG scene graph which computes a new bounds in response to changes in the FX scene graph. This is inefficient. Instead, we plan to move the responsibility for bounds computation to the FX scene graph to allow us to be more lazy in computing bounds. We still need utilities in the PG layer to assist with computing the bounds, but calling these utility functions will be under the control of the FX scene graph.

Comments
I thought about a few different approaches, but the current one is to literally move all the bounds computation up from the PG side to the FX side. The main goal here is to localize all the bounds stuff in one place in our source code (currently there is some in FX, some in SG, some in NG, some in MG, etc). I've currently done the work for almost everything -- except for Text. The problem with Text is making it fast, due to the need to cache TextLayout's in the swing implementation, and who knows what for prism or mobile. I think the ultimate answer is to provide sufficient interfaces on Toolkit so that we can do all the work on the FX side but get text measurement classes from the PG side, or something to that effect.
02-10-2009

- Simple to copy logic for Rectangle, other normal shapes into FX side - Have to use some static helpers, maybe even Path2D from geom package for Path, Polyline, Polygon - Have to use some utility in Toolkit to compute Text bounds A possible short term solution (partial fix) would be to use the existing PG classes to do bounds, but move the control entirely to the FX side. Issues: what about stroke?
24-08-2009