| 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" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 ~GpuBrowserCompositorOutputSurface() override; | 44 ~GpuBrowserCompositorOutputSurface() override; |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 // BrowserCompositorOutputSurface: | 47 // BrowserCompositorOutputSurface: |
| 48 void OnReflectorChanged() override; | 48 void OnReflectorChanged() override; |
| 49 void OnGpuSwapBuffersCompleted( | 49 void OnGpuSwapBuffersCompleted( |
| 50 const std::vector<ui::LatencyInfo>& latency_info, | 50 const std::vector<ui::LatencyInfo>& latency_info, |
| 51 gfx::SwapResult result, | 51 gfx::SwapResult result, |
| 52 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) override; | 52 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) override; |
| 53 #if defined(OS_MACOSX) |
| 54 void SetSurfaceSuspendedForRecycle(bool suspended) override; |
| 55 #endif |
| 53 | 56 |
| 54 // cc::OutputSurface implementation. | 57 // cc::OutputSurface implementation. |
| 55 void SwapBuffers(cc::CompositorFrame* frame) override; | 58 void SwapBuffers(cc::CompositorFrame* frame) override; |
| 56 bool BindToClient(cc::OutputSurfaceClient* client) override; | 59 bool BindToClient(cc::OutputSurfaceClient* client) override; |
| 57 bool SurfaceIsSuspendForRecycle() const override; | |
| 58 | |
| 59 #if defined(OS_MACOSX) | |
| 60 void SetSurfaceSuspendedForRecycle(bool suspended) override; | |
| 61 enum ShouldShowFramesState { | |
| 62 // Frames that come from the GPU process should appear on-screen. | |
| 63 SHOULD_SHOW_FRAMES, | |
| 64 // The compositor has been suspended. Any frames that come from the GPU | |
| 65 // process are for the pre-suspend content and should not be displayed. | |
| 66 SHOULD_NOT_SHOW_FRAMES_SUSPENDED, | |
| 67 // The compositor has been un-suspended, but has not yet issued a swap | |
| 68 // since being un-suspended, so any frames that come from the GPU process | |
| 69 // are for pre-suspend content and should not be displayed. | |
| 70 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED, | |
| 71 }; | |
| 72 ShouldShowFramesState should_show_frames_state_; | |
| 73 #endif | |
| 74 | |
| 75 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); | 60 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); |
| 76 | 61 |
| 77 base::CancelableCallback<void( | 62 base::CancelableCallback<void( |
| 78 const std::vector<ui::LatencyInfo>&, | 63 const std::vector<ui::LatencyInfo>&, |
| 79 gfx::SwapResult, | 64 gfx::SwapResult, |
| 80 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac)> | 65 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac)> |
| 81 swap_buffers_completion_callback_; | 66 swap_buffers_completion_callback_; |
| 82 base::CancelableCallback<void(base::TimeTicks timebase, | 67 base::CancelableCallback<void(base::TimeTicks timebase, |
| 83 base::TimeDelta interval)> | 68 base::TimeDelta interval)> |
| 84 update_vsync_parameters_callback_; | 69 update_vsync_parameters_callback_; |
| 85 | 70 |
| 86 std::unique_ptr<ReflectorTexture> reflector_texture_; | 71 std::unique_ptr<ReflectorTexture> reflector_texture_; |
| 87 | 72 |
| 88 DISALLOW_COPY_AND_ASSIGN(GpuBrowserCompositorOutputSurface); | 73 DISALLOW_COPY_AND_ASSIGN(GpuBrowserCompositorOutputSurface); |
| 89 }; | 74 }; |
| 90 | 75 |
| 91 } // namespace content | 76 } // namespace content |
| 92 | 77 |
| 93 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 78 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
| OLD | NEW |