NPAPI:Pepper: Difference between revisions

Line 85: Line 85:
== Plugins and Rendering ==
== Plugins and Rendering ==


We propose generalizing the concept of rendering to include 2D RGBA, 3D, audio, and possibly other approaches.  To facilitate this, we propose the addition of a new struct type.
We expect to use the term renderer in a more general sense than just graphics, so we present NPAPI with a structure that can be extended as other interfaces are added (e.g., audio, 3D graphics, hardware accelerators).  To facilitate this, we propose the addition of a new struct type.
 
A plugin will request rendering contexts using the following structure.
 
<pre>
typedef struct _NPRenderContext
{
  union {
    struct {
      void* region;
      int32 stride;
      ...  /* Other information as needed for 2D RGBA */
    } graphicsRgba;
    ...  /* Other variants for renderers. */
  } u;
} NPRenderContext;
</pre>


=== 2D Rendering ===
=== 2D Rendering ===
89

edits