Chromium Code Reviews| Index: gpu/ipc/client/command_buffer_proxy_impl.cc |
| diff --git a/gpu/ipc/client/command_buffer_proxy_impl.cc b/gpu/ipc/client/command_buffer_proxy_impl.cc |
| index 7587212837fdca100c8ab632038e33b45ebce2b4..73b7bd73ec97be747537d84cc257f37228013b13 100644 |
| --- a/gpu/ipc/client/command_buffer_proxy_impl.cc |
| +++ b/gpu/ipc/client/command_buffer_proxy_impl.cc |
| @@ -617,15 +617,39 @@ void CommandBufferProxyImpl::SignalQuery(uint32_t query, |
| signal_tasks_.insert(std::make_pair(signal_id, callback)); |
| } |
| -bool CommandBufferProxyImpl::ProduceFrontBuffer(const gpu::Mailbox& mailbox) { |
| - CheckLock(); |
| +bool CommandBufferProxyImpl::TakeFrontBuffer(const gpu::Mailbox& mailbox, |
| + gpu::SyncToken* sync_token) { |
| + std::unique_ptr<base::AutoLock> lock; |
| + if (lock_) |
| + lock.reset(new base::AutoLock(*lock_)); |
|
piman
2016/04/26 01:54:01
These should be CheckLock(). The client is respons
erikchen
2016/04/27 16:31:23
Done.
|
| if (last_state_.error != gpu::error::kNoError) |
| return false; |
| - Send(new GpuCommandBufferMsg_ProduceFrontBuffer(route_id_, mailbox)); |
| + Send(new GpuCommandBufferMsg_TakeFrontBuffer(route_id_, mailbox)); |
| + |
| + uint64_t fence = GenerateFenceSyncRelease(); |
|
piman
2016/04/26 01:54:01
This will not do the right thing for Pepper, where
erikchen
2016/04/27 16:31:23
Got it. I now generate the sync token on the peppe
|
| + *sync_token = gpu::SyncToken(GetNamespaceID(), GetExtraCommandBufferData(), |
| + GetCommandBufferID(), fence); |
| + |
| + // Force a synchronous IPC to validate sync token. |
| + EnsureWorkVisible(); |
| + sync_token->SetVerifyFlush(); |
| return true; |
| } |
| +void CommandBufferProxyImpl::ReturnFrontBuffer(const gpu::Mailbox& mailbox, |
| + const gpu::SyncToken& sync_token, |
| + bool is_lost) { |
| + std::unique_ptr<base::AutoLock> lock; |
| + if (lock_) |
| + lock.reset(new base::AutoLock(*lock_)); |
| + if (last_state_.error != gpu::error::kNoError) |
| + return; |
| + |
| + Send(new GpuCommandBufferMsg_ReturnFrontBuffer(route_id_, mailbox, sync_token, |
| + is_lost)); |
| +} |
| + |
| gpu::error::Error CommandBufferProxyImpl::GetLastError() { |
| return last_state_.error; |
| } |