Index: gpu/command_buffer/service/gpu_processor_mac.cc |
diff --git a/gpu/command_buffer/service/gpu_processor_mac.cc b/gpu/command_buffer/service/gpu_processor_mac.cc |
index 63a894da113f5515a9a31fa6cdec96fd8cd94c98..4d9ba185d2b1cb58918ca56cbc12b7476ef42837 100644 |
--- a/gpu/command_buffer/service/gpu_processor_mac.cc |
+++ b/gpu/command_buffer/service/gpu_processor_mac.cc |
@@ -108,6 +108,18 @@ void GPUProcessor::set_acknowledged_swap_buffers_count( |
acknowledged_swap_buffers_count_ = acknowledged_swap_buffers_count; |
} |
+void GPUProcessor::DidDestroySurface() { |
+ // When a browser window with a GPUProcessor is closed, the render process |
+ // will attempt to finish all GL commands, it will busy-wait on the GPU |
+ // process until the command queue is empty. If a paint is pending, the GPU |
+ // process won't process any GL commands until the browser sends a paint ack, |
+ // but since the browser window is already closed, it will never arrive. |
+ // To break this infinite loop, the browser tells the GPU process that the |
+ // surface became invalid, which causes the GPU process to not wait for paint |
+ // acks. |
+ surface_.reset(); |
+} |
+ |
void GPUProcessor::WillSwapBuffers() { |
DCHECK(decoder_.get()); |
DCHECK(decoder_->GetGLContext()); |