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