NPAPI:CoreAnimationDrawingModel: Difference between revisions

no edit summary
No edit summary
Line 1: Line 1:
= Status =
= Status =


Accepted
Accepted, ready for implementation.


== Background ==  
== Contributors ==
 
* Last modified: April 22, 2010
* Authors: Anders Carlsson (Apple), Kevin Decker (Apple)
* Contributors: Josh Aas (Mozilla Corporation)
 
== Overview ==  


Currently, the only way for a plug-in on Mac to use OpenGL is to attach an AGL surface manually. This has a number of drawbacks:
Currently, the only way for a plug-in on Mac to use OpenGL is to attach an AGL surface manually. This has a number of drawbacks:
Line 13: Line 19:
The Core Animation drawing model aims to solve these problems (and more) by letting the plug-in hand off a Core Animation layer to the browser. It is then up to the browser to position and size the layer.  
The Core Animation drawing model aims to solve these problems (and more) by letting the plug-in hand off a Core Animation layer to the browser. It is then up to the browser to position and size the layer.  


== Current Proposal ==
== Negotiating Core Animation ==
 
Last modified: January 17, 2010
Authors: Anders Carlsson (Apple Inc), Kevin Decker (Apple Inc)
Contributors: Josh Aas (Mozilla Corporation)
 
== Querying for availability ==
 
A plug-in may, in it's NPP_New callback negotiate a drawing model. It can call NPN_GetValue with the
 
NPNVsupportsCoreAnimationBool = 2003
 
NPNVariable to query the browser for whether the Core Animation drawing model is supported. The argument is an NPBool.
 
The plug-in can then call NPN_SetValue to tell the browser to use the Core Animation drawing model, using the
 
NPNVpluginDrawingModel = 1000
 
NPNVariable and the
 
NPDrawingModelCoreAnimation = 3


drawing model enumeration, cast to a void pointer.
For documentation on negotiating drawing models, see [[NPAPI:Models]]. The drawing model variables for Core Graphics are:


The Core Animation drawing model only works together with the [https://wiki.mozilla.org/Mac:NPAPI_Event_Models#The_Cocoa_event_model Cocoa Event Model]. If the plug-in tries to use the Carbon Event model with the Core Animation drawing model, the browser will destroy the plug-in after it has been instantiated.
* NPDrawingModelCoreAnimation (3)
* NPNVsupportsCoreAnimationBool (2003)


== Vending a layer ==
== Vending a layer ==
Confirmed users, Bureaucrats and Sysops emeriti
1,680

edits