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

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

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 #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 bool support_stencil); 45 bool support_stencil);
45 46
46 ~GpuBrowserCompositorOutputSurface() override; 47 ~GpuBrowserCompositorOutputSurface() override;
47 48
(...skipping 22 matching lines...) Expand all
70 float device_scale_factor, 71 float device_scale_factor,
71 const gfx::ColorSpace& color_space, 72 const gfx::ColorSpace& color_space,
72 bool has_alpha, 73 bool has_alpha,
73 bool use_stencil) override; 74 bool use_stencil) override;
74 void SwapBuffers(cc::OutputSurfaceFrame frame) override; 75 void SwapBuffers(cc::OutputSurfaceFrame frame) override;
75 uint32_t GetFramebufferCopyTextureFormat() override; 76 uint32_t GetFramebufferCopyTextureFormat() override;
76 bool IsDisplayedAsOverlayPlane() const override; 77 bool IsDisplayedAsOverlayPlane() const override;
77 unsigned GetOverlayTextureId() const override; 78 unsigned GetOverlayTextureId() const override;
78 bool SurfaceIsSuspendForRecycle() const override; 79 bool SurfaceIsSuspendForRecycle() const override;
79 80
81 // GpuVSyncControl
82 void SetNeedsVSync(bool needs_vsync) override;
83
80 protected: 84 protected:
81 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); 85 gpu::CommandBufferProxyImpl* GetCommandBufferProxy();
82 86
83 cc::OutputSurfaceClient* client_ = nullptr; 87 cc::OutputSurfaceClient* client_ = nullptr;
84 std::unique_ptr<ReflectorTexture> reflector_texture_; 88 std::unique_ptr<ReflectorTexture> reflector_texture_;
85 base::WeakPtrFactory<GpuBrowserCompositorOutputSurface> weak_ptr_factory_; 89 base::WeakPtrFactory<GpuBrowserCompositorOutputSurface> weak_ptr_factory_;
86 90
87 private: 91 private:
88 DISALLOW_COPY_AND_ASSIGN(GpuBrowserCompositorOutputSurface); 92 DISALLOW_COPY_AND_ASSIGN(GpuBrowserCompositorOutputSurface);
89 }; 93 };
90 94
91 } // namespace content 95 } // namespace content
92 96
93 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ 97 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698