CGSGMaskCache Class
ALFA VERSION : to be enhanced, essentially for performance reasons.
This mask could be applied to a node to cache in memory the rendering of a canvas and its nodes.
Constructor
CGSGMaskCache
()
Item Index
Methods
_eventAdapter
-
event
Observer method which catches key events to apply the mask.
Parameters:
-
event
CGSGEventthe event
finalize
-
node
-
context
Finalize this mask by drawing the memory canvas to the saved context.
Parameters:
-
node
CGSGNodethe node
-
context
CanvasRenderingContext2Dthe context returned by prepare()
Returns:
the context that was used to invoke prepare()
invalidate
-
node
Asks the mask to refresh the canvas cache for the given node in the next rendering. Automatically called when a node is scaled, resize or translated.
Parameters:
-
node
CGSGNodethe node
prepare
-
node
-
context
Prepare the rendering of the node by saving the given context and returning the cache context. However, if the cache is already filled, then the function will return null in order to tell the caller to not render the node.
Parameters:
-
node
CGSGNodethe node
-
context
CanvasRenderingContext2Dthe context where the node will be drawn
Returns:
the context to use