Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: content/browser/compositor/gpu_browser_compositor_output_surface.cc

Issue 2626413002: Route D3D VSync signal to Compositor (Closed)
Patch Set: Addressed CR feedback Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 26 matching lines...) Expand all
37 // TODO(reveman): Check context as there's no guarantee we support this 37 // TODO(reveman): Check context as there's no guarantee we support this
38 // even if we request it. 38 // even if we request it.
39 capabilities_.supports_stencil = support_stencil; 39 capabilities_.supports_stencil = support_stencil;
40 } 40 }
41 41
42 GpuBrowserCompositorOutputSurface::~GpuBrowserCompositorOutputSurface() { 42 GpuBrowserCompositorOutputSurface::~GpuBrowserCompositorOutputSurface() {
43 GetCommandBufferProxy()->SetUpdateVSyncParametersCallback( 43 GetCommandBufferProxy()->SetUpdateVSyncParametersCallback(
44 UpdateVSyncParametersCallback()); 44 UpdateVSyncParametersCallback());
45 } 45 }
46 46
47 void GpuBrowserCompositorOutputSurface::SetNeedsVSync(bool needs_vsync) {
enne (OOO) 2017/01/24 21:32:07 I still think this is a little bit confusing of a
stanisc 2017/01/24 22:22:40 When D3D VSync feature is enabled that fully repla
48 #if defined(OS_WIN)
49 GetCommandBufferProxy()->SetNeedsVSync(needs_vsync);
50 #else
51 NOTREACHED();
52 #endif // defined(OS_WIN)
53 }
54
47 void GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( 55 void GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted(
48 const std::vector<ui::LatencyInfo>& latency_info, 56 const std::vector<ui::LatencyInfo>& latency_info,
49 gfx::SwapResult result, 57 gfx::SwapResult result,
50 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) { 58 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) {
51 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); 59 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info);
52 client_->DidReceiveSwapBuffersAck(); 60 client_->DidReceiveSwapBuffersAck();
53 } 61 }
54 62
55 void GpuBrowserCompositorOutputSurface::OnReflectorChanged() { 63 void GpuBrowserCompositorOutputSurface::OnReflectorChanged() {
56 if (!reflector_) { 64 if (!reflector_) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() { 150 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() {
143 ui::ContextProviderCommandBuffer* provider_command_buffer = 151 ui::ContextProviderCommandBuffer* provider_command_buffer =
144 static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get()); 152 static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get());
145 gpu::CommandBufferProxyImpl* command_buffer_proxy = 153 gpu::CommandBufferProxyImpl* command_buffer_proxy =
146 provider_command_buffer->GetCommandBufferProxy(); 154 provider_command_buffer->GetCommandBufferProxy();
147 DCHECK(command_buffer_proxy); 155 DCHECK(command_buffer_proxy);
148 return command_buffer_proxy; 156 return command_buffer_proxy;
149 } 157 }
150 158
151 } // namespace content 159 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698