NPAPI:AsyncDrawing: Difference between revisions

Line 50: Line 50:
   uint32_t width;
   uint32_t width;
   uint32_t height;
   uint32_t height;
  NPBool opaque;
   struct {
   struct {
     void *handle;
     void *handle;
Line 55: Line 56:
  } NPAsyncSurface;
  } NPAsyncSurface;


The NPN_GetValueProcPtr is called with NPNVCreateSurface and it will pass a pointer to _NPAsyncSurface with the type of surface it is requesting. The width and height members of the structure passed in should be set to the desired width and height of the desired surface. When it returns handle will contain a HANDLE that can be used for example through OpenSharedResource (http://msdn.microsoft.com/en-us/library/bb173598%28v=VS.85%29.aspx) in order to create a texture for the user.
The NPN_GetValueProcPtr is called with NPNVCreateSurface and it will pass a pointer to _NPAsyncSurface with the type of surface it is requesting. The width and height members of the structure passed in should be set to the desired width and height of the desired surface. Opaque can be set to true in order to tell the plugin host that all pixels on the surface should be treated as opaque regardless of the alpha value. When it returns handle will contain a HANDLE that can be used for example through OpenSharedResource (http://msdn.microsoft.com/en-us/library/bb173598%28v=VS.85%29.aspx) in order to create a texture for the user.


When the surface is ready to be displayed to the screen it will call NPN_SetValueProcPtr with NPPVCurrentSurface and the pointer to the NPAsyncSurface that is to be shown.
When the surface is ready to be displayed to the screen it will call NPN_SetValueProcPtr with NPPVCurrentSurface and the pointer to the NPAsyncSurface that is to be shown.
Confirmed users
138

edits