| 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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 ImageTransportFactoryObserver* observer) { | 647 ImageTransportFactoryObserver* observer) { |
| 648 observer_list_.AddObserver(observer); | 648 observer_list_.AddObserver(observer); |
| 649 } | 649 } |
| 650 | 650 |
| 651 void GpuProcessTransportFactory::RemoveObserver( | 651 void GpuProcessTransportFactory::RemoveObserver( |
| 652 ImageTransportFactoryObserver* observer) { | 652 ImageTransportFactoryObserver* observer) { |
| 653 observer_list_.RemoveObserver(observer); | 653 observer_list_.RemoveObserver(observer); |
| 654 } | 654 } |
| 655 | 655 |
| 656 #if defined(OS_MACOSX) | 656 #if defined(OS_MACOSX) |
| 657 void GpuProcessTransportFactory::OnGpuSwapBuffersCompleted( | |
| 658 gpu::SurfaceHandle surface_handle, | |
| 659 const std::vector<ui::LatencyInfo>& latency_info, | |
| 660 gfx::SwapResult result) { | |
| 661 BrowserCompositorOutputSurface* surface = output_surface_map_.Lookup( | |
| 662 surface_handle); | |
| 663 if (surface) | |
| 664 surface->OnGpuSwapBuffersCompleted(latency_info, result); | |
| 665 } | |
| 666 | |
| 667 void GpuProcessTransportFactory::SetCompositorSuspendedForRecycle( | 657 void GpuProcessTransportFactory::SetCompositorSuspendedForRecycle( |
| 668 ui::Compositor* compositor, | 658 ui::Compositor* compositor, |
| 669 bool suspended) { | 659 bool suspended) { |
| 670 PerCompositorDataMap::iterator it = per_compositor_data_.find(compositor); | 660 PerCompositorDataMap::iterator it = per_compositor_data_.find(compositor); |
| 671 if (it == per_compositor_data_.end()) | 661 if (it == per_compositor_data_.end()) |
| 672 return; | 662 return; |
| 673 PerCompositorData* data = it->second; | 663 PerCompositorData* data = it->second; |
| 674 DCHECK(data); | 664 DCHECK(data); |
| 675 if (data->surface) | 665 if (data->surface) |
| 676 data->surface->SetSurfaceSuspendedForRecycle(suspended); | 666 data->surface->SetSurfaceSuspendedForRecycle(suspended); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 shared_vulkan_context_provider_ = | 771 shared_vulkan_context_provider_ = |
| 782 cc::VulkanInProcessContextProvider::Create(); | 772 cc::VulkanInProcessContextProvider::Create(); |
| 783 } | 773 } |
| 784 | 774 |
| 785 shared_vulkan_context_provider_initialized_ = true; | 775 shared_vulkan_context_provider_initialized_ = true; |
| 786 } | 776 } |
| 787 return shared_vulkan_context_provider_; | 777 return shared_vulkan_context_provider_; |
| 788 } | 778 } |
| 789 | 779 |
| 790 } // namespace content | 780 } // namespace content |
| OLD | NEW |