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

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: Fixed nits. 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
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.h ('k') | content/common/gpu/client/gpu_channel_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0f894be5efdfc41f55b4309f0c1c1aef1afed4d9 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_barrier_put_offset_(-1),
next_signal_id_(0) {
}
@@ -179,16 +179,36 @@ void CommandBufferProxyImpl::Flush(int32 put_offset) {
"put_offset",
put_offset);
- if (last_put_offset_ == put_offset)
+ bool put_offset_changed = last_put_offset_ != put_offset;
+ last_put_offset_ = put_offset;
+ last_barrier_put_offset_ = put_offset;
+
+ if (channel_) {
+ channel_->OrderingBarrier(route_id_, put_offset, ++flush_count_,
+ latency_info_, put_offset_changed, true);
+ }
+
+ if (put_offset_changed)
+ latency_info_.clear();
+}
+
+void CommandBufferProxyImpl::OrderingBarrier(int32 put_offset) {
+ if (last_state_.error != gpu::error::kNoError)
return;
- last_put_offset_ = put_offset;
+ TRACE_EVENT1("gpu", "CommandBufferProxyImpl::OrderingBarrier", "put_offset",
+ put_offset);
+
+ bool put_offset_changed = last_barrier_put_offset_ != put_offset;
+ last_barrier_put_offset_ = put_offset;
+
+ if (channel_) {
+ channel_->OrderingBarrier(route_id_, put_offset, ++flush_count_,
+ latency_info_, put_offset_changed, false);
+ }
- Send(new GpuCommandBufferMsg_AsyncFlush(route_id_,
- put_offset,
- ++flush_count_,
- latency_info_));
- latency_info_.clear();
+ if (put_offset_changed)
+ latency_info_.clear();
}
void CommandBufferProxyImpl::SetLatencyInfo(
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.h ('k') | content/common/gpu/client/gpu_channel_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698