| 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_command_buffer_stub.h" | 5 #include "gpu/ipc/service/gpu_command_buffer_stub.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 Send(wait_for_token_->reply.release()); | 453 Send(wait_for_token_->reply.release()); |
| 454 wait_for_token_.reset(); | 454 wait_for_token_.reset(); |
| 455 } | 455 } |
| 456 if (wait_for_get_offset_) { | 456 if (wait_for_get_offset_) { |
| 457 Send(wait_for_get_offset_->reply.release()); | 457 Send(wait_for_get_offset_->reply.release()); |
| 458 wait_for_get_offset_.reset(); | 458 wait_for_get_offset_.reset(); |
| 459 } | 459 } |
| 460 | 460 |
| 461 if (initialized_) { | 461 if (initialized_) { |
| 462 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); | 462 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); |
| 463 if ((surface_handle_ == kNullSurfaceHandle) && !active_url_.is_empty()) | 463 // If we are currently shutting down the GPU process to help with recovery |
| 464 // (exit_on_context_lost workaround), then don't tell the browser about |
| 465 // offscreen context destruction here since it's not client-invoked, and |
| 466 // might bypass the 3D API blocking logic. |
| 467 if ((surface_handle_ == gpu::kNullSurfaceHandle) && !active_url_.is_empty() |
| 468 && !gpu_channel_manager->is_exiting_for_lost_context()) { |
| 464 gpu_channel_manager->delegate()->DidDestroyOffscreenContext(active_url_); | 469 gpu_channel_manager->delegate()->DidDestroyOffscreenContext(active_url_); |
| 470 } |
| 465 } | 471 } |
| 466 | 472 |
| 467 if (decoder_) | 473 if (decoder_) |
| 468 decoder_->set_engine(NULL); | 474 decoder_->set_engine(NULL); |
| 469 | 475 |
| 470 // The scheduler has raw references to the decoder and the command buffer so | 476 // The scheduler has raw references to the decoder and the command buffer so |
| 471 // destroy it before those. | 477 // destroy it before those. |
| 472 executor_.reset(); | 478 executor_.reset(); |
| 473 | 479 |
| 474 sync_point_client_.reset(); | 480 sync_point_client_.reset(); |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 DCHECK(command_buffer_); | 1091 DCHECK(command_buffer_); |
| 1086 CommandBuffer::State state = command_buffer_->GetLastState(); | 1092 CommandBuffer::State state = command_buffer_->GetLastState(); |
| 1087 bool was_lost = state.error == error::kLostContext; | 1093 bool was_lost = state.error == error::kLostContext; |
| 1088 | 1094 |
| 1089 if (was_lost) { | 1095 if (was_lost) { |
| 1090 bool was_lost_by_robustness = | 1096 bool was_lost_by_robustness = |
| 1091 decoder_ && decoder_->WasContextLostByRobustnessExtension(); | 1097 decoder_ && decoder_->WasContextLostByRobustnessExtension(); |
| 1092 | 1098 |
| 1093 // Work around issues with recovery by allowing a new GPU process to launch. | 1099 // Work around issues with recovery by allowing a new GPU process to launch. |
| 1094 if ((was_lost_by_robustness || | 1100 if ((was_lost_by_robustness || |
| 1095 context_group_->feature_info()->workarounds().exit_on_context_lost) && | 1101 context_group_->feature_info()->workarounds().exit_on_context_lost)) { |
| 1096 !channel_->gpu_channel_manager()->gpu_preferences().single_process && | 1102 channel_->gpu_channel_manager()->MaybeExitOnContextLost(); |
| 1097 !channel_->gpu_channel_manager()->gpu_preferences().in_process_gpu) { | |
| 1098 LOG(ERROR) << "Exiting GPU process because some drivers cannot recover" | |
| 1099 << " from problems."; | |
| 1100 // Signal the message loop to quit to shut down other threads | |
| 1101 // gracefully. | |
| 1102 base::MessageLoop::current()->QuitNow(); | |
| 1103 } | 1103 } |
| 1104 | 1104 |
| 1105 // Lose all other contexts if the reset was triggered by the robustness | 1105 // Lose all other contexts if the reset was triggered by the robustness |
| 1106 // extension instead of being synthetic. | 1106 // extension instead of being synthetic. |
| 1107 if (was_lost_by_robustness && | 1107 if (was_lost_by_robustness && |
| 1108 (gfx::GLContext::LosesAllContextsOnContextLost() || | 1108 (gfx::GLContext::LosesAllContextsOnContextLost() || |
| 1109 use_virtualized_gl_context_)) { | 1109 use_virtualized_gl_context_)) { |
| 1110 channel_->LoseAllContexts(); | 1110 channel_->LoseAllContexts(); |
| 1111 } | 1111 } |
| 1112 } | 1112 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1133 result)); | 1133 result)); |
| 1134 } | 1134 } |
| 1135 | 1135 |
| 1136 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, | 1136 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, |
| 1137 base::TimeDelta interval) { | 1137 base::TimeDelta interval) { |
| 1138 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, | 1138 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, |
| 1139 interval)); | 1139 interval)); |
| 1140 } | 1140 } |
| 1141 | 1141 |
| 1142 } // namespace gpu | 1142 } // namespace gpu |
| OLD | NEW |