summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorneb@chromium.org <neb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-26 06:48:25 +0000
committerneb@chromium.org <neb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-26 06:48:25 +0000
commit4d60b7fe498975c5ba1cf61d63abb73d9f20b1b2 (patch)
tree138257b86fa0cc351cf1b499a72b18718a07aeab /ppapi
parent76f56f62e3ba2038ced739f313ffefbbd4fb2416 (diff)
downloadchromium_src-4d60b7fe498975c5ba1cf61d63abb73d9f20b1b2.zip
chromium_src-4d60b7fe498975c5ba1cf61d63abb73d9f20b1b2.tar.gz
chromium_src-4d60b7fe498975c5ba1cf61d63abb73d9f20b1b2.tar.bz2
PPB_Context3D_Trusted interface.
BUG=none TEST=none Review URL: http://codereview.chromium.org/6322010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72615 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/c/dev/ppb_context_3d_trusted_dev.h78
-rw-r--r--ppapi/ppapi_cpp.gypi1
2 files changed, 79 insertions, 0 deletions
diff --git a/ppapi/c/dev/ppb_context_3d_trusted_dev.h b/ppapi/c/dev/ppb_context_3d_trusted_dev.h
new file mode 100644
index 0000000..98fe25b
--- /dev/null
+++ b/ppapi/c/dev/ppb_context_3d_trusted_dev.h
@@ -0,0 +1,78 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PPAPI_C_DEV_PPB_CONTEXT_3D_TRUSTED_DEV_H_
+#define PPAPI_C_DEV_PPB_CONTEXT_3D_TRUSTED_DEV_H_
+
+#include "ppapi/c/pp_bool.h"
+#include "ppapi/c/pp_resource.h"
+#include "ppapi/c/pp_stdint.h"
+
+#define PPB_CONTEXT_3D_TRUSTED_DEV_INTERFACE "PPB_Context3DTrusted(Dev);0.1"
+
+enum PPB_Context3DTrustedError {
+ kNoError,
+ kInvalidSize,
+ kOutOfBounds,
+ kUnknownCommand,
+ kInvalidArguments,
+ kLostContext,
+ kGenericError
+};
+
+struct PP_Context3DTrustedState {
+ // Size of the command buffer in command buffer entries.
+ int32_t num_entries;
+
+ // The offset (in entries) from which the reader is reading.
+ int32_t get_offset;
+
+ // The offset (in entries) at which the writer is writing.
+ int32_t put_offset;
+
+ // The current token value. This is used by the writer to defer
+ // changes to shared memory objects until the reader has reached a certain
+ // point in the command buffer. The reader is responsible for updating the
+ // token value, for example in response to an asynchronous set token command
+ // embedded in the command buffer. The default token value is zero.
+ int32_t token;
+
+ // Error status.
+ PPB_Context3DTrustedError error;
+};
+
+struct PPB_Context3DTrusted_Dev {
+ PP_Bool (*GetRingBuffer)(PP_Resource context_id,
+ int* shm_handle,
+ uint32_t* shm_size);
+
+ // Returns the current state.
+ PP_Context3DTrustedState (*GetState)(PP_Resource context);
+
+ // The writer calls this to update its put offset.
+ PP_Bool (*Flush)(PP_Resource context, int32_t put_offset);
+
+
+ // The writer calls this to update its put offset. This function returns the
+ // reader's most recent get offset. Does not return until after the put offset
+ // change callback has been invoked.
+ PP_Context3DTrustedState (*FlushSync)(PP_Resource context,
+ int32_t put_offset);
+
+ // Create a transfer buffer and return a handle that uniquely
+ // identifies it or -1 on error.
+ int32_t (*CreateTransferBuffer)(PP_Resource context, size_t size);
+
+ // Destroy a transfer buffer and recycle the handle.
+ PP_Bool (*DestroyTransferBuffer)(PP_Resource context, int32_t id);
+
+ // Get the transfer buffer associated with a handle.
+ PP_Bool (*GetTransferBuffer)(PP_Resource context,
+ int32_t id,
+ int* shm_handle,
+ uint32_t* shm_size);
+};
+
+#endif // PPAPI_C_DEV_PPB_CONTEXT_3D_TRUSTED_DEV_H_
+
diff --git a/ppapi/ppapi_cpp.gypi b/ppapi/ppapi_cpp.gypi
index 9136a94..79f5603 100644
--- a/ppapi/ppapi_cpp.gypi
+++ b/ppapi/ppapi_cpp.gypi
@@ -50,6 +50,7 @@
'c/dev/ppb_buffer_dev.h',
'c/dev/ppb_char_set_dev.h',
'c/dev/ppb_context_3d_dev.h',
+ 'c/dev/ppb_context_3d_trusted_dev.h',
'c/dev/ppb_cursor_control_dev.h',
'c/dev/ppb_directory_reader_dev.h',
'c/dev/ppb_file_chooser_dev.h',