| 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 a89ae701d7d94f5eaef889ce74c1a8c47f6d3b37..46f3bc09e8925c3f6b4b8f0ce40af39c0e944849 100644
|
| --- a/content/browser/gpu/gpu_process_host.cc
|
| +++ b/content/browser/gpu/gpu_process_host.cc
|
| @@ -529,16 +529,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() &&
|
| @@ -546,7 +548,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);
|
|
|