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

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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 per_compositor_data_[compositor]->surface_id, 195 per_compositor_data_[compositor]->surface_id,
196 &output_surface_map_, 196 &output_surface_map_,
197 compositor->vsync_manager(), 197 compositor->vsync_manager(),
198 CreateOverlayCandidateValidator(compositor->widget()))); 198 CreateOverlayCandidateValidator(compositor->widget())));
199 } 199 }
200 scoped_ptr<OnscreenDisplayClient> display_client(new OnscreenDisplayClient( 200 scoped_ptr<OnscreenDisplayClient> display_client(new OnscreenDisplayClient(
201 display_surface.Pass(), manager, compositor->task_runner())); 201 display_surface.Pass(), manager, compositor->task_runner()));
202 202
203 scoped_ptr<SurfaceDisplayOutputSurface> output_surface( 203 scoped_ptr<SurfaceDisplayOutputSurface> output_surface(
204 new SurfaceDisplayOutputSurface( 204 new SurfaceDisplayOutputSurface(
205 manager, next_surface_id_namespace_++, context_provider)); 205 manager, compositor->surface_id_allocator(), context_provider));
206 display_client->set_surface_output_surface(output_surface.get()); 206 display_client->set_surface_output_surface(output_surface.get());
207 output_surface->set_display_client(display_client.get()); 207 output_surface->set_display_client(display_client.get());
208 data->display_client = display_client.Pass(); 208 data->display_client = display_client.Pass();
209 return output_surface.PassAs<cc::OutputSurface>(); 209 return output_surface.PassAs<cc::OutputSurface>();
210 } 210 }
211 211
212 if (!context_provider.get()) { 212 if (!context_provider.get()) {
213 if (compositor_thread_.get()) { 213 if (compositor_thread_.get()) {
214 LOG(FATAL) << "Failed to create UI context, but can't use software" 214 LOG(FATAL) << "Failed to create UI context, but can't use software"
215 " compositing with browser threaded compositing. Aborting."; 215 " compositing with browser threaded compositing. Aborting.";
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, 466 FOR_EACH_OBSERVER(ImageTransportFactoryObserver,
467 observer_list_, 467 observer_list_,
468 OnLostResources()); 468 OnLostResources());
469 469
470 // Kill things that use the shared context before killing the shared context. 470 // Kill things that use the shared context before killing the shared context.
471 lost_gl_helper.reset(); 471 lost_gl_helper.reset();
472 lost_shared_main_thread_contexts = NULL; 472 lost_shared_main_thread_contexts = NULL;
473 } 473 }
474 474
475 } // namespace content 475 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698