NPAPI:InvalidatingCoreAnimation

From MozillaWiki
Jump to: navigation, search

Status

Accepted, ready for implementation.

Contributors

  • Last modified: May 7, 2010
  • Authors: Josh Aas (Mozilla Corporation)
  • Contributors: Benoit Girard (Mozilla Corporation), Stuart Morgan (Google)

Overview

The regular Core Animation drawing model (NPDrawingModelCoreAnimation) does not work well for browser that don't hook CA layers into a layer tree. Browsers that want to read and composite pixels need a way to know when a plugin's pixels should be updated in order to operate efficiently. Core Animation does not allow for this.

Negotiating Invalidating Core Animation

For documentation on negotiating drawing models, see NPAPI:Models. The drawing model variables for Invalidating Core Animation are:

  • NPDrawingModelInvalidatingCoreAnimation (NPDrawingModel = 4)
  • NPNVsupportsInvalidatingCoreAnimationBool (NPNVariable = 2004)

Drawing

The Invalidating Core Animation model works much like the regular Core Animation model does. See the regular Core Animation documentation, which will not be duplicated here. The only difference is that when a plugin has updated its layer it must call NPN_InvalidateRect to let the browser know.