| 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" |
| 11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
| 12 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "cc/output/compositor_frame.h" | 15 #include "cc/output/compositor_frame.h" |
| 16 #include "cc/output/output_surface_client.h" | 16 #include "cc/output/output_surface_client.h" |
| 17 #include "cc/output/software_output_device.h" | 17 #include "cc/output/software_output_device.h" |
| 18 #include "content/browser/renderer_host/render_widget_host_impl.h" | 18 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 19 #include "ui/events/latency_info.h" | 19 #include "ui/events/latency_info.h" |
| 20 #include "ui/gfx/vsync_provider.h" | 20 #include "ui/gfx/vsync_provider.h" |
| 21 | 21 |
| 22 namespace content { | 22 namespace content { |
| 23 | 23 |
| 24 SoftwareBrowserCompositorOutputSurface::SoftwareBrowserCompositorOutputSurface( | 24 SoftwareBrowserCompositorOutputSurface::SoftwareBrowserCompositorOutputSurface( |
| 25 scoped_ptr<cc::SoftwareOutputDevice> software_device, | 25 scoped_ptr<cc::SoftwareOutputDevice> software_device, |
| 26 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager) | 26 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
| 27 : BrowserCompositorOutputSurface(std::move(software_device), vsync_manager), | 27 scoped_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source) |
| 28 : BrowserCompositorOutputSurface(std::move(software_device), |
| 29 vsync_manager, |
| 30 std::move(synthetic_begin_frame_source)), |
| 28 weak_factory_(this) {} | 31 weak_factory_(this) {} |
| 29 | 32 |
| 30 SoftwareBrowserCompositorOutputSurface:: | 33 SoftwareBrowserCompositorOutputSurface:: |
| 31 ~SoftwareBrowserCompositorOutputSurface() { | 34 ~SoftwareBrowserCompositorOutputSurface() { |
| 32 } | 35 } |
| 33 | 36 |
| 34 void SoftwareBrowserCompositorOutputSurface::SwapBuffers( | 37 void SoftwareBrowserCompositorOutputSurface::SwapBuffers( |
| 35 cc::CompositorFrame* frame) { | 38 cc::CompositorFrame* frame) { |
| 36 base::TimeTicks swap_time = base::TimeTicks::Now(); | 39 base::TimeTicks swap_time = base::TimeTicks::Now(); |
| 37 for (auto& latency : frame->metadata.latency_info) { | 40 for (auto& latency : frame->metadata.latency_info) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 66 bool suspended) { | 69 bool suspended) { |
| 67 } | 70 } |
| 68 | 71 |
| 69 bool SoftwareBrowserCompositorOutputSurface:: | 72 bool SoftwareBrowserCompositorOutputSurface:: |
| 70 SurfaceShouldNotShowFramesAfterSuspendForRecycle() const { | 73 SurfaceShouldNotShowFramesAfterSuspendForRecycle() const { |
| 71 return false; | 74 return false; |
| 72 } | 75 } |
| 73 #endif | 76 #endif |
| 74 | 77 |
| 75 } // namespace content | 78 } // namespace content |
| OLD | NEW |