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