| 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/software_browser_compositor_output_surface.
h" | 5 #include "content/browser/compositor/software_browser_compositor_output_surface.
h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 bool use_stencil) { | 67 bool use_stencil) { |
| 68 software_device()->Resize(size, device_scale_factor); | 68 software_device()->Resize(size, device_scale_factor); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void SoftwareBrowserCompositorOutputSurface::SwapBuffers( | 71 void SoftwareBrowserCompositorOutputSurface::SwapBuffers( |
| 72 cc::OutputSurfaceFrame frame) { | 72 cc::OutputSurfaceFrame frame) { |
| 73 DCHECK(client_); | 73 DCHECK(client_); |
| 74 base::TimeTicks swap_time = base::TimeTicks::Now(); | 74 base::TimeTicks swap_time = base::TimeTicks::Now(); |
| 75 for (auto& latency : frame.latency_info) { | 75 for (auto& latency : frame.latency_info) { |
| 76 latency.AddLatencyNumberWithTimestamp( | 76 latency.AddLatencyNumberWithTimestamp( |
| 77 ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, 0, swap_time, 1); | 77 ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, swap_time, 1); |
| 78 latency.AddLatencyNumberWithTimestamp( | 78 latency.AddLatencyNumberWithTimestamp( |
| 79 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0, | 79 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, swap_time, |
| 80 swap_time, 1); | 80 1); |
| 81 } | 81 } |
| 82 task_runner_->PostTask( | 82 task_runner_->PostTask( |
| 83 FROM_HERE, base::Bind(&RenderWidgetHostImpl::OnGpuSwapBuffersCompleted, | 83 FROM_HERE, base::Bind(&RenderWidgetHostImpl::OnGpuSwapBuffersCompleted, |
| 84 frame.latency_info)); | 84 frame.latency_info)); |
| 85 | 85 |
| 86 gfx::VSyncProvider* vsync_provider = software_device()->GetVSyncProvider(); | 86 gfx::VSyncProvider* vsync_provider = software_device()->GetVSyncProvider(); |
| 87 if (vsync_provider) | 87 if (vsync_provider) |
| 88 vsync_provider->GetVSyncParameters(update_vsync_parameters_callback_); | 88 vsync_provider->GetVSyncParameters(update_vsync_parameters_callback_); |
| 89 | 89 |
| 90 task_runner_->PostTask( | 90 task_runner_->PostTask( |
| (...skipping 26 matching lines...) Expand all Loading... |
| 117 return 0; | 117 return 0; |
| 118 } | 118 } |
| 119 | 119 |
| 120 #if defined(OS_MACOSX) | 120 #if defined(OS_MACOSX) |
| 121 void SoftwareBrowserCompositorOutputSurface::SetSurfaceSuspendedForRecycle( | 121 void SoftwareBrowserCompositorOutputSurface::SetSurfaceSuspendedForRecycle( |
| 122 bool suspended) { | 122 bool suspended) { |
| 123 } | 123 } |
| 124 #endif | 124 #endif |
| 125 | 125 |
| 126 } // namespace content | 126 } // namespace content |
| OLD | NEW |