OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/common/gpu/gpu_channel.h" | 5 #include "content/common/gpu/gpu_channel.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 return channel_messages_.front(); | 158 return channel_messages_.front(); |
159 } | 159 } |
160 return nullptr; | 160 return nullptr; |
161 } | 161 } |
162 | 162 |
163 void GpuChannelMessageQueue::BeginMessageProcessing( | 163 void GpuChannelMessageQueue::BeginMessageProcessing( |
164 const GpuChannelMessage* msg) { | 164 const GpuChannelMessage* msg) { |
165 sync_point_order_data_->BeginProcessingOrderNumber(msg->order_number); | 165 sync_point_order_data_->BeginProcessingOrderNumber(msg->order_number); |
166 } | 166 } |
167 | 167 |
| 168 void GpuChannelMessageQueue::PauseMessageProcessing( |
| 169 const GpuChannelMessage* msg) { |
| 170 sync_point_order_data_->PauseProcessingOrderNumber(msg->order_number); |
| 171 } |
| 172 |
168 bool GpuChannelMessageQueue::MessageProcessed() { | 173 bool GpuChannelMessageQueue::MessageProcessed() { |
169 base::AutoLock auto_lock(channel_messages_lock_); | 174 base::AutoLock auto_lock(channel_messages_lock_); |
170 DCHECK(!channel_messages_.empty()); | 175 DCHECK(!channel_messages_.empty()); |
171 scoped_ptr<GpuChannelMessage> msg(channel_messages_.front()); | 176 scoped_ptr<GpuChannelMessage> msg(channel_messages_.front()); |
172 channel_messages_.pop_front(); | 177 channel_messages_.pop_front(); |
173 sync_point_order_data_->FinishProcessingOrderNumber(msg->order_number); | 178 sync_point_order_data_->FinishProcessingOrderNumber(msg->order_number); |
174 return !channel_messages_.empty(); | 179 return !channel_messages_.empty(); |
175 } | 180 } |
176 | 181 |
177 void GpuChannelMessageQueue::DeleteAndDisableMessages() { | 182 void GpuChannelMessageQueue::DeleteAndDisableMessages() { |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 IPC::Message* reply = IPC::SyncMessage::GenerateReply(&message); | 856 IPC::Message* reply = IPC::SyncMessage::GenerateReply(&message); |
852 reply->set_reply_error(); | 857 reply->set_reply_error(); |
853 Send(reply); | 858 Send(reply); |
854 handled = true; | 859 handled = true; |
855 } | 860 } |
856 | 861 |
857 // A command buffer may be descheduled or preempted but only in the middle of | 862 // A command buffer may be descheduled or preempted but only in the middle of |
858 // a flush. In this case we should not pop the message from the queue. | 863 // a flush. In this case we should not pop the message from the queue. |
859 if (stub && stub->HasUnprocessedCommands()) { | 864 if (stub && stub->HasUnprocessedCommands()) { |
860 DCHECK_EQ((uint32_t)GpuCommandBufferMsg_AsyncFlush::ID, message.type()); | 865 DCHECK_EQ((uint32_t)GpuCommandBufferMsg_AsyncFlush::ID, message.type()); |
| 866 message_queue_->PauseMessageProcessing(m); |
861 // If the stub is still scheduled then we were preempted and need to | 867 // If the stub is still scheduled then we were preempted and need to |
862 // schedule a wakeup otherwise some other event will wake us up e.g. sync | 868 // schedule a wakeup otherwise some other event will wake us up e.g. sync |
863 // point completion. No DCHECK for preemption flag because that can change | 869 // point completion. No DCHECK for preemption flag because that can change |
864 // any time. | 870 // any time. |
865 if (stub->IsScheduled()) | 871 if (stub->IsScheduled()) |
866 ScheduleHandleMessage(); | 872 ScheduleHandleMessage(); |
867 return; | 873 return; |
868 } | 874 } |
869 | 875 |
870 if (message_queue_->MessageProcessed()) | 876 if (message_queue_->MessageProcessed()) |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 } | 1077 } |
1072 } | 1078 } |
1073 } | 1079 } |
1074 | 1080 |
1075 void GpuChannel::HandleUpdateValueState( | 1081 void GpuChannel::HandleUpdateValueState( |
1076 unsigned int target, const gpu::ValueState& state) { | 1082 unsigned int target, const gpu::ValueState& state) { |
1077 pending_valuebuffer_state_->UpdateState(target, state); | 1083 pending_valuebuffer_state_->UpdateState(target, state); |
1078 } | 1084 } |
1079 | 1085 |
1080 } // namespace content | 1086 } // namespace content |
OLD | NEW |