Plugins:NokiaMaemoImageSurface

Revision as of 20:10, 16 October 2009 by Dougt (talk | contribs)

We are proposing a NPAPI extension which would allow a plugin to render directly into 32-bit buffer in shared memory. The new extension will be designed so that plugin explicitly makes requests of the user agent whether the extension is supported (with NPN_GetValue and NPNVSupportsWindowlessLocal) and then enables the new rendering mode at runtime (with NPN_SetValue and NPPVpluginWindowlessLocalBool). In this way other plugins unaware of new extension will not be disrupted.

When new rendering mode is enabled the Xdrawable field of a standard XGraphicsExpose event holds a pointer to the new NPImageExpose structure which among other things contains pointer to the shared memory buffer, its dimensions, translation and scale factors.


typedef struct _NPImageExpose
{
  char*    data;     /* image pointer */
  int32    stride;   /* Stride of data image buffer */
  int32    depth;    /* Depth of image pointer */
  int32    x;        /* Expose x */
  int32    y;        /* Expose y */
  uint32   width;    /* Expose width */
  uint32   height;   /* Expose height */
  NPSize   dataSize; /* Data buffer size */
  float    translateX; /* translate X matrix value */
  float    translateY; /* translate Y matrix value */
  float    scaleX;     /* scale X matrix value */
  float    scaleY;     /* scale Y matrix value */

} NPImageExpose; 


see discussion:

http://groups.google.com/group/mozilla.dev.tech.plugins/browse_thread/thread/14a7aa48294faa68/fccbdd2fa6377b98#fccbdd2fa6377b98