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

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

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.h
diff --git a/content/common/gpu/gpu_channel.h b/content/common/gpu/gpu_channel.h
index d51a98ba2761383b87df9247cfe2f7ffc2adb608..623bc380e8f542251df80c086c30a0fa1d5c8629 100644
--- a/content/common/gpu/gpu_channel.h
+++ b/content/common/gpu/gpu_channel.h
@@ -115,6 +115,10 @@ class CONTENT_EXPORT GpuChannel
void OnAddSubscription(unsigned int target) override;
void OnRemoveSubscription(unsigned int target) override;
+ // Add callback when a specific order number has been processed.
+ void AddProcessedOrderNumberCallback(uint32_t order_number,
+ const base::Closure& callback);
+
// This is called when a command buffer transitions from the unscheduled
// state to the scheduled state, which potentially means the channel
// transitions from the unscheduled to the scheduled state. When this occurs
@@ -210,6 +214,21 @@ class CONTENT_EXPORT GpuChannel
base::hash_set<int32> routes_;
};
+ struct OrderCallback {
+ uint32_t order_number;
+ base::Closure callback_closure;
+
+ OrderCallback(uint32_t order_num, const base::Closure& callback);
+ ~OrderCallback();
+
+ bool operator>(const OrderCallback& rhs) const {
+ return order_number > rhs.order_number;
+ }
+ };
+ typedef std::priority_queue<OrderCallback,
+ std::vector<OrderCallback>,
+ std::greater<OrderCallback>> OrderCallbackQueue;
+
friend class GpuChannelMessageFilter;
friend class GpuChannelMessageQueue;
@@ -291,6 +310,9 @@ class CONTENT_EXPORT GpuChannel
// Map of stream id to stream state.
base::hash_map<int32, StreamState> streams_;
+ // Callbacks as each order number is processed.
+ OrderCallbackQueue processed_order_callbacks_;
+
bool allow_future_sync_points_;
bool allow_real_time_streams_;

Powered by Google App Engine
This is Rietveld 408576698