| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "base/process_util.h" | 6 #include "base/process_util.h" |
| 7 #include "base/shared_memory.h" | 7 #include "base/shared_memory.h" |
| 8 #include "base/task.h" | 8 #include "base/task.h" |
| 9 #include "chrome/common/gpu_messages.h" | 9 #include "chrome/common/gpu_messages.h" |
| 10 #include "chrome/common/plugin_messages.h" | 10 #include "chrome/common/plugin_messages.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 } | 87 } |
| 88 | 88 |
| 89 gpu::CommandBuffer::State CommandBufferProxy::GetState() { | 89 gpu::CommandBuffer::State CommandBufferProxy::GetState() { |
| 90 // Send will flag state with lost context if IPC fails. | 90 // Send will flag state with lost context if IPC fails. |
| 91 if (last_state_.error == gpu::error::kNoError) | 91 if (last_state_.error == gpu::error::kNoError) |
| 92 Send(new GpuCommandBufferMsg_GetState(route_id_, &last_state_)); | 92 Send(new GpuCommandBufferMsg_GetState(route_id_, &last_state_)); |
| 93 | 93 |
| 94 return last_state_; | 94 return last_state_; |
| 95 } | 95 } |
| 96 | 96 |
| 97 gpu::CommandBuffer::State CommandBufferProxy::Flush(int32 put_offset) { | 97 void CommandBufferProxy::Flush(int32 put_offset) { |
| 98 AsyncFlush(put_offset, NULL); |
| 99 } |
| 100 |
| 101 gpu::CommandBuffer::State CommandBufferProxy::FlushSync(int32 put_offset) { |
| 98 // Send will flag state with lost context if IPC fails. | 102 // Send will flag state with lost context if IPC fails. |
| 99 if (last_state_.error == gpu::error::kNoError) { | 103 if (last_state_.error == gpu::error::kNoError) { |
| 100 Send(new GpuCommandBufferMsg_Flush(route_id_, | 104 Send(new GpuCommandBufferMsg_Flush(route_id_, |
| 101 put_offset, | 105 put_offset, |
| 102 &last_state_)); | 106 &last_state_)); |
| 103 } | 107 } |
| 104 | 108 |
| 105 return last_state_; | 109 return last_state_; |
| 106 } | 110 } |
| 107 | 111 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 pending_async_flush_tasks_.pop(); | 306 pending_async_flush_tasks_.pop(); |
| 303 | 307 |
| 304 if (task.get()) { | 308 if (task.get()) { |
| 305 // Although we need need to update last_state_ while potentially waiting | 309 // Although we need need to update last_state_ while potentially waiting |
| 306 // for a synchronous flush to complete, we do not need to invoke the | 310 // for a synchronous flush to complete, we do not need to invoke the |
| 307 // callback synchonously. Also, post it as a non nestable task so it is | 311 // callback synchonously. Also, post it as a non nestable task so it is |
| 308 // always invoked by the outermost message loop. | 312 // always invoked by the outermost message loop. |
| 309 MessageLoop::current()->PostNonNestableTask(FROM_HERE, task.release()); | 313 MessageLoop::current()->PostNonNestableTask(FROM_HERE, task.release()); |
| 310 } | 314 } |
| 311 } | 315 } |
| OLD | NEW |