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 #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/cancelable_callback.h" | 10 #include "base/cancelable_callback.h" |
11 #include "base/macros.h" | 11 #include "base/macros.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 "ui/gfx/swap_result.h" | 14 #include "ui/gfx/swap_result.h" |
15 | 15 |
| 16 namespace display_compositor { |
| 17 class CompositorOverlayCandidateValidator; |
| 18 } |
| 19 |
16 namespace gpu { | 20 namespace gpu { |
17 class CommandBufferProxyImpl; | 21 class CommandBufferProxyImpl; |
18 } | 22 } |
19 | 23 |
20 namespace ui { | 24 namespace ui { |
21 class CompositorVSyncManager; | 25 class CompositorVSyncManager; |
22 } | 26 } |
23 | 27 |
24 namespace content { | 28 namespace content { |
25 class BrowserCompositorOverlayCandidateValidator; | |
26 class ReflectorTexture; | 29 class ReflectorTexture; |
27 | 30 |
28 // Adapts a WebGraphicsContext3DCommandBufferImpl into a | 31 // Adapts a WebGraphicsContext3DCommandBufferImpl into a |
29 // cc::OutputSurface that also handles vsync parameter updates | 32 // cc::OutputSurface that also handles vsync parameter updates |
30 // arriving from the GPU process. | 33 // arriving from the GPU process. |
31 class GpuBrowserCompositorOutputSurface | 34 class GpuBrowserCompositorOutputSurface |
32 : public BrowserCompositorOutputSurface { | 35 : public BrowserCompositorOutputSurface { |
33 public: | 36 public: |
34 GpuBrowserCompositorOutputSurface( | 37 GpuBrowserCompositorOutputSurface( |
35 const scoped_refptr<ContextProviderCommandBuffer>& context, | 38 const scoped_refptr<ContextProviderCommandBuffer>& context, |
36 const scoped_refptr<ContextProviderCommandBuffer>& worker_context, | 39 const scoped_refptr<ContextProviderCommandBuffer>& worker_context, |
37 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, | 40 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
38 base::SingleThreadTaskRunner* task_runner, | 41 base::SingleThreadTaskRunner* task_runner, |
39 std::unique_ptr<BrowserCompositorOverlayCandidateValidator> | 42 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> |
40 overlay_candidate_validator); | 43 overlay_candidate_validator); |
41 | 44 |
42 ~GpuBrowserCompositorOutputSurface() override; | 45 ~GpuBrowserCompositorOutputSurface() override; |
43 | 46 |
44 protected: | 47 protected: |
45 // BrowserCompositorOutputSurface: | 48 // BrowserCompositorOutputSurface: |
46 void OnReflectorChanged() override; | 49 void OnReflectorChanged() override; |
47 void OnGpuSwapBuffersCompleted( | 50 void OnGpuSwapBuffersCompleted( |
48 const std::vector<ui::LatencyInfo>& latency_info, | 51 const std::vector<ui::LatencyInfo>& latency_info, |
49 gfx::SwapResult result) override; | 52 gfx::SwapResult result) override; |
(...skipping 30 matching lines...) Expand all Loading... |
80 update_vsync_parameters_callback_; | 83 update_vsync_parameters_callback_; |
81 | 84 |
82 std::unique_ptr<ReflectorTexture> reflector_texture_; | 85 std::unique_ptr<ReflectorTexture> reflector_texture_; |
83 | 86 |
84 DISALLOW_COPY_AND_ASSIGN(GpuBrowserCompositorOutputSurface); | 87 DISALLOW_COPY_AND_ASSIGN(GpuBrowserCompositorOutputSurface); |
85 }; | 88 }; |
86 | 89 |
87 } // namespace content | 90 } // namespace content |
88 | 91 |
89 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 92 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
OLD | NEW |