| 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 "components/display_compositor/compositor_overlay_candidate_validator.h
" | 12 #include "components/display_compositor/compositor_overlay_candidate_validator.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 #include "gpu/ipc/client/command_buffer_proxy_impl.h" | 18 #include "gpu/ipc/client/command_buffer_proxy_impl.h" |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 | 21 |
| 22 GpuBrowserCompositorOutputSurface::GpuBrowserCompositorOutputSurface( | 22 GpuBrowserCompositorOutputSurface::GpuBrowserCompositorOutputSurface( |
| 23 scoped_refptr<ContextProviderCommandBuffer> context, | 23 scoped_refptr<ContextProviderCommandBuffer> context, |
| 24 scoped_refptr<ui::CompositorVSyncManager> vsync_manager, | 24 scoped_refptr<ui::CompositorVSyncManager> vsync_manager, |
| 25 base::SingleThreadTaskRunner* task_runner, | 25 cc::SyntheticBeginFrameSource* begin_frame_source, |
| 26 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> | 26 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> |
| 27 overlay_candidate_validator) | 27 overlay_candidate_validator) |
| 28 : BrowserCompositorOutputSurface(std::move(context), | 28 : BrowserCompositorOutputSurface(std::move(context), |
| 29 std::move(vsync_manager), | 29 std::move(vsync_manager), |
| 30 task_runner, | 30 begin_frame_source, |
| 31 std::move(overlay_candidate_validator)), | 31 std::move(overlay_candidate_validator)), |
| 32 swap_buffers_completion_callback_(base::Bind( | 32 swap_buffers_completion_callback_(base::Bind( |
| 33 &GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted, | 33 &GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted, |
| 34 base::Unretained(this))), | 34 base::Unretained(this))), |
| 35 update_vsync_parameters_callback_(base::Bind( | 35 update_vsync_parameters_callback_(base::Bind( |
| 36 &BrowserCompositorOutputSurface::OnUpdateVSyncParametersFromGpu, | 36 &BrowserCompositorOutputSurface::OnUpdateVSyncParametersFromGpu, |
| 37 base::Unretained(this))) { | 37 base::Unretained(this))) {} |
| 38 } | |
| 39 | 38 |
| 40 GpuBrowserCompositorOutputSurface::~GpuBrowserCompositorOutputSurface() {} | 39 GpuBrowserCompositorOutputSurface::~GpuBrowserCompositorOutputSurface() {} |
| 41 | 40 |
| 42 gpu::CommandBufferProxyImpl* | 41 gpu::CommandBufferProxyImpl* |
| 43 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() { | 42 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() { |
| 44 ContextProviderCommandBuffer* provider_command_buffer = | 43 ContextProviderCommandBuffer* provider_command_buffer = |
| 45 static_cast<content::ContextProviderCommandBuffer*>( | 44 static_cast<content::ContextProviderCommandBuffer*>( |
| 46 context_provider_.get()); | 45 context_provider_.get()); |
| 47 gpu::CommandBufferProxyImpl* command_buffer_proxy = | 46 gpu::CommandBufferProxyImpl* command_buffer_proxy = |
| 48 provider_command_buffer->GetCommandBufferProxy(); | 47 provider_command_buffer->GetCommandBufferProxy(); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); | 110 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); |
| 112 OnSwapBuffersComplete(); | 111 OnSwapBuffersComplete(); |
| 113 } | 112 } |
| 114 | 113 |
| 115 #if defined(OS_MACOSX) | 114 #if defined(OS_MACOSX) |
| 116 void GpuBrowserCompositorOutputSurface::SetSurfaceSuspendedForRecycle( | 115 void GpuBrowserCompositorOutputSurface::SetSurfaceSuspendedForRecycle( |
| 117 bool suspended) {} | 116 bool suspended) {} |
| 118 #endif | 117 #endif |
| 119 | 118 |
| 120 } // namespace content | 119 } // namespace content |
| OLD | NEW |