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

Unified Diff: gpu/command_buffer/client/cmd_buffer_helper.cc

Issue 220243003: Avoid GetState IPC call during AllocateRingbuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/cmd_buffer_helper.cc
diff --git a/gpu/command_buffer/client/cmd_buffer_helper.cc b/gpu/command_buffer/client/cmd_buffer_helper.cc
index d8ca8237a1e52ce8e8ea8294c4d561f3421514e3..080aa6b3573098a9a68315758e9ad7df25d69124 100644
--- a/gpu/command_buffer/client/cmd_buffer_helper.cc
+++ b/gpu/command_buffer/client/cmd_buffer_helper.cc
@@ -105,20 +105,11 @@ bool CommandBufferHelper::AllocateRingBuffer() {
ring_buffer_ = buffer;
ring_buffer_id_ = id;
command_buffer_->SetGetBuffer(id);
-
- // TODO(gman): Do we really need to call GetState here? We know get & put = 0
- // Also do we need to check state.num_entries?
- CommandBuffer::State state = command_buffer_->GetState();
entries_ = static_cast<CommandBufferEntry*>(ring_buffer_->memory());
- int32 num_ring_buffer_entries =
- ring_buffer_size_ / sizeof(CommandBufferEntry);
- if (num_ring_buffer_entries > state.num_entries) {
- ClearUsable();
- return false;
- }
-
- total_entry_count_ = num_ring_buffer_entries;
- put_ = state.put_offset;
+ total_entry_count_ = ring_buffer_size_ / sizeof(CommandBufferEntry);
+ // Call to SetGetBuffer(id) above resets get and put offsets to 0.
+ // No need to query it through IPC.
+ put_ = 0;
CalcImmediateEntries(0);
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698