NPAPI:AsyncDrawing: Difference between revisions

Jump to navigation Jump to search
Line 55: Line 55:


<pre>
<pre>
   NPN_CreateAsyncSurface(NPP instance, NPAsyncSurface* surface);
   NPError NPN_CreateAsyncSurface(NPP instance, NPAsyncSurface* surface);
</pre>
</pre>


The <code>size</code> member of the <code>NPAsyncSurface</code> should be set to the desired width and height of the surface. The <code>format</code> field of the <code>NPAsyncSurface</code> should reflect the format of the surface that is to be created. Upon return the <code>data</code> pointer should point to a valid surface data. The exact content depends on the type of surface requested, it will be set to NULL in the failure case.
The <code>size</code> member of the <code>NPAsyncSurface</code> should be set to the desired width and height of the surface. The <code>format</code> field of the <code>NPAsyncSurface</code> should reflect the format of the surface that is to be created. Upon return the <code>data</code> pointer should point to a valid surface data. The exact content depends on the type of surface requested, it will return an error when a failure occurs, <code>data</code> will be undefined.


Surfaces can be destroyed via a new function called <code>NPN_DestroyAsyncSurface</code>:
Surfaces can be destroyed via a new function called <code>NPN_DestroyAsyncSurface</code>:


<pre>
<pre>
   NPN_DestroyAsyncSurface(NPP instance, NPAsyncSurface* surface);
   NPError NPN_DestroyAsyncSurface(NPP instance, NPAsyncSurface* surface);
</pre>
</pre>


Line 71: Line 71:


<pre>
<pre>
   NPN_SetCurrentAsyncSurface(NPP instance, NPAsyncSurface* surface);
   NPError NPN_SetCurrentAsyncSurface(NPP instance, NPAsyncSurface* surface);
</pre>
</pre>


Confirmed users
138

edits

Navigation menu