| 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 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 ImageTransportFactoryObserver* observer) { | 498 ImageTransportFactoryObserver* observer) { |
| 499 observer_list_.AddObserver(observer); | 499 observer_list_.AddObserver(observer); |
| 500 } | 500 } |
| 501 | 501 |
| 502 void GpuProcessTransportFactory::RemoveObserver( | 502 void GpuProcessTransportFactory::RemoveObserver( |
| 503 ImageTransportFactoryObserver* observer) { | 503 ImageTransportFactoryObserver* observer) { |
| 504 observer_list_.RemoveObserver(observer); | 504 observer_list_.RemoveObserver(observer); |
| 505 } | 505 } |
| 506 | 506 |
| 507 #if defined(OS_MACOSX) | 507 #if defined(OS_MACOSX) |
| 508 void GpuProcessTransportFactory::OnSurfaceDisplayed(int surface_id) { | 508 void GpuProcessTransportFactory::OnGpuSwapBuffersCompleted( |
| 509 int surface_id, |
| 510 const std::vector<ui::LatencyInfo>& latency_info, |
| 511 gfx::SwapResult result) { |
| 509 BrowserCompositorOutputSurface* surface = output_surface_map_.Lookup( | 512 BrowserCompositorOutputSurface* surface = output_surface_map_.Lookup( |
| 510 surface_id); | 513 surface_id); |
| 511 if (surface) | 514 if (surface) |
| 512 surface->OnSurfaceDisplayed(); | 515 surface->OnGpuSwapBuffersCompleted(latency_info, result); |
| 513 } | 516 } |
| 514 | 517 |
| 515 void GpuProcessTransportFactory::SetCompositorSuspendedForRecycle( | 518 void GpuProcessTransportFactory::SetCompositorSuspendedForRecycle( |
| 516 ui::Compositor* compositor, | 519 ui::Compositor* compositor, |
| 517 bool suspended) { | 520 bool suspended) { |
| 518 PerCompositorDataMap::iterator it = per_compositor_data_.find(compositor); | 521 PerCompositorDataMap::iterator it = per_compositor_data_.find(compositor); |
| 519 if (it == per_compositor_data_.end()) | 522 if (it == per_compositor_data_.end()) |
| 520 return; | 523 return; |
| 521 PerCompositorData* data = it->second; | 524 PerCompositorData* data = it->second; |
| 522 DCHECK(data); | 525 DCHECK(data); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, | 647 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, |
| 645 observer_list_, | 648 observer_list_, |
| 646 OnLostResources()); | 649 OnLostResources()); |
| 647 | 650 |
| 648 // Kill things that use the shared context before killing the shared context. | 651 // Kill things that use the shared context before killing the shared context. |
| 649 lost_gl_helper.reset(); | 652 lost_gl_helper.reset(); |
| 650 lost_shared_main_thread_contexts = NULL; | 653 lost_shared_main_thread_contexts = NULL; |
| 651 } | 654 } |
| 652 | 655 |
| 653 } // namespace content | 656 } // namespace content |
| OLD | NEW |