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

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: Use the correct baseline 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 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);
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_host_helper.cc ('k') | content/browser/gpu/gpu_process_host_ui_shim.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698