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

Unified Diff: content/common/gpu/gpu_channel.cc

Issue 1331843005: Implemented new fence syncs which replaces the old sync points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some fixes Created 5 years, 3 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/gpu_channel.cc
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index c16db443bebd86e23724f6d10408f224840c5524..99b1038fb50a382fe1a70881c08a0a9fd690a6cf 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -593,6 +593,12 @@ bool GpuChannel::StreamState::HasRoutes() const {
return !routes_.empty();
}
+GpuChannel::OrderCallback::OrderCallback(uint32_t order_num,
+ const base::Closure& callback)
+ : order_number(order_num), callback_closure(callback) {}
+
+GpuChannel::OrderCallback::~OrderCallback() {}
+
GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager,
GpuWatchdog* watchdog,
gfx::GLShareGroup* share_group,
@@ -712,6 +718,12 @@ void GpuChannel::OnRemoveSubscription(unsigned int target) {
new GpuHostMsg_RemoveSubscription(client_id_, target));
}
+void GpuChannel::AddProcessedOrderNumberCallback(
+ uint32_t order_number,
+ const base::Closure& callback) {
+ processed_order_callbacks_.push(OrderCallback(order_number, callback));
+}
+
void GpuChannel::StubSchedulingChanged(bool scheduled) {
bool a_stub_was_descheduled = num_stubs_descheduled_ > 0;
if (scheduled) {
@@ -1083,6 +1095,12 @@ void GpuChannel::MessageProcessed(uint32_t order_number) {
DCHECK(current_order_num_ == order_number);
DCHECK(processed_order_num_ < order_number);
processed_order_num_ = order_number;
+
+ while (!processed_order_callbacks_.empty() &&
+ processed_order_callbacks_.top().order_number <= order_number) {
+ processed_order_callbacks_.top().callback_closure.Run();
+ processed_order_callbacks_.pop();
+ }
}
if (preempting_flag_.get()) {
io_task_runner_->PostTask(

Powered by Google App Engine
This is Rietveld 408576698