Index: ppapi/proxy/ppapi_command_buffer_proxy.cc |
diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.cc b/ppapi/proxy/ppapi_command_buffer_proxy.cc |
index 5e0f45486aab667646784b8aa7fc6a80696da2fd..43b2b1cbb368307b46bfb9781aa0f9aef1d81720 100644 |
--- a/ppapi/proxy/ppapi_command_buffer_proxy.cc |
+++ b/ppapi/proxy/ppapi_command_buffer_proxy.cc |
@@ -99,9 +99,10 @@ gpu::CommandBuffer::State PpapiCommandBufferProxy::GetState() { |
// Send will flag state with lost context if IPC fails. |
if (last_state_.error == gpu::error::kNoError) { |
gpu::CommandBuffer::State state; |
+ bool success = false; |
if (Send(new PpapiHostMsg_PPBGraphics3D_GetState( |
- ppapi::API_ID_PPB_GRAPHICS_3D, resource_, &state))) { |
- UpdateState(state); |
+ ppapi::API_ID_PPB_GRAPHICS_3D, resource_, &state, &success))) { |
+ UpdateState(state, success); |
} |
} |
@@ -132,10 +133,11 @@ gpu::CommandBuffer::State PpapiCommandBufferProxy::FlushSync(int32 put_offset, |
// Send will flag state with lost context if IPC fails. |
if (last_state_.error == gpu::error::kNoError) { |
gpu::CommandBuffer::State state; |
+ bool success = false; |
if (Send(new PpapiHostMsg_PPBGraphics3D_Flush( |
ppapi::API_ID_PPB_GRAPHICS_3D, resource_, put_offset, |
- last_known_get, &state))) { |
- UpdateState(state); |
+ last_known_get, &state, &success))) { |
+ UpdateState(state, success); |
} |
} |
} else { |
@@ -259,11 +261,14 @@ bool PpapiCommandBufferProxy::Send(IPC::Message* msg) { |
} |
void PpapiCommandBufferProxy::UpdateState( |
- const gpu::CommandBuffer::State& state) { |
+ const gpu::CommandBuffer::State& state, |
+ bool success) { |
// Handle wraparound. It works as long as we don't have more than 2B state |
// updates in flight across which reordering occurs. |
if (state.generation - last_state_.generation < 0x80000000U) |
last_state_ = state; |
piman
2012/05/18 20:01:43
Don't do that if !success, because then you would
Fady Samuel
2012/05/18 20:44:42
Done.
|
+ if (!success) |
+ last_state_.error = gpu::error::kLostContext; |
piman
2012/05/18 20:01:43
To be fully correct, you should also increase the
Fady Samuel
2012/05/18 20:44:42
Done.
|
} |
} // namespace proxy |