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

Unified Diff: o3d/gpu_plugin/command_buffer.h

Issue 216043: Added support for registering additional shared memory objects (textures and ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 | o3d/gpu_plugin/command_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: o3d/gpu_plugin/command_buffer.h
===================================================================
--- o3d/gpu_plugin/command_buffer.h (revision 26762)
+++ o3d/gpu_plugin/command_buffer.h (working copy)
@@ -5,6 +5,9 @@
#ifndef O3D_GPU_PLUGIN_COMMAND_BUFFER_H_
#define O3D_GPU_PLUGIN_COMMAND_BUFFER_H_
+#include <set>
+#include <vector>
+
#include "base/message_loop.h"
#include "base/scoped_ptr.h"
#include "base/task.h"
@@ -55,7 +58,21 @@
// synchronize reader and writer reduces the risk of deadlock.
// Takes ownership of callback. The callback is invoked on the plugin thread.
virtual void SetPutOffsetChangeCallback(Callback0::Type* callback);
-
+
+ // Get an opaque integer handle for an NPObject. This can be used
+ // to identify the shared memory object from the ring buffer. Note that the
+ // object will be retained. Consider reference cycle issues. Returns zero for
+ // NULL, positive for non-NULL and -1 on error. Objects may be registered
+ // multiple times and have multiple associated handles. Each handle for a
+ // distinct object must be separately unregistered.
+ virtual int32 RegisterObject(NPObjectPointer<NPObject> object);
+
+ // Unregister a previously registered NPObject. It is safe to unregister the
+ // zero handle.
+ virtual void UnregisterObject(NPObjectPointer<NPObject> object, int32 handle);
+
+ virtual NPObjectPointer<NPObject> GetRegisteredObject(int32 handle);
+
NP_UTILS_BEGIN_DISPATCHER_CHAIN(CommandBuffer, DefaultNPObject<NPObject>)
NP_UTILS_DISPATCHER(Initialize, bool(int32))
NP_UTILS_DISPATCHER(GetRingBuffer, NPObjectPointer<CHRSharedMemory>())
@@ -63,6 +80,9 @@
NP_UTILS_DISPATCHER(SyncOffsets, int32(int32))
NP_UTILS_DISPATCHER(GetGetOffset, int32());
NP_UTILS_DISPATCHER(GetPutOffset, int32());
+ NP_UTILS_DISPATCHER(RegisterObject, int32(NPObjectPointer<NPObject>));
+ NP_UTILS_DISPATCHER(UnregisterObject,
+ void(NPObjectPointer<NPObject>, int32));
NP_UTILS_END_DISPATCHER_CHAIN
private:
@@ -72,9 +92,11 @@
int32 get_offset_;
int32 put_offset_;
scoped_ptr<Callback0::Type> put_offset_change_callback_;
+ std::vector<NPObjectPointer<NPObject> > registered_objects_;
+ std::set<int32> unused_registered_object_elements_;
};
} // namespace gpu_plugin
} // namespace o3d
-#endif // O3D_GPU_PLUGIN_COMMAND_BUFFER_H_
+#endif // O3D_GPU_PLUGIN_COMMAND_BUFFER_H_
« no previous file with comments | « no previous file | o3d/gpu_plugin/command_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698