| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_OUTPUT_SURFACE_MAC_H_ | 5 #ifndef CONTENT_BROWSER_COMPOSITOR_GPU_OUTPUT_SURFACE_MAC_H_ |
| 6 #define CONTENT_BROWSER_COMPOSITOR_GPU_OUTPUT_SURFACE_MAC_H_ | 6 #define CONTENT_BROWSER_COMPOSITOR_GPU_OUTPUT_SURFACE_MAC_H_ |
| 7 | 7 |
| 8 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s
urface.h" | 8 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s
urface.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 bool SurfaceIsSuspendForRecycle() const override; | 27 bool SurfaceIsSuspendForRecycle() const override; |
| 28 | 28 |
| 29 // BrowserCompositorOutputSurface implementation. | 29 // BrowserCompositorOutputSurface implementation. |
| 30 void OnGpuSwapBuffersCompleted( | 30 void OnGpuSwapBuffersCompleted( |
| 31 const std::vector<ui::LatencyInfo>& latency_info, | 31 const std::vector<ui::LatencyInfo>& latency_info, |
| 32 gfx::SwapResult result, | 32 gfx::SwapResult result, |
| 33 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) override; | 33 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) override; |
| 34 void SetSurfaceSuspendedForRecycle(bool suspended) override; | 34 void SetSurfaceSuspendedForRecycle(bool suspended) override; |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 // Store remote layers in a separate structure, so that non-Objective-C files |
| 38 // may include this header. |
| 39 struct RemoteLayers; |
| 40 std::unique_ptr<RemoteLayers> remote_layers_; |
| 41 |
| 37 enum ShouldShowFramesState { | 42 enum ShouldShowFramesState { |
| 38 // Frames that come from the GPU process should appear on-screen. | 43 // Frames that come from the GPU process should appear on-screen. |
| 39 SHOULD_SHOW_FRAMES, | 44 SHOULD_SHOW_FRAMES, |
| 40 // The compositor has been suspended. Any frames that come from the GPU | 45 // The compositor has been suspended. Any frames that come from the GPU |
| 41 // process are for the pre-suspend content and should not be displayed. | 46 // process are for the pre-suspend content and should not be displayed. |
| 42 SHOULD_NOT_SHOW_FRAMES_SUSPENDED, | 47 SHOULD_NOT_SHOW_FRAMES_SUSPENDED, |
| 43 // The compositor has been un-suspended, but has not yet issued a swap | 48 // The compositor has been un-suspended, but has not yet issued a swap |
| 44 // since being un-suspended, so any frames that come from the GPU process | 49 // since being un-suspended, so any frames that come from the GPU process |
| 45 // are for pre-suspend content and should not be displayed. | 50 // are for pre-suspend content and should not be displayed. |
| 46 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED, | 51 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED, |
| 47 }; | 52 }; |
| 48 ShouldShowFramesState should_show_frames_state_ = SHOULD_SHOW_FRAMES; | 53 ShouldShowFramesState should_show_frames_state_ = SHOULD_SHOW_FRAMES; |
| 49 | 54 |
| 50 DISALLOW_COPY_AND_ASSIGN(GpuOutputSurfaceMac); | 55 DISALLOW_COPY_AND_ASSIGN(GpuOutputSurfaceMac); |
| 51 }; | 56 }; |
| 52 | 57 |
| 53 } // namespace content | 58 } // namespace content |
| 54 | 59 |
| 55 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_OUTPUT_SURFACE_MAC_H_ | 60 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_OUTPUT_SURFACE_MAC_H_ |
| OLD | NEW |