| 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 "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 surface_id, | 27 surface_id, |
| 28 output_surface_map, | 28 output_surface_map, |
| 29 vsync_manager), | 29 vsync_manager), |
| 30 output_surface_proxy_(surface_proxy) {} | 30 output_surface_proxy_(surface_proxy) {} |
| 31 | 31 |
| 32 SoftwareBrowserCompositorOutputSurface:: | 32 SoftwareBrowserCompositorOutputSurface:: |
| 33 ~SoftwareBrowserCompositorOutputSurface() {} | 33 ~SoftwareBrowserCompositorOutputSurface() {} |
| 34 | 34 |
| 35 void SoftwareBrowserCompositorOutputSurface::SwapBuffers( | 35 void SoftwareBrowserCompositorOutputSurface::SwapBuffers( |
| 36 cc::CompositorFrame* frame) { | 36 cc::CompositorFrame* frame) { |
| 37 for (size_t i = 0; i < frame->metadata.latency_info.size(); i++) { | 37 base::TimeTicks swap_time = base::TimeTicks::Now(); |
| 38 frame->metadata.latency_info[i].AddLatencyNumber( | 38 for (auto& latency : frame->metadata.latency_info) { |
| 39 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0); | 39 latency.AddLatencyNumberWithTimestamp( |
| 40 ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, 0, swap_time, 1); |
| 41 latency.AddLatencyNumberWithTimestamp( |
| 42 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0, |
| 43 swap_time, 1); |
| 40 } | 44 } |
| 41 base::MessageLoop::current()->PostTask( | 45 base::MessageLoop::current()->PostTask( |
| 42 FROM_HERE, | 46 FROM_HERE, |
| 43 base::Bind( | 47 base::Bind( |
| 44 &RenderWidgetHostImpl::CompositorFrameDrawn, | 48 &RenderWidgetHostImpl::CompositorFrameDrawn, |
| 45 frame->metadata.latency_info)); | 49 frame->metadata.latency_info)); |
| 46 | 50 |
| 47 gfx::VSyncProvider* vsync_provider = software_device()->GetVSyncProvider(); | 51 gfx::VSyncProvider* vsync_provider = software_device()->GetVSyncProvider(); |
| 48 if (vsync_provider) { | 52 if (vsync_provider) { |
| 49 vsync_provider->GetVSyncParameters( | 53 vsync_provider->GetVSyncParameters( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 65 void SoftwareBrowserCompositorOutputSurface::OnSurfaceRecycled() { | 69 void SoftwareBrowserCompositorOutputSurface::OnSurfaceRecycled() { |
| 66 } | 70 } |
| 67 | 71 |
| 68 bool SoftwareBrowserCompositorOutputSurface::ShouldNotShowFramesAfterRecycle() | 72 bool SoftwareBrowserCompositorOutputSurface::ShouldNotShowFramesAfterRecycle() |
| 69 const { | 73 const { |
| 70 return false; | 74 return false; |
| 71 } | 75 } |
| 72 #endif | 76 #endif |
| 73 | 77 |
| 74 } // namespace content | 78 } // namespace content |
| OLD | NEW |