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

Unified Diff: gpu/command_buffer/service/common_decoder.h

Issue 555129: Add commands Jump, Call and Return... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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 | « gpu/command_buffer/service/cmd_parser.cc ('k') | gpu/command_buffer/service/common_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/common_decoder.h
===================================================================
--- gpu/command_buffer/service/common_decoder.h (revision 37239)
+++ gpu/command_buffer/service/common_decoder.h (working copy)
@@ -6,6 +6,7 @@
#define GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_
#include <map>
+#include <stack>
#include "base/linked_ptr.h"
#include "base/scoped_ptr.h"
#include "gpu/command_buffer/service/cmd_parser.h"
@@ -20,6 +21,8 @@
public:
typedef parse_error::ParseError ParseError;
+ static const unsigned int kMaxStackDepth = 32;
+
// A bucket is a buffer to help collect memory across a command buffer. When
// creating a command buffer implementation of an existing API, sometimes that
// API has functions that take a pointer to data. A good example is OpenGL's
@@ -143,10 +146,23 @@
#undef COMMON_COMMAND_BUFFER_CMD_OP
+ // Pushes an address on the call stack.
+ bool PushAddress(uint32 offset);
+
CommandBufferEngine* engine_;
typedef std::map<uint32, linked_ptr<Bucket> > BucketMap;
BucketMap buckets_;
+
+ // The value put on the call stack.
+ struct CommandAddress {
+ explicit CommandAddress(uint32 _offset)
+ : offset(_offset) {
+ }
+
+ uint32 offset;
+ };
+ std::stack<CommandAddress> call_stack_;
};
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/service/cmd_parser.cc ('k') | gpu/command_buffer/service/common_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698