Chromium Code Reviews| 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 "content/common/gpu/gpu_command_buffer_stub.h" | 5 #include "content/common/gpu/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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 719 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); | 719 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); |
| 720 IPC::Message* msg = new GpuCommandBufferMsg_Destroyed( | 720 IPC::Message* msg = new GpuCommandBufferMsg_Destroyed( |
| 721 route_id_, state.context_lost_reason, state.error); | 721 route_id_, state.context_lost_reason, state.error); |
| 722 msg->set_unblock(true); | 722 msg->set_unblock(true); |
| 723 Send(msg); | 723 Send(msg); |
| 724 | 724 |
| 725 // Tell the browser about this context loss as well, so it can | 725 // Tell the browser about this context loss as well, so it can |
| 726 // determine whether client APIs like WebGL need to be immediately | 726 // determine whether client APIs like WebGL need to be immediately |
| 727 // blocked from automatically running. | 727 // blocked from automatically running. |
| 728 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); | 728 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); |
| 729 gpu::error::ContextLostReason error = state.context_lost_reason; | |
| 730 if (context_group_->feature_info()->workarounds().exit_on_context_lost) { | |
| 731 // The browser might only see one lost context if we force GPU process | |
| 732 // shutdown, so make sure it treats it seriously enough wrt 3D api blocking. | |
|
no sievers
2016/03/21 18:31:15
Though there's probably a cleaner way to just hand
Ken Russell (switch to Gerrit)
2016/03/21 23:53:01
Very nice. Thank you for tracking down the need to
| |
| 733 error = gpu::error::kUnknown; | |
| 734 } | |
| 729 gpu_channel_manager->delegate()->DidLoseContext( | 735 gpu_channel_manager->delegate()->DidLoseContext( |
| 730 (surface_handle_ == gpu::kNullSurfaceHandle), state.context_lost_reason, | 736 (surface_handle_ == gpu::kNullSurfaceHandle), error, active_url_); |
| 731 active_url_); | |
| 732 | 737 |
| 733 CheckContextLost(); | 738 CheckContextLost(); |
| 734 } | 739 } |
| 735 | 740 |
| 736 void GpuCommandBufferStub::OnSchedulingChanged(bool scheduled) { | 741 void GpuCommandBufferStub::OnSchedulingChanged(bool scheduled) { |
| 737 TRACE_EVENT1("gpu", "GpuCommandBufferStub::OnSchedulingChanged", "scheduled", | 742 TRACE_EVENT1("gpu", "GpuCommandBufferStub::OnSchedulingChanged", "scheduled", |
| 738 scheduled); | 743 scheduled); |
| 739 channel_->OnStreamRescheduled(stream_id_, scheduled); | 744 channel_->OnStreamRescheduled(stream_id_, scheduled); |
| 740 } | 745 } |
| 741 | 746 |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1133 result)); | 1138 result)); |
| 1134 } | 1139 } |
| 1135 | 1140 |
| 1136 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, | 1141 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, |
| 1137 base::TimeDelta interval) { | 1142 base::TimeDelta interval) { |
| 1138 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, | 1143 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, |
| 1139 interval)); | 1144 interval)); |
| 1140 } | 1145 } |
| 1141 | 1146 |
| 1142 } // namespace content | 1147 } // namespace content |
| OLD | NEW |