| Index: content/browser/gpu/gpu_process_host.cc
|
| diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
|
| index 7a13cbf3d6e7274f0aa81c4c2d65bbf64fe10daa..aa399f8ce03adb33060b0a17e57f869299558a0a 100644
|
| --- a/content/browser/gpu/gpu_process_host.cc
|
| +++ b/content/browser/gpu/gpu_process_host.cc
|
| @@ -521,16 +521,18 @@ void GpuProcessHost::CreateViewCommandBuffer(
|
| DCHECK(CalledOnValidThread());
|
|
|
| #if defined(TOOLKIT_GTK)
|
| - // There should only be one such command buffer (for the compositor). In
|
| - // practice, if the GPU process lost a context, GraphicsContext3D with
|
| - // associated command buffer and view surface will not be gone until new
|
| - // one is in place and all layers are reattached.
|
| linked_ptr<SurfaceRef> surface_ref;
|
| - SurfaceRefMap::iterator it = surface_refs_.find(surface_id);
|
| - if (it != surface_refs_.end())
|
| - surface_ref = (*it).second;
|
| - else
|
| - surface_ref.reset(new SurfaceRef(compositing_surface.handle));
|
| + if (compositing_surface.handle) {
|
| + // There should only be one such command buffer (for the compositor). In
|
| + // practice, if the GPU process lost a context, GraphicsContext3D with
|
| + // associated command buffer and view surface will not be gone until new
|
| + // one is in place and all layers are reattached.
|
| + SurfaceRefMap::iterator it = surface_refs_.find(surface_id);
|
| + if (it != surface_refs_.end())
|
| + surface_ref = (*it).second;
|
| + else
|
| + surface_ref.reset(new SurfaceRef(compositing_surface.handle));
|
| + }
|
| #endif // defined(TOOLKIT_GTK)
|
|
|
| if (!compositing_surface.is_null() &&
|
| @@ -538,7 +540,8 @@ void GpuProcessHost::CreateViewCommandBuffer(
|
| compositing_surface, surface_id, client_id, init_params))) {
|
| create_command_buffer_requests_.push(callback);
|
| #if defined(TOOLKIT_GTK)
|
| - surface_refs_.insert(std::make_pair(surface_id, surface_ref));
|
| + if (compositing_surface.handle)
|
| + surface_refs_.insert(std::make_pair(surface_id, surface_ref));
|
| #endif
|
| } else {
|
| CreateCommandBufferError(callback, MSG_ROUTING_NONE);
|
|
|