| OLD | NEW |
| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 | 378 |
| 379 // This gets a bit confusing. Here we have a ContextProvider in the |surface| | 379 // This gets a bit confusing. Here we have a ContextProvider in the |surface| |
| 380 // configured to render directly to this widget. We need to make an | 380 // configured to render directly to this widget. We need to make an |
| 381 // OnscreenDisplayClient associated with that context, then return a | 381 // OnscreenDisplayClient associated with that context, then return a |
| 382 // SurfaceDisplayOutputSurface set up to draw to the display's surface. | 382 // SurfaceDisplayOutputSurface set up to draw to the display's surface. |
| 383 cc::SurfaceManager* manager = surface_manager_.get(); | 383 cc::SurfaceManager* manager = surface_manager_.get(); |
| 384 scoped_ptr<cc::OnscreenDisplayClient> display_client( | 384 scoped_ptr<cc::OnscreenDisplayClient> display_client( |
| 385 new cc::OnscreenDisplayClient( | 385 new cc::OnscreenDisplayClient( |
| 386 std::move(surface), manager, HostSharedBitmapManager::current(), | 386 std::move(surface), manager, HostSharedBitmapManager::current(), |
| 387 BrowserGpuMemoryBufferManager::current(), | 387 BrowserGpuMemoryBufferManager::current(), |
| 388 compositor->GetRendererSettings(), compositor->task_runner())); | 388 compositor->GetRendererSettings(), compositor->task_runner(), |
| 389 compositor->surface_id_allocator()->id_namespace())); |
| 389 | 390 |
| 390 scoped_ptr<cc::SurfaceDisplayOutputSurface> output_surface( | 391 scoped_ptr<cc::SurfaceDisplayOutputSurface> output_surface( |
| 391 new cc::SurfaceDisplayOutputSurface( | 392 new cc::SurfaceDisplayOutputSurface( |
| 392 manager, compositor->surface_id_allocator(), context_provider, | 393 manager, compositor->surface_id_allocator(), context_provider, |
| 393 shared_worker_context_provider_)); | 394 shared_worker_context_provider_)); |
| 394 display_client->set_surface_output_surface(output_surface.get()); | 395 display_client->set_surface_output_surface(output_surface.get()); |
| 395 output_surface->set_display_client(display_client.get()); | 396 output_surface->set_display_client(display_client.get()); |
| 396 display_client->display()->Resize(compositor->size()); | 397 display_client->display()->Resize(compositor->size()); |
| 397 data->display_client = std::move(display_client); | 398 data->display_client = std::move(display_client); |
| 398 compositor->SetOutputSurface(std::move(output_surface)); | 399 compositor->SetOutputSurface(std::move(output_surface)); |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, | 676 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, |
| 676 observer_list_, | 677 observer_list_, |
| 677 OnLostResources()); | 678 OnLostResources()); |
| 678 | 679 |
| 679 // Kill things that use the shared context before killing the shared context. | 680 // Kill things that use the shared context before killing the shared context. |
| 680 lost_gl_helper.reset(); | 681 lost_gl_helper.reset(); |
| 681 lost_shared_main_thread_contexts = NULL; | 682 lost_shared_main_thread_contexts = NULL; |
| 682 } | 683 } |
| 683 | 684 |
| 684 } // namespace content | 685 } // namespace content |
| OLD | NEW |