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 "gpu/ipc/service/gpu_channel.h" | 5 #include "gpu/ipc/service/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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
233 if (scheduled_) | 233 if (scheduled_) |
234 channel_->PostHandleMessage(this); | 234 channel_->PostHandleMessage(this); |
235 | 235 |
236 sync_point_order_data_->PauseProcessingOrderNumber( | 236 sync_point_order_data_->PauseProcessingOrderNumber( |
237 channel_messages_.front()->order_number); | 237 channel_messages_.front()->order_number); |
238 } | 238 } |
239 | 239 |
240 void GpuChannelMessageQueue::FinishMessageProcessing() { | 240 void GpuChannelMessageQueue::FinishMessageProcessing() { |
241 base::AutoLock auto_lock(channel_lock_); | 241 base::AutoLock auto_lock(channel_lock_); |
242 DCHECK(!channel_messages_.empty()); | 242 DCHECK(!channel_messages_.empty()); |
243 DCHECK(scheduled_); | |
piman
2016/05/03 20:57:52
Oh, this can't go away. Actually we need to not ge
sunnyps
2016/05/03 21:17:10
Yes, this DCHECK is needed. We shouldn't finish a
| |
244 | 243 |
245 sync_point_order_data_->FinishProcessingOrderNumber( | 244 sync_point_order_data_->FinishProcessingOrderNumber( |
246 channel_messages_.front()->order_number); | 245 channel_messages_.front()->order_number); |
247 channel_messages_.pop_front(); | 246 channel_messages_.pop_front(); |
248 | 247 |
249 if (!channel_messages_.empty()) | 248 if (!channel_messages_.empty()) |
250 channel_->PostHandleMessage(this); | 249 channel_->PostHandleMessage(this); |
251 | 250 |
252 if (preempting_flag_) { | 251 if (preempting_flag_) { |
253 io_task_runner_->PostTask( | 252 io_task_runner_->PostTask( |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
785 GpuCommandBufferStub* stub = stubs_.get(routing_id); | 784 GpuCommandBufferStub* stub = stubs_.get(routing_id); |
786 | 785 |
787 DCHECK(!stub || stub->IsScheduled()); | 786 DCHECK(!stub || stub->IsScheduled()); |
788 | 787 |
789 DVLOG(1) << "received message @" << &msg << " on channel @" << this | 788 DVLOG(1) << "received message @" << &msg << " on channel @" << this |
790 << " with type " << msg.type(); | 789 << " with type " << msg.type(); |
791 | 790 |
792 HandleMessageHelper(msg); | 791 HandleMessageHelper(msg); |
793 | 792 |
794 // If we get descheduled or yield while processing a message. | 793 // If we get descheduled or yield while processing a message. |
795 if (stub && stub->HasUnprocessedCommands()) { | 794 if (stub && stub->HasUnprocessedCommands()) { |
piman
2016/05/03 20:57:52
I think the stub->HasUnprocessedCommands() check s
sunnyps
2016/05/03 21:17:10
Yeah, the previous assumption was that the stub on
erikchen
2016/05/04 16:20:35
I replaced the conditional with if (!message_queue
| |
796 DCHECK_EQ((uint32_t)GpuCommandBufferMsg_AsyncFlush::ID, msg.type()); | 795 DCHECK_EQ((uint32_t)GpuCommandBufferMsg_AsyncFlush::ID, msg.type()); |
797 message_queue->PauseMessageProcessing(); | 796 message_queue->PauseMessageProcessing(); |
798 } else { | 797 } else { |
799 message_queue->FinishMessageProcessing(); | 798 message_queue->FinishMessageProcessing(); |
800 } | 799 } |
801 } | 800 } |
802 | 801 |
803 void GpuChannel::HandleMessageHelper(const IPC::Message& msg) { | 802 void GpuChannel::HandleMessageHelper(const IPC::Message& msg) { |
804 int32_t routing_id = msg.routing_id(); | 803 int32_t routing_id = msg.routing_id(); |
805 | 804 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1049 ->CreateImageForGpuMemoryBuffer(handle, | 1048 ->CreateImageForGpuMemoryBuffer(handle, |
1050 size, | 1049 size, |
1051 format, | 1050 format, |
1052 internalformat, | 1051 internalformat, |
1053 client_id_); | 1052 client_id_); |
1054 } | 1053 } |
1055 } | 1054 } |
1056 } | 1055 } |
1057 | 1056 |
1058 } // namespace gpu | 1057 } // namespace gpu |
OLD | NEW |