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/location.h" | 9 #include "base/location.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 : BrowserCompositorOutputSurface(std::move(software_device), | 27 : BrowserCompositorOutputSurface(std::move(software_device), |
28 vsync_manager, | 28 vsync_manager, |
29 begin_frame_source), | 29 begin_frame_source), |
30 weak_factory_(this) {} | 30 weak_factory_(this) {} |
31 | 31 |
32 SoftwareBrowserCompositorOutputSurface:: | 32 SoftwareBrowserCompositorOutputSurface:: |
33 ~SoftwareBrowserCompositorOutputSurface() { | 33 ~SoftwareBrowserCompositorOutputSurface() { |
34 } | 34 } |
35 | 35 |
36 void SoftwareBrowserCompositorOutputSurface::SwapBuffers( | 36 void SoftwareBrowserCompositorOutputSurface::SwapBuffers( |
37 cc::CompositorFrame* frame) { | 37 std::unique_ptr<cc::CompositorFrame> frame) { |
38 base::TimeTicks swap_time = base::TimeTicks::Now(); | 38 base::TimeTicks swap_time = base::TimeTicks::Now(); |
39 for (auto& latency : frame->metadata.latency_info) { | 39 for (auto& latency : frame->metadata.latency_info) { |
40 latency.AddLatencyNumberWithTimestamp( | 40 latency.AddLatencyNumberWithTimestamp( |
41 ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, 0, swap_time, 1); | 41 ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, 0, swap_time, 1); |
42 latency.AddLatencyNumberWithTimestamp( | 42 latency.AddLatencyNumberWithTimestamp( |
43 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0, | 43 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0, |
44 swap_time, 1); | 44 swap_time, 1); |
45 } | 45 } |
46 base::ThreadTaskRunnerHandle::Get()->PostTask( | 46 base::ThreadTaskRunnerHandle::Get()->PostTask( |
47 FROM_HERE, base::Bind(&RenderWidgetHostImpl::CompositorFrameDrawn, | 47 FROM_HERE, base::Bind(&RenderWidgetHostImpl::CompositorFrameDrawn, |
(...skipping 28 matching lines...) Expand all Loading... |
76 NOTREACHED(); | 76 NOTREACHED(); |
77 } | 77 } |
78 | 78 |
79 #if defined(OS_MACOSX) | 79 #if defined(OS_MACOSX) |
80 void SoftwareBrowserCompositorOutputSurface::SetSurfaceSuspendedForRecycle( | 80 void SoftwareBrowserCompositorOutputSurface::SetSurfaceSuspendedForRecycle( |
81 bool suspended) { | 81 bool suspended) { |
82 } | 82 } |
83 #endif | 83 #endif |
84 | 84 |
85 } // namespace content | 85 } // namespace content |
OLD | NEW |