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

Unified Diff: ppapi/c/dev/ppb_graphics_3d_trusted_dev.h

Issue 7431001: Re-land r92885, which was reverted in r92891. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 5 months 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 | « no previous file | ppapi/ppapi_cpp.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/c/dev/ppb_graphics_3d_trusted_dev.h
===================================================================
--- ppapi/c/dev/ppb_graphics_3d_trusted_dev.h (revision 0)
+++ ppapi/c/dev/ppb_graphics_3d_trusted_dev.h (revision 0)
@@ -0,0 +1,104 @@
+// 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_GRAPHICS_3D_TRUSTED_DEV_H_
+#define PPAPI_C_DEV_PPB_GRAPHICS_3D_TRUSTED_DEV_H_
+
+#include "ppapi/c/pp_bool.h"
+#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_resource.h"
+#include "ppapi/c/pp_stdint.h"
+
+#define PPB_GRAPHICS_3D_TRUSTED_DEV_INTERFACE_0_1 \
+ "PPB_Graphics3DTrusted(Dev);0.1"
+#define PPB_GRAPHICS_3D_TRUSTED_DEV_INTERFACE \
+ PPB_GRAPHICS_3D_TRUSTED_DEV_INTERFACE_0_1
+
+typedef enum {
+ PPB_GRAPHICS3D_TRUSTED_ERROR_OK,
+ PPB_GRAPHICS3D_TRUSTED_ERROR_GENERICERROR,
+ PPB_GRAPHICS3D_TRUSTED_ERROR_INVALIDARGUMENTS,
+ PPB_GRAPHICS3D_TRUSTED_ERROR_INVALIDSIZE,
+ PPB_GRAPHICS3D_TRUSTED_ERROR_LOSTCONTEXT,
+ PPB_GRAPHICS3D_TRUSTED_ERROR_OUTOFBOUNDS,
+ PPB_GRAPHICS3D_TRUSTED_ERROR_UNKNOWNCOMMAND
+} PPB_Graphics3DTrustedError;
+
+struct PP_Graphics3DTrustedState {
+ // 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_Graphics3DTrustedError error;
+
+ // Generation index of this state. The generation index is incremented every
+ // time a new state is retrieved from the command processor, so that
+ // consistency can be kept even if IPC messages are processed out-of-order.
+ uint32_t generation;
+};
+
+struct PPB_Graphics3DTrusted_Dev {
+ // Creates a raw Graphics3D resource. A raw Graphics3D is intended to be used
+ // with the trusted interface, through the command buffer (for proxying).
+ PP_Resource (*CreateRaw)(PP_Instance instance_id,
+ PP_Config3D_Dev config,
+ PP_Resource share_context,
+ const int32_t* attrib_list);
+
+ // Initializes the command buffer with the given size.
+ PP_Bool (*InitCommandBuffer)(PP_Resource context_id, int32_t size);
+
+ // Gets the ring buffer for the command buffer.
+ PP_Bool (*GetRingBuffer)(PP_Resource context_id,
+ int* shm_handle,
+ uint32_t* shm_size);
+
+ // Returns the current state.
+ struct PP_Graphics3DTrustedState (*GetState)(PP_Resource context);
+
+ // Create a transfer buffer and return a handle that uniquely
+ // identifies it or -1 on error.
+ int32_t (*CreateTransferBuffer)(PP_Resource context, uint32_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);
+
+ // 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.
+ struct PP_Graphics3DTrustedState (*FlushSync)(PP_Resource context,
+ int32_t put_offset);
+
+ // Like FlushSync, but returns before processing commands if the get offset is
+ // different than last_known_get. Allows synchronization with the command
+ // processor without forcing immediate command execution.
+ struct PP_Graphics3DTrustedState (*FlushSyncFast)(PP_Resource context,
+ int32_t put_offset,
+ int32_t last_known_get);
+};
+
+#endif // PPAPI_C_DEV_PPB_GRAPHICS_3D_TRUSTED_DEV_H_
+
Property changes on: ppapi/c/dev/ppb_graphics_3d_trusted_dev.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « no previous file | ppapi/ppapi_cpp.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698