NPAPI:CoreAnimationDrawingModel: Difference between revisions

Added clarification for software painting
(Added clarification for software painting)
Line 67: Line 67:
  }
  }


== CALayer lifecycle ==
== CALayer lifecycle ==


The browser is not responsible for releasing retained CALayer objects it receives via the "NPPVpluginCoreAnimationLayer" variable. The browser may additionally retain layers (perhaps by attaching them to views). A plugin may release the layer for an instance during or after the instance's NPP_Destroy call.
The browser is not responsible for releasing retained CALayer objects it receives via the "NPPVpluginCoreAnimationLayer" variable. The browser may additionally retain layers (perhaps by attaching them to views). A plugin may release the layer for an instance during or after the instance's NPP_Destroy call.
 
== Software paints  ==
 
Under certain circumstances the browser may require the plug-in to do a software paint. This is required whenever the browser needs to generate a snapshot of the page contents, for example when generating a drag-and-drop drag image, when generating history snapshots, and possibly for printing. To support these features, the browser will send a NPCocoaEventDrawRect, which tells the plug-in to do a software paint into the supplied CGContext. This is not expected to be a performance-critical code path.