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

[Canvas] Implement paint/damage drawing model for FX Canvas

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8u20
    • javafx
    • None

      Canvas is a control that allows direct drawing and works best for content that is drawn statically. However, when content is drawn infrequently, application code is forced to redraw the entire canvas or implement code to understand what has changed and draw less. Further, it is sometimes unclear when application code should draw to a canvas. It can draw at any time and this is somewhat unstructured.

      The paint/damage model is well understood in immediate mode drawing toolkits and might be a useful addition to FX. In addition to solving the "draw less" problem, it might allow clients with immediate mode drawing code from other toolkits to port to FX canvas more easily.

      The paint/damage model involved a damaged region that accumulates areas that need to be redrawn (typically rectangular areas). When there is no input activity in the UI (such as mouse and keyboard), a paint request is issued and the damage is cleared. Areas that need to be drawn are added to the damage by both the system and application code. When asked to draw, application code is provided with a graphics context that is clipped to the damaged area.

      Not all of the paint/damage concepts will necessarily apply to FX Canvas. However, the "draw less" and "when should I draw" problem for application code needs to be addressed.

            Unassigned Unassigned
            snorthov Steve Northover (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Imported: