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

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

Issue 2626413002: Route D3D VSync signal to Compositor (Closed)
Patch Set: Limit GPU VSync to Win8+ Created 3 years, 10 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 #ifndef CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ 5 #ifndef CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
6 #define CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ 6 #define CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "build/build_config.h" 12 #include "build/build_config.h"
13 #include "content/browser/compositor/browser_compositor_output_surface.h" 13 #include "content/browser/compositor/browser_compositor_output_surface.h"
14 #include "content/browser/compositor/gpu_vsync_begin_frame_source.h"
14 #include "ui/gfx/swap_result.h" 15 #include "ui/gfx/swap_result.h"
15 16
16 namespace display_compositor { 17 namespace display_compositor {
17 class CompositorOverlayCandidateValidator; 18 class CompositorOverlayCandidateValidator;
18 } 19 }
19 20
20 namespace gpu { 21 namespace gpu {
21 class CommandBufferProxyImpl; 22 class CommandBufferProxyImpl;
22 struct GpuProcessHostedCALayerTreeParamsMac; 23 struct GpuProcessHostedCALayerTreeParamsMac;
23 } 24 }
24 25
25 namespace ui { 26 namespace ui {
26 class ContextProviderCommandBuffer; 27 class ContextProviderCommandBuffer;
27 class LatencyInfo; 28 class LatencyInfo;
28 } 29 }
29 30
30 namespace content { 31 namespace content {
31 class ReflectorTexture; 32 class ReflectorTexture;
32 33
33 // Adapts a WebGraphicsContext3DCommandBufferImpl into a 34 // Adapts a WebGraphicsContext3DCommandBufferImpl into a
34 // cc::OutputSurface that also handles vsync parameter updates 35 // cc::OutputSurface that also handles vsync parameter updates
35 // arriving from the GPU process. 36 // arriving from the GPU process.
36 class GpuBrowserCompositorOutputSurface 37 class GpuBrowserCompositorOutputSurface : public BrowserCompositorOutputSurface,
37 : public BrowserCompositorOutputSurface { 38 public GpuVSyncControl {
38 public: 39 public:
39 GpuBrowserCompositorOutputSurface( 40 GpuBrowserCompositorOutputSurface(
40 scoped_refptr<ui::ContextProviderCommandBuffer> context, 41 scoped_refptr<ui::ContextProviderCommandBuffer> context,
41 const UpdateVSyncParametersCallback& update_vsync_parameters_callback, 42 const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
42 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> 43 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator>
43 overlay_candidate_validator); 44 overlay_candidate_validator);
44 45
45 ~GpuBrowserCompositorOutputSurface() override; 46 ~GpuBrowserCompositorOutputSurface() override;
46 47
47 // Called when a swap completion is sent from the GPU process. 48 // Called when a swap completion is sent from the GPU process.
(...skipping 21 matching lines...) Expand all
69 float device_scale_factor, 70 float device_scale_factor,
70 const gfx::ColorSpace& color_space, 71 const gfx::ColorSpace& color_space,
71 bool has_alpha, 72 bool has_alpha,
72 bool use_stencil) override; 73 bool use_stencil) override;
73 void SwapBuffers(cc::OutputSurfaceFrame frame) override; 74 void SwapBuffers(cc::OutputSurfaceFrame frame) override;
74 uint32_t GetFramebufferCopyTextureFormat() override; 75 uint32_t GetFramebufferCopyTextureFormat() override;
75 bool IsDisplayedAsOverlayPlane() const override; 76 bool IsDisplayedAsOverlayPlane() const override;
76 unsigned GetOverlayTextureId() const override; 77 unsigned GetOverlayTextureId() const override;
77 bool SurfaceIsSuspendForRecycle() const override; 78 bool SurfaceIsSuspendForRecycle() const override;
78 79
80 // GpuVSyncControl
danakj 2017/02/16 15:56:02 Comments are sentences. "GpuVSyncControl implement
stanisc 2017/02/16 21:43:18 Done.
81 void SetNeedsVSync(bool needs_vsync) override;
82
79 protected: 83 protected:
80 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); 84 gpu::CommandBufferProxyImpl* GetCommandBufferProxy();
81 85
82 cc::OutputSurfaceClient* client_ = nullptr; 86 cc::OutputSurfaceClient* client_ = nullptr;
83 std::unique_ptr<ReflectorTexture> reflector_texture_; 87 std::unique_ptr<ReflectorTexture> reflector_texture_;
84 base::WeakPtrFactory<GpuBrowserCompositorOutputSurface> weak_ptr_factory_; 88 base::WeakPtrFactory<GpuBrowserCompositorOutputSurface> weak_ptr_factory_;
85 89
86 private: 90 private:
87 DISALLOW_COPY_AND_ASSIGN(GpuBrowserCompositorOutputSurface); 91 DISALLOW_COPY_AND_ASSIGN(GpuBrowserCompositorOutputSurface);
88 }; 92 };
89 93
90 } // namespace content 94 } // namespace content
91 95
92 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ 96 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698