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

Side by Side Diff: content/browser/compositor/gpu_process_transport_factory.cc

Issue 553213003: Avoid destroying surface before the parent surface stops referencing it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/compositor/gpu_process_transport_factory.h" 5 #include "content/browser/compositor/gpu_process_transport_factory.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 display_surface.Pass(), manager, compositor->task_runner())); 201 display_surface.Pass(), manager, compositor->task_runner()));
202 202
203 scoped_refptr<cc::ContextProvider> offscreen_context_provider; 203 scoped_refptr<cc::ContextProvider> offscreen_context_provider;
204 if (context_provider.get()) { 204 if (context_provider.get()) {
205 offscreen_context_provider = ContextProviderCommandBuffer::Create( 205 offscreen_context_provider = ContextProviderCommandBuffer::Create(
206 GpuProcessTransportFactory::CreateOffscreenCommandBufferContext(), 206 GpuProcessTransportFactory::CreateOffscreenCommandBufferContext(),
207 "Offscreen-Compositor"); 207 "Offscreen-Compositor");
208 } 208 }
209 scoped_ptr<SurfaceDisplayOutputSurface> output_surface( 209 scoped_ptr<SurfaceDisplayOutputSurface> output_surface(
210 new SurfaceDisplayOutputSurface(manager, 210 new SurfaceDisplayOutputSurface(manager,
211 next_surface_id_namespace_++, 211 compositor->surface_id_allocator(),
212 offscreen_context_provider)); 212 offscreen_context_provider));
213 display_client->set_surface_output_surface(output_surface.get()); 213 display_client->set_surface_output_surface(output_surface.get());
214 output_surface->set_display(display_client->display()); 214 output_surface->set_display(display_client->display());
215 data->display_client = display_client.Pass(); 215 data->display_client = display_client.Pass();
216 return output_surface.PassAs<cc::OutputSurface>(); 216 return output_surface.PassAs<cc::OutputSurface>();
217 } 217 }
218 218
219 if (!context_provider.get()) { 219 if (!context_provider.get()) {
220 if (compositor_thread_.get()) { 220 if (compositor_thread_.get()) {
221 LOG(FATAL) << "Failed to create UI context, but can't use software" 221 LOG(FATAL) << "Failed to create UI context, but can't use software"
222 " compositing with browser threaded compositing. Aborting."; 222 " compositing with browser threaded compositing. Aborting.";
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, 473 FOR_EACH_OBSERVER(ImageTransportFactoryObserver,
474 observer_list_, 474 observer_list_,
475 OnLostResources()); 475 OnLostResources());
476 476
477 // Kill things that use the shared context before killing the shared context. 477 // Kill things that use the shared context before killing the shared context.
478 lost_gl_helper.reset(); 478 lost_gl_helper.reset();
479 lost_shared_main_thread_contexts = NULL; 479 lost_shared_main_thread_contexts = NULL;
480 } 480 }
481 481
482 } // namespace content 482 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698