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/output_surface_client.h" | 10 #include "cc/output/output_surface_client.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 capabilities_.flipped_output_surface = | 33 capabilities_.flipped_output_surface = |
34 context_provider()->ContextCapabilities().flips_vertically; | 34 context_provider()->ContextCapabilities().flips_vertically; |
35 } | 35 } |
36 } | 36 } |
37 | 37 |
38 GpuBrowserCompositorOutputSurface::~GpuBrowserCompositorOutputSurface() { | 38 GpuBrowserCompositorOutputSurface::~GpuBrowserCompositorOutputSurface() { |
39 GetCommandBufferProxy()->SetUpdateVSyncParametersCallback( | 39 GetCommandBufferProxy()->SetUpdateVSyncParametersCallback( |
40 UpdateVSyncParametersCallback()); | 40 UpdateVSyncParametersCallback()); |
41 } | 41 } |
42 | 42 |
| 43 GpuVSyncControl* GpuBrowserCompositorOutputSurface::GetVSyncControl() { |
| 44 #if defined(OS_WIN) |
| 45 return this; |
| 46 #else |
| 47 return nullptr; |
| 48 #endif // defined(OS_WIN) |
| 49 } |
| 50 |
| 51 void GpuBrowserCompositorOutputSurface::EnableVSync(bool enabled) { |
| 52 #if defined(OS_WIN) |
| 53 GetCommandBufferProxy()->EnableVSync(enabled); |
| 54 #else |
| 55 NOTREACHED(); |
| 56 #endif // defined(OS_WIN) |
| 57 } |
| 58 |
43 void GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( | 59 void GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( |
44 const std::vector<ui::LatencyInfo>& latency_info, | 60 const std::vector<ui::LatencyInfo>& latency_info, |
45 gfx::SwapResult result, | 61 gfx::SwapResult result, |
46 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) { | 62 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) { |
47 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); | 63 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); |
48 client_->DidReceiveSwapBuffersAck(); | 64 client_->DidReceiveSwapBuffersAck(); |
49 } | 65 } |
50 | 66 |
51 void GpuBrowserCompositorOutputSurface::OnReflectorChanged() { | 67 void GpuBrowserCompositorOutputSurface::OnReflectorChanged() { |
52 if (!reflector_) { | 68 if (!reflector_) { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() { | 153 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() { |
138 ui::ContextProviderCommandBuffer* provider_command_buffer = | 154 ui::ContextProviderCommandBuffer* provider_command_buffer = |
139 static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get()); | 155 static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get()); |
140 gpu::CommandBufferProxyImpl* command_buffer_proxy = | 156 gpu::CommandBufferProxyImpl* command_buffer_proxy = |
141 provider_command_buffer->GetCommandBufferProxy(); | 157 provider_command_buffer->GetCommandBufferProxy(); |
142 DCHECK(command_buffer_proxy); | 158 DCHECK(command_buffer_proxy); |
143 return command_buffer_proxy; | 159 return command_buffer_proxy; |
144 } | 160 } |
145 | 161 |
146 } // namespace content | 162 } // namespace content |
OLD | NEW |