Chromium Code Reviews| Index: content/browser/gpu/gpu_process_host_ui_shim.cc |
| diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc |
| index 8c4450628e7885b8275398a0659b4d9867022fd5..cfa5c29220a76f588040c6ead03c553d358d3c23 100644 |
| --- a/content/browser/gpu/gpu_process_host_ui_shim.cc |
| +++ b/content/browser/gpu/gpu_process_host_ui_shim.cc |
| @@ -180,6 +180,25 @@ bool GpuProcessHostUIShim::OnMessageReceived(const IPC::Message& message) { |
| return OnControlMessageReceived(message); |
| } |
| +void GpuProcessHostUIShim::RelinquishGpuResources( |
| + const base::Closure& callback) { |
| + // We end up sending two messages to the GPU process. the first is handled by |
| + // GpuChannelManager to release the default_offscreen_surface which |
| + // may hold a pointer to the EGL display which is about to be released. |
| + // The second is sent indirectly by the Ozone platform to release all |
| + // remaining OpenGL and EGL resources. It calls the optional callback once |
| + // this is completed and it is safe for an external process to access the GPU. |
| + // A default implementation runs the callback immediately. |
| + Send(new GpuMsg_DeleteDefaultOffscreenSurface()); |
|
piman
2014/11/18 20:55:34
Would you not want to wait for an ack before calli
GusFernandez
2014/11/19 18:50:13
This is done effectively by the next call. We only
piman
2014/11/19 20:33:52
But that's not true on !OZONE
|
| +#if defined(USE_OZONE) |
| + ui::OzonePlatform::GetInstance()->RelinquishGpuResources(callback); |
| +#else |
| + if (!callback.is_null()) { |
| + callback.Run(); |
| + } |
| +#endif |
| +} |
| + |
| void GpuProcessHostUIShim::SimulateRemoveAllContext() { |
| Send(new GpuMsg_Clean()); |
| } |