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/gpu_browser_compositor_output_surface.h" | 5 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
11 #include "cc/output/output_surface_client.h" | 11 #include "cc/output/output_surface_client.h" |
12 #include "content/browser/compositor/browser_compositor_overlay_candidate_valida
tor.h" | 12 #include "content/browser/compositor/browser_compositor_overlay_candidate_valida
tor.h" |
13 #include "content/browser/compositor/reflector_impl.h" | 13 #include "content/browser/compositor/reflector_impl.h" |
14 #include "content/browser/compositor/reflector_texture.h" | 14 #include "content/browser/compositor/reflector_texture.h" |
15 #include "content/browser/renderer_host/render_widget_host_impl.h" | 15 #include "content/browser/renderer_host/render_widget_host_impl.h" |
16 #include "content/common/gpu/client/context_provider_command_buffer.h" | 16 #include "content/common/gpu/client/context_provider_command_buffer.h" |
17 #include "gpu/command_buffer/client/context_support.h" | 17 #include "gpu/command_buffer/client/context_support.h" |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 | 20 |
21 GpuBrowserCompositorOutputSurface::GpuBrowserCompositorOutputSurface( | 21 GpuBrowserCompositorOutputSurface::GpuBrowserCompositorOutputSurface( |
22 const scoped_refptr<ContextProviderCommandBuffer>& context, | 22 const scoped_refptr<ContextProviderCommandBuffer>& context, |
23 const scoped_refptr<ContextProviderCommandBuffer>& worker_context, | 23 const scoped_refptr<ContextProviderCommandBuffer>& worker_context, |
24 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, | 24 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
| 25 base::SingleThreadTaskRunner* task_runner, |
25 std::unique_ptr<BrowserCompositorOverlayCandidateValidator> | 26 std::unique_ptr<BrowserCompositorOverlayCandidateValidator> |
26 overlay_candidate_validator) | 27 overlay_candidate_validator) |
27 : BrowserCompositorOutputSurface(context, | 28 : BrowserCompositorOutputSurface(context, |
28 worker_context, | 29 worker_context, |
29 vsync_manager, | 30 vsync_manager, |
| 31 task_runner, |
30 std::move(overlay_candidate_validator)), | 32 std::move(overlay_candidate_validator)), |
31 #if defined(OS_MACOSX) | 33 #if defined(OS_MACOSX) |
32 should_show_frames_state_(SHOULD_SHOW_FRAMES), | 34 should_show_frames_state_(SHOULD_SHOW_FRAMES), |
33 #endif | 35 #endif |
34 swap_buffers_completion_callback_(base::Bind( | 36 swap_buffers_completion_callback_(base::Bind( |
35 &GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted, | 37 &GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted, |
36 base::Unretained(this))), | 38 base::Unretained(this))), |
37 update_vsync_parameters_callback_(base::Bind( | 39 update_vsync_parameters_callback_(base::Bind( |
38 &BrowserCompositorOutputSurface::OnUpdateVSyncParametersFromGpu, | 40 &BrowserCompositorOutputSurface::OnUpdateVSyncParametersFromGpu, |
39 base::Unretained(this))) { | 41 base::Unretained(this))) { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 156 |
155 bool GpuBrowserCompositorOutputSurface::SurfaceIsSuspendForRecycle() const { | 157 bool GpuBrowserCompositorOutputSurface::SurfaceIsSuspendForRecycle() const { |
156 #if defined(OS_MACOSX) | 158 #if defined(OS_MACOSX) |
157 return should_show_frames_state_ == SHOULD_NOT_SHOW_FRAMES_SUSPENDED; | 159 return should_show_frames_state_ == SHOULD_NOT_SHOW_FRAMES_SUSPENDED; |
158 #else | 160 #else |
159 return false; | 161 return false; |
160 #endif | 162 #endif |
161 } | 163 } |
162 | 164 |
163 } // namespace content | 165 } // namespace content |
OLD | NEW |