public class CacheFilter
extends Object
Base implementation of the Node.cache and cacheHint APIs.
When all or a portion of the cacheHint becomes enabled, we should try *not*
to re-render the cache. This avoids a big hiccup at the beginning of the
"use SPEED only while animating" use case:
0) Under DEFAULT, we should already have a cached image
1) scale/rotate caching is enabled (no expensive re-render required)
2) animation happens, using the cached image
3) animation completes, caching is disable and the node is re-rendered (at
full-fidelity) with the final transform.
Certain transform combinations are not supported, notably scaling by unequal
amounts in the x and y directions while also rotating. Other than simple
translation, animations in this case will require re-rendering every frame.
Ideally, a simple change to a Node's translation should never regenerate the
cached image.
The CacheFilter is also capable of optimizing the scrolling of the cached contents.
For example, the ScrollView UI Control can define its content area as being cached,
such that when the user scrolls, we can shift the old content area and adjust the
dirty region so that it only includes the "newly exposed" area.