Index: content/common/gpu/gpu_channel.h |
diff --git a/content/common/gpu/gpu_channel.h b/content/common/gpu/gpu_channel.h |
index aaaa30b4532b0bb4481cc6313eb013859ae976f6..febe87ad7de5382b6b309d25b8c7e38b9c5f5b76 100644 |
--- a/content/common/gpu/gpu_channel.h |
+++ b/content/common/gpu/gpu_channel.h |
@@ -36,6 +36,7 @@ class WaitableEvent; |
namespace gpu { |
class PreemptionFlag; |
+class SyncPointClientState; |
class SyncPointManager; |
union ValueState; |
class ValueStateMap; |
@@ -166,16 +167,15 @@ class CONTENT_EXPORT GpuChannel |
// Visible for testing. |
GpuChannelMessageFilter* filter() const { return filter_.get(); } |
- // Returns the global order number of the IPC message that started processing |
- // last. |
- uint32_t current_order_num() const { return current_order_num_; } |
- |
// Returns the global order number for the last processed IPC message. |
uint32_t GetProcessedOrderNum() const; |
// Returns the global order number for the last unprocessed IPC message. |
uint32_t GetUnprocessedOrderNum() const; |
+ // Returns the shared sync point client state. |
+ scoped_refptr<gpu::SyncPointClientState> GetSyncPointClientState(); |
+ |
void HandleMessage(); |
// Some messages such as WaitForGetOffsetInRange and WaitForTokenInRange are |
@@ -279,8 +279,6 @@ class CONTENT_EXPORT GpuChannel |
// Map of stream id to stream state. |
base::hash_map<int32, StreamState> streams_; |
- uint32_t current_order_num_; |
- |
bool allow_future_sync_points_; |
bool allow_real_time_streams_; |
@@ -412,11 +410,13 @@ class GpuChannelMessageQueue |
const base::WeakPtr<GpuChannel>& gpu_channel, |
base::SingleThreadTaskRunner* task_runner); |
- // Returns the global order number for the last processed IPC message. |
+ scoped_refptr<gpu::SyncPointClientState> sync_point_client_state(); |
sunnyps
2015/09/22 17:25:59
snake case naming convention is for inline accesso
David Yen
2015/09/22 20:01:54
Done.
|
+ |
+ // Returns the global order number for the last unprocessed IPC message. |
uint32_t GetUnprocessedOrderNum() const; |
// Returns the global order number for the last unprocessed IPC message. |
- uint32_t processed_order_num() const { return processed_order_num_; } |
+ uint32_t GetProcessedOrderNum() const; |
bool HasQueuedMessages() const; |
@@ -428,7 +428,8 @@ class GpuChannelMessageQueue |
// Returns true if there are more messages on the queue. |
bool MessageProcessed(); |
- void PushBackMessage(const IPC::Message& message); |
+ void PushBackMessage(gpu::SyncPointManager* sync_point_manager, |
+ const IPC::Message& message); |
bool GenerateSyncPointMessage(gpu::SyncPointManager* sync_point_manager, |
const IPC::Message& message, |
@@ -446,24 +447,19 @@ class GpuChannelMessageQueue |
void ScheduleHandleMessage(); |
- void PushMessageHelper(scoped_ptr<GpuChannelMessage> msg); |
- |
- // This number is only ever incremented/read on the IO thread. |
- static uint32_t global_order_counter_; |
+ void PushMessageHelper(gpu::SyncPointManager* sync_point_manager, |
sunnyps
2015/09/22 17:25:59
Maybe initialize the message queue with a sync poi
David Yen
2015/09/22 20:01:54
Passing it in seems better here so we don't have t
|
+ scoped_ptr<GpuChannelMessage> msg); |
bool enabled_; |
- // Highest IPC order number seen, set when queued on the IO thread. |
- uint32_t unprocessed_order_num_; |
// Both deques own the messages. |
std::deque<GpuChannelMessage*> channel_messages_; |
- // This lock protects enabled_, unprocessed_order_num_, and channel_messages_. |
+ // This lock protects enabled_ and channel_messages_. |
mutable base::Lock channel_messages_lock_; |
- // Last finished IPC order number. Not protected by a lock as it's only |
- // accessed on the main thread. |
- uint32_t processed_order_num_; |
+ // Keeps track of sync point related state such as message order numbers. |
+ scoped_refptr<gpu::SyncPointClientState> sync_point_client_state_; |
base::WeakPtr<GpuChannel> gpu_channel_; |
scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |