Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8102374

Optimize Region by using immutable State, caching on CSS level



    • Enhancement
    • Status: Closed
    • P3
    • Resolution: Fixed
    • 7u6
    • 8
    • javafx


      There is API to describe all the styleable properties of Region. Things like background, borders etc. At the moment there are several versions of these objects at CSS, SceneGraph and Prism levels. Every time a CSS change happens we build new set of CSS objects then convert twice into SG then Prism Objects. It seems like they should all use the same set of objects and make a pile less work to do.

      In addition, in order to implement the optimizations in NGRegion for render-to-texture for regions, we need a very fast way to determine if a set of backgrounds / borders have previously been drawn and cached as an image so we can reuse them. The simplest solution would be to bundle all of the backgrounds / borders into a single object on the region level which is then passed straight down to NGRegion. We need some cleverness in CSS so as to be able to very quickly determine / return a previously created list of backgrounds / borders. In addition, CSS should ensure that we have the exact same instance of Color, RadialGradient, LinearGradient, etc returned for any given set of inputs. SO for example, we could have a cache of String->Paint where derive (value, value, value) or whatnot is they key (where value is an actual numeric value). We still have to perform lookups but can then construct the resulting string and look for a previously created instance. This would allow us in Prism to do various other optimizations, as well as making subsequent hash code lookups based on a paint very quick (since the hashCode is cached).


        Issue Links



              rbair Richard Bair (Inactive)
              rbair Richard Bair (Inactive)
              0 Vote for this issue
              5 Start watching this issue