| 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 24 matching lines...) Expand all Loading... |
| 35 } | 35 } |
| 36 capabilities_.supports_stencil = | 36 capabilities_.supports_stencil = |
| 37 context_provider()->ContextCapabilities().num_stencil_bits > 0; | 37 context_provider()->ContextCapabilities().num_stencil_bits > 0; |
| 38 } | 38 } |
| 39 | 39 |
| 40 GpuBrowserCompositorOutputSurface::~GpuBrowserCompositorOutputSurface() { | 40 GpuBrowserCompositorOutputSurface::~GpuBrowserCompositorOutputSurface() { |
| 41 GetCommandBufferProxy()->SetUpdateVSyncParametersCallback( | 41 GetCommandBufferProxy()->SetUpdateVSyncParametersCallback( |
| 42 UpdateVSyncParametersCallback()); | 42 UpdateVSyncParametersCallback()); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void GpuBrowserCompositorOutputSurface::SetNeedsVSync(bool needs_vsync) { | |
| 46 #if defined(OS_WIN) | |
| 47 GetCommandBufferProxy()->SetNeedsVSync(needs_vsync); | |
| 48 #else | |
| 49 NOTREACHED(); | |
| 50 #endif // defined(OS_WIN) | |
| 51 } | |
| 52 | |
| 53 void GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( | 45 void GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( |
| 54 const std::vector<ui::LatencyInfo>& latency_info, | 46 const std::vector<ui::LatencyInfo>& latency_info, |
| 55 gfx::SwapResult result, | 47 gfx::SwapResult result, |
| 56 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) { | 48 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) { |
| 57 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); | 49 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); |
| 58 client_->DidReceiveSwapBuffersAck(); | 50 client_->DidReceiveSwapBuffersAck(); |
| 59 } | 51 } |
| 60 | 52 |
| 61 void GpuBrowserCompositorOutputSurface::OnReflectorChanged() { | 53 void GpuBrowserCompositorOutputSurface::OnReflectorChanged() { |
| 62 if (!reflector_) { | 54 if (!reflector_) { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() { | 161 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() { |
| 170 ui::ContextProviderCommandBuffer* provider_command_buffer = | 162 ui::ContextProviderCommandBuffer* provider_command_buffer = |
| 171 static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get()); | 163 static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get()); |
| 172 gpu::CommandBufferProxyImpl* command_buffer_proxy = | 164 gpu::CommandBufferProxyImpl* command_buffer_proxy = |
| 173 provider_command_buffer->GetCommandBufferProxy(); | 165 provider_command_buffer->GetCommandBufferProxy(); |
| 174 DCHECK(command_buffer_proxy); | 166 DCHECK(command_buffer_proxy); |
| 175 return command_buffer_proxy; | 167 return command_buffer_proxy; |
| 176 } | 168 } |
| 177 | 169 |
| 178 } // namespace content | 170 } // namespace content |
| OLD | NEW |