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

Unified Diff: content/common/gpu/client/command_buffer_proxy_impl.cc

Issue 896723008: Add OrderingBarrierCHROMIUM API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update unit test classes. Created 5 years, 10 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
Index: content/common/gpu/client/command_buffer_proxy_impl.cc
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc
index ec473f3295f74957a3d246df20e1deb84d09908e..03766181c677c08733674534e934f285a0224398 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.cc
+++ b/content/common/gpu/client/command_buffer_proxy_impl.cc
@@ -25,13 +25,13 @@
namespace content {
-CommandBufferProxyImpl::CommandBufferProxyImpl(
- GpuChannelHost* channel,
- int route_id)
+CommandBufferProxyImpl::CommandBufferProxyImpl(GpuChannelHost* channel,
+ int route_id)
: channel_(channel),
route_id_(route_id),
flush_count_(0),
last_put_offset_(-1),
+ last_shallow_put_offset_(-1),
next_signal_id_(0) {
}
@@ -183,11 +183,30 @@ void CommandBufferProxyImpl::Flush(int32 put_offset) {
return;
last_put_offset_ = put_offset;
+ last_shallow_put_offset_ = put_offset;
+
+ if (channel_)
+ channel_->Flush(route_id_, put_offset, ++flush_count_, latency_info_,
+ false);
+
+ latency_info_.clear();
+}
+
+void CommandBufferProxyImpl::ShallowFlush(int32 put_offset) {
+ if (last_state_.error != gpu::error::kNoError)
+ return;
+
+ TRACE_EVENT1("gpu", "CommandBufferProxyImpl::ShallowFlush", "put_offset",
+ put_offset);
+
+ if (last_shallow_put_offset_ == put_offset)
+ return;
+
+ last_shallow_put_offset_ = put_offset;
+
+ if (channel_)
+ channel_->Flush(route_id_, put_offset, ++flush_count_, latency_info_, true);
- Send(new GpuCommandBufferMsg_AsyncFlush(route_id_,
- put_offset,
- ++flush_count_,
- latency_info_));
latency_info_.clear();
}

Powered by Google App Engine
This is Rietveld 408576698