Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1088)

Unified Diff: content/browser/gpu/gpu_process_host.cc

Issue 10735010: 3D Compositing in <browser>, first draft. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Major changes to clean up deadlock & other issues Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698