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

Unified Diff: gpu/command_buffer/common/buffer.cc

Issue 2012533004: Add generated and hand-written passthrough command handlers with stub Doers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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/common/buffer.h ('k') | gpu/command_buffer/common/gles2_cmd_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/buffer.cc
diff --git a/gpu/command_buffer/common/buffer.cc b/gpu/command_buffer/common/buffer.cc
index 1bb9523079dd3c094685b9ad306df7697b7526eb..8b48b4a45655d194d9359de186953b2c8f601d23 100644
--- a/gpu/command_buffer/common/buffer.cc
+++ b/gpu/command_buffer/common/buffer.cc
@@ -43,6 +43,20 @@ void* Buffer::GetDataAddress(uint32_t data_offset, uint32_t data_size) const {
return static_cast<uint8_t*>(memory_) + data_offset;
}
+void* Buffer::GetDataAddressAndSize(uint32_t data_offset,
+ uint32_t* data_size) const {
+ if (data_offset > static_cast<uint32_t>(size_))
+ return NULL;
+ *data_size = GetRemainingSize(data_offset);
+ return static_cast<uint8_t*>(memory_) + data_offset;
+}
+
+uint32_t Buffer::GetRemainingSize(uint32_t data_offset) const {
+ if (data_offset > static_cast<uint32_t>(size_))
+ return 0;
+ return static_cast<uint32_t>(size_) - data_offset;
+}
+
base::trace_event::MemoryAllocatorDumpGuid GetBufferGUIDForTracing(
uint64_t tracing_process_id,
int32_t buffer_id) {
« no previous file with comments | « gpu/command_buffer/common/buffer.h ('k') | gpu/command_buffer/common/gles2_cmd_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698