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 "base/cancelable_callback.h" | 8 #include "base/cancelable_callback.h" |
9 #include "content/browser/compositor/browser_compositor_output_surface.h" | 9 #include "content/browser/compositor/browser_compositor_output_surface.h" |
10 | 10 |
11 namespace ui { | 11 namespace ui { |
12 class CompositorVSyncManager; | 12 class CompositorVSyncManager; |
13 } | 13 } |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 class CommandBufferProxyImpl; | 16 class CommandBufferProxyImpl; |
17 class BrowserCompositorOverlayCandidateValidator; | 17 class BrowserCompositorOverlayCandidateValidator; |
| 18 class ReflectorTexture; |
18 | 19 |
19 // Adapts a WebGraphicsContext3DCommandBufferImpl into a | 20 // Adapts a WebGraphicsContext3DCommandBufferImpl into a |
20 // cc::OutputSurface that also handles vsync parameter updates | 21 // cc::OutputSurface that also handles vsync parameter updates |
21 // arriving from the GPU process. | 22 // arriving from the GPU process. |
22 class GpuBrowserCompositorOutputSurface | 23 class GpuBrowserCompositorOutputSurface |
23 : public BrowserCompositorOutputSurface { | 24 : public BrowserCompositorOutputSurface { |
24 public: | 25 public: |
25 GpuBrowserCompositorOutputSurface( | 26 GpuBrowserCompositorOutputSurface( |
26 const scoped_refptr<ContextProviderCommandBuffer>& context, | 27 const scoped_refptr<ContextProviderCommandBuffer>& context, |
27 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, | 28 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
28 scoped_ptr<BrowserCompositorOverlayCandidateValidator> | 29 scoped_ptr<BrowserCompositorOverlayCandidateValidator> |
29 overlay_candidate_validator); | 30 overlay_candidate_validator); |
30 | 31 |
31 ~GpuBrowserCompositorOutputSurface() override; | 32 ~GpuBrowserCompositorOutputSurface() override; |
32 | 33 |
33 protected: | 34 protected: |
| 35 // BrowserCompositorOutputSurface: |
| 36 void OnReflectorChanged() override; |
| 37 |
34 // cc::OutputSurface implementation. | 38 // cc::OutputSurface implementation. |
35 void SwapBuffers(cc::CompositorFrame* frame) override; | 39 void SwapBuffers(cc::CompositorFrame* frame) override; |
36 bool BindToClient(cc::OutputSurfaceClient* client) override; | 40 bool BindToClient(cc::OutputSurfaceClient* client) override; |
37 | 41 |
38 #if defined(OS_MACOSX) | 42 #if defined(OS_MACOSX) |
39 void OnSurfaceDisplayed() override; | 43 void OnSurfaceDisplayed() override; |
40 void SetSurfaceSuspendedForRecycle(bool suspended) override; | 44 void SetSurfaceSuspendedForRecycle(bool suspended) override; |
41 bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const override; | 45 bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const override; |
42 enum ShouldShowFramesState { | 46 enum ShouldShowFramesState { |
43 // Frames that come from the GPU process should appear on-screen. | 47 // Frames that come from the GPU process should appear on-screen. |
(...skipping 11 matching lines...) Expand all Loading... |
55 | 59 |
56 CommandBufferProxyImpl* GetCommandBufferProxy(); | 60 CommandBufferProxyImpl* GetCommandBufferProxy(); |
57 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info); | 61 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info); |
58 | 62 |
59 base::CancelableCallback<void(const std::vector<ui::LatencyInfo>&)> | 63 base::CancelableCallback<void(const std::vector<ui::LatencyInfo>&)> |
60 swap_buffers_completion_callback_; | 64 swap_buffers_completion_callback_; |
61 base::CancelableCallback<void(base::TimeTicks timebase, | 65 base::CancelableCallback<void(base::TimeTicks timebase, |
62 base::TimeDelta interval)> | 66 base::TimeDelta interval)> |
63 update_vsync_parameters_callback_; | 67 update_vsync_parameters_callback_; |
64 | 68 |
| 69 scoped_ptr<ReflectorTexture> reflector_texture_; |
| 70 |
65 DISALLOW_COPY_AND_ASSIGN(GpuBrowserCompositorOutputSurface); | 71 DISALLOW_COPY_AND_ASSIGN(GpuBrowserCompositorOutputSurface); |
66 }; | 72 }; |
67 | 73 |
68 } // namespace content | 74 } // namespace content |
69 | 75 |
70 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 76 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
OLD | NEW |