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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
6 #include <windows.h> | 6 #include <windows.h> |
7 #endif | 7 #endif |
8 | 8 |
9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
10 | 10 |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 IPC::Message* reply = IPC::SyncMessage::GenerateReply(&*message); | 253 IPC::Message* reply = IPC::SyncMessage::GenerateReply(&*message); |
254 reply->set_reply_error(); | 254 reply->set_reply_error(); |
255 Send(reply); | 255 Send(reply); |
256 } | 256 } |
257 } else { | 257 } else { |
258 // If the channel becomes unscheduled as a result of handling the message | 258 // If the channel becomes unscheduled as a result of handling the message |
259 // or has more work to do, synthesize an IPC message to flush the command | 259 // or has more work to do, synthesize an IPC message to flush the command |
260 // buffer that became unscheduled. | 260 // buffer that became unscheduled. |
261 GpuCommandBufferStub* stub = stubs_.Lookup(message->routing_id()); | 261 GpuCommandBufferStub* stub = stubs_.Lookup(message->routing_id()); |
262 if (stub) { | 262 if (stub) { |
263 if (!stub->IsScheduled() || stub->HasMoreWork()) { | 263 if (stub->HasUnprocessedCommands() || stub->HasMoreWork()) { |
264 deferred_messages_.push_front(new GpuCommandBufferMsg_Rescheduled( | 264 deferred_messages_.push_front(new GpuCommandBufferMsg_Rescheduled( |
265 stub->route_id())); | 265 stub->route_id())); |
266 } | 266 } |
267 if (stub->HasMoreWork() && !handle_messages_scheduled_) { | 267 if (stub->HasMoreWork() && !handle_messages_scheduled_) { |
268 MessageLoop::current()->PostDelayedTask( | 268 MessageLoop::current()->PostDelayedTask( |
269 FROM_HERE, | 269 FROM_HERE, |
270 base::Bind(&GpuChannel::HandleMessage, | 270 base::Bind(&GpuChannel::HandleMessage, |
271 weak_factory_.GetWeakPtr()), | 271 weak_factory_.GetWeakPtr()), |
272 base::TimeDelta::FromMilliseconds(kHandleMoreWorkPeriodMs)); | 272 base::TimeDelta::FromMilliseconds(kHandleMoreWorkPeriodMs)); |
273 handle_messages_scheduled_ = true; | 273 handle_messages_scheduled_ = true; |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 | 431 |
432 #if defined(OS_POSIX) | 432 #if defined(OS_POSIX) |
433 int GpuChannel::TakeRendererFileDescriptor() { | 433 int GpuChannel::TakeRendererFileDescriptor() { |
434 if (!channel_.get()) { | 434 if (!channel_.get()) { |
435 NOTREACHED(); | 435 NOTREACHED(); |
436 return -1; | 436 return -1; |
437 } | 437 } |
438 return channel_->TakeClientFileDescriptor(); | 438 return channel_->TakeClientFileDescriptor(); |
439 } | 439 } |
440 #endif // defined(OS_POSIX) | 440 #endif // defined(OS_POSIX) |
OLD | NEW |