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 #include "ui/gfx/swap_result.h" | 10 #include "ui/gfx/swap_result.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 const scoped_refptr<ContextProviderCommandBuffer>& worker_context, | 29 const scoped_refptr<ContextProviderCommandBuffer>& worker_context, |
30 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, | 30 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
31 scoped_ptr<BrowserCompositorOverlayCandidateValidator> | 31 scoped_ptr<BrowserCompositorOverlayCandidateValidator> |
32 overlay_candidate_validator); | 32 overlay_candidate_validator); |
33 | 33 |
34 ~GpuBrowserCompositorOutputSurface() override; | 34 ~GpuBrowserCompositorOutputSurface() override; |
35 | 35 |
36 protected: | 36 protected: |
37 // BrowserCompositorOutputSurface: | 37 // BrowserCompositorOutputSurface: |
38 void OnReflectorChanged() override; | 38 void OnReflectorChanged() override; |
| 39 void OnGpuSwapBuffersCompleted( |
| 40 const std::vector<ui::LatencyInfo>& latency_info, |
| 41 gfx::SwapResult result) override; |
39 | 42 |
40 // cc::OutputSurface implementation. | 43 // cc::OutputSurface implementation. |
41 void SwapBuffers(cc::CompositorFrame* frame) override; | 44 void SwapBuffers(cc::CompositorFrame* frame) override; |
42 bool BindToClient(cc::OutputSurfaceClient* client) override; | 45 bool BindToClient(cc::OutputSurfaceClient* client) override; |
43 bool SurfaceIsSuspendForRecycle() const override; | 46 bool SurfaceIsSuspendForRecycle() const override; |
44 | 47 |
45 #if defined(OS_MACOSX) | 48 #if defined(OS_MACOSX) |
46 void OnSurfaceDisplayed() override; | |
47 void SetSurfaceSuspendedForRecycle(bool suspended) override; | 49 void SetSurfaceSuspendedForRecycle(bool suspended) override; |
48 bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const override; | 50 bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const override; |
49 enum ShouldShowFramesState { | 51 enum ShouldShowFramesState { |
50 // Frames that come from the GPU process should appear on-screen. | 52 // Frames that come from the GPU process should appear on-screen. |
51 SHOULD_SHOW_FRAMES, | 53 SHOULD_SHOW_FRAMES, |
52 // The compositor has been suspended. Any frames that come from the GPU | 54 // The compositor has been suspended. Any frames that come from the GPU |
53 // process are for the pre-suspend content and should not be displayed. | 55 // process are for the pre-suspend content and should not be displayed. |
54 SHOULD_NOT_SHOW_FRAMES_SUSPENDED, | 56 SHOULD_NOT_SHOW_FRAMES_SUSPENDED, |
55 // The compositor has been un-suspended, but has not yet issued a swap | 57 // The compositor has been un-suspended, but has not yet issued a swap |
56 // since being un-suspended, so any frames that come from the GPU process | 58 // since being un-suspended, so any frames that come from the GPU process |
57 // are for pre-suspend content and should not be displayed. | 59 // are for pre-suspend content and should not be displayed. |
58 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED, | 60 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED, |
59 }; | 61 }; |
60 ShouldShowFramesState should_show_frames_state_; | 62 ShouldShowFramesState should_show_frames_state_; |
61 #endif | 63 #endif |
62 | 64 |
63 CommandBufferProxyImpl* GetCommandBufferProxy(); | 65 CommandBufferProxyImpl* GetCommandBufferProxy(); |
64 virtual void OnSwapBuffersCompleted( | |
65 const std::vector<ui::LatencyInfo>& latency_info, | |
66 gfx::SwapResult result); | |
67 | 66 |
68 base::CancelableCallback<void(const std::vector<ui::LatencyInfo>&, | 67 base::CancelableCallback<void(const std::vector<ui::LatencyInfo>&, |
69 gfx::SwapResult)> | 68 gfx::SwapResult)> |
70 swap_buffers_completion_callback_; | 69 swap_buffers_completion_callback_; |
71 base::CancelableCallback<void(base::TimeTicks timebase, | 70 base::CancelableCallback<void(base::TimeTicks timebase, |
72 base::TimeDelta interval)> | 71 base::TimeDelta interval)> |
73 update_vsync_parameters_callback_; | 72 update_vsync_parameters_callback_; |
74 | 73 |
75 scoped_ptr<ReflectorTexture> reflector_texture_; | 74 scoped_ptr<ReflectorTexture> reflector_texture_; |
76 | 75 |
77 DISALLOW_COPY_AND_ASSIGN(GpuBrowserCompositorOutputSurface); | 76 DISALLOW_COPY_AND_ASSIGN(GpuBrowserCompositorOutputSurface); |
78 }; | 77 }; |
79 | 78 |
80 } // namespace content | 79 } // namespace content |
81 | 80 |
82 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 81 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
OLD | NEW |