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