| 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 |
| 45 void GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( | 53 void GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( |
| 46 const std::vector<ui::LatencyInfo>& latency_info, | 54 const std::vector<ui::LatencyInfo>& latency_info, |
| 47 gfx::SwapResult result, | 55 gfx::SwapResult result, |
| 48 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) { | 56 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) { |
| 49 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); | 57 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); |
| 50 client_->DidReceiveSwapBuffersAck(); | 58 client_->DidReceiveSwapBuffersAck(); |
| 51 } | 59 } |
| 52 | 60 |
| 53 void GpuBrowserCompositorOutputSurface::OnReflectorChanged() { | 61 void GpuBrowserCompositorOutputSurface::OnReflectorChanged() { |
| 54 if (!reflector_) { | 62 if (!reflector_) { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() { | 148 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() { |
| 141 ui::ContextProviderCommandBuffer* provider_command_buffer = | 149 ui::ContextProviderCommandBuffer* provider_command_buffer = |
| 142 static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get()); | 150 static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get()); |
| 143 gpu::CommandBufferProxyImpl* command_buffer_proxy = | 151 gpu::CommandBufferProxyImpl* command_buffer_proxy = |
| 144 provider_command_buffer->GetCommandBufferProxy(); | 152 provider_command_buffer->GetCommandBufferProxy(); |
| 145 DCHECK(command_buffer_proxy); | 153 DCHECK(command_buffer_proxy); |
| 146 return command_buffer_proxy; | 154 return command_buffer_proxy; |
| 147 } | 155 } |
| 148 | 156 |
| 149 } // namespace content | 157 } // namespace content |
| OLD | NEW |