Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1620)

Unified Diff: third_party/npapi/bindings/npapi_extensions.h

Issue 367002: Added Pepper 3D render context that instantiates the GPU plugin.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/gpu_plugin/gpu_plugin.cc ('k') | webkit/glue/plugins/npapi_extension_thunk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/npapi/bindings/npapi_extensions.h
===================================================================
--- third_party/npapi/bindings/npapi_extensions.h (revision 35153)
+++ third_party/npapi/bindings/npapi_extensions.h (working copy)
@@ -21,6 +21,12 @@
/* unique id for each device interface */
typedef int32 NPDeviceID;
+
+typedef struct _NPDeviceBuffer {
+ void* ptr;
+ size_t size;
+} NPDeviceBuffer;
+
/* completion callback for flush device */
typedef void (*NPDeviceFlushContextCallbackPtr)(
NPP instace,
@@ -67,6 +73,25 @@
typedef NPError (*NPDeviceDestroyContextPtr)(
NPP instance,
NPDeviceContext* context);
+/* Create a buffer associated with a particular context. The usage of the */
+/* buffer is device specific. The lifetime of the buffer is scoped with the */
+/* lifetime of the context. */
+typedef NPError (*NPDeviceCreateBufferPtr)(
+ NPP instance,
+ NPDeviceContext* context,
+ size_t size,
+ int32* id);
+/* Destroy a buffer associated with a particular context. */
+typedef NPError (*NPDeviceDestroyBufferPtr)(
+ NPP instance,
+ NPDeviceContext* context,
+ int32 id);
+/* Map a buffer id to its address. */
+typedef NPError (*NPDeviceMapBufferPtr)(
+ NPP instance,
+ NPDeviceContext* context,
+ int32 id,
+ NPDeviceBuffer* buffer);
/* forward decl typdef structs */
typedef struct NPDevice NPDevice;
@@ -81,6 +106,9 @@
NPDeviceGetStateContextPtr getStateContext;
NPDeviceFlushContextPtr flushContext;
NPDeviceDestroyContextPtr destroyContext;
+ NPDeviceCreateBufferPtr createBuffer;
+ NPDeviceDestroyBufferPtr destroyBuffer;
+ NPDeviceMapBufferPtr mapBuffer;
};
/* returns NULL if deviceID unavailable / unrecognized */
@@ -225,13 +253,36 @@
#define NPPepper3DDevice 2
typedef struct _NPDeviceContext3DConfig {
+ int32 commandBufferEntries;
} NPDeviceContext3DConfig;
+typedef enum {
+ // The offset the command buffer service has read to.
+ NPDeviceContext3DState_GetOffset,
+ // The offset the plugin instance has written to.
+ NPDeviceContext3DState_PutOffset,
+ // The last token processed by the command buffer service.
+ NPDeviceContext3DState_Token,
+ // The most recent parse error. Getting this value resets the parse error
+ // if it recoverable.
+ NPDeviceContext3DState_ParseError,
+ // Wether the command buffer has encountered an unrecoverable error.
+ NPDeviceContext3DState_ErrorStatus,
+} NPDeviceContext3DState;
+
typedef struct _NPDeviceContext3D
{
void* reserved;
- void* buffer;
- int32 bufferLength;
+
+ // Buffer in which commands are stored.
+ void* commandBuffer;
+ int32 commandBufferEntries;
+
+ // Offset in command buffer reader has reached. Synchronized on flush.
+ int32 getOffset;
+
+ // Offset in command buffer writer has reached. Synchronized on flush.
+ int32 putOffset;
} NPDeviceContext3D;
#endif /* _NP_EXTENSIONS_H_ */
« no previous file with comments | « gpu/gpu_plugin/gpu_plugin.cc ('k') | webkit/glue/plugins/npapi_extension_thunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698