| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, 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, 0, |
| 80 swap_time, 1); | 80 swap_time, 1); |
| 81 } | 81 } |
| 82 task_runner_->PostTask(FROM_HERE, | 82 task_runner_->PostTask( |
| 83 base::Bind(&RenderWidgetHostImpl::CompositorFrameDrawn, | 83 FROM_HERE, base::Bind(&RenderWidgetHostImpl::OnGpuSwapBufersCompleted, |
| 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( |
| 91 FROM_HERE, | 91 FROM_HERE, |
| 92 base::Bind(&SoftwareBrowserCompositorOutputSurface::SwapBuffersCallback, | 92 base::Bind(&SoftwareBrowserCompositorOutputSurface::SwapBuffersCallback, |
| 93 weak_factory_.GetWeakPtr())); | 93 weak_factory_.GetWeakPtr())); |
| 94 } | 94 } |
| (...skipping 22 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 |