Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1998)

Side by Side Diff: content/browser/compositor/gpu_browser_compositor_output_surface.h

Issue 1962493002: Make Mac swap code like other platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> 42 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator>
43 overlay_candidate_validator); 43 overlay_candidate_validator);
44 44
45 ~GpuBrowserCompositorOutputSurface() override; 45 ~GpuBrowserCompositorOutputSurface() override;
46 46
47 protected: 47 protected:
48 // BrowserCompositorOutputSurface: 48 // BrowserCompositorOutputSurface:
49 void OnReflectorChanged() override; 49 void OnReflectorChanged() override;
50 void OnGpuSwapBuffersCompleted( 50 void OnGpuSwapBuffersCompleted(
51 const std::vector<ui::LatencyInfo>& latency_info, 51 const std::vector<ui::LatencyInfo>& latency_info,
52 gfx::SwapResult result) override; 52 gfx::SwapResult result,
53 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) override;
53 54
54 // cc::OutputSurface implementation. 55 // cc::OutputSurface implementation.
55 void SwapBuffers(cc::CompositorFrame* frame) override; 56 void SwapBuffers(cc::CompositorFrame* frame) override;
56 bool BindToClient(cc::OutputSurfaceClient* client) override; 57 bool BindToClient(cc::OutputSurfaceClient* client) override;
57 bool SurfaceIsSuspendForRecycle() const override; 58 bool SurfaceIsSuspendForRecycle() const override;
58 59
59 #if defined(OS_MACOSX) 60 #if defined(OS_MACOSX)
60 void SetSurfaceSuspendedForRecycle(bool suspended) override; 61 void SetSurfaceSuspendedForRecycle(bool suspended) override;
61 bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const override; 62 bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const override;
62 enum ShouldShowFramesState { 63 enum ShouldShowFramesState {
63 // Frames that come from the GPU process should appear on-screen. 64 // Frames that come from the GPU process should appear on-screen.
64 SHOULD_SHOW_FRAMES, 65 SHOULD_SHOW_FRAMES,
65 // The compositor has been suspended. Any frames that come from the GPU 66 // The compositor has been suspended. Any frames that come from the GPU
66 // process are for the pre-suspend content and should not be displayed. 67 // process are for the pre-suspend content and should not be displayed.
67 SHOULD_NOT_SHOW_FRAMES_SUSPENDED, 68 SHOULD_NOT_SHOW_FRAMES_SUSPENDED,
68 // The compositor has been un-suspended, but has not yet issued a swap 69 // The compositor has been un-suspended, but has not yet issued a swap
69 // since being un-suspended, so any frames that come from the GPU process 70 // since being un-suspended, so any frames that come from the GPU process
70 // are for pre-suspend content and should not be displayed. 71 // are for pre-suspend content and should not be displayed.
71 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED, 72 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED,
72 }; 73 };
73 ShouldShowFramesState should_show_frames_state_; 74 ShouldShowFramesState should_show_frames_state_;
74 #endif 75 #endif
75 76
76 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); 77 gpu::CommandBufferProxyImpl* GetCommandBufferProxy();
77 78
78 base::CancelableCallback<void(const std::vector<ui::LatencyInfo>&, 79 base::CancelableCallback<void(
79 gfx::SwapResult)> 80 const std::vector<ui::LatencyInfo>&,
81 gfx::SwapResult,
82 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac)>
80 swap_buffers_completion_callback_; 83 swap_buffers_completion_callback_;
81 base::CancelableCallback<void(base::TimeTicks timebase, 84 base::CancelableCallback<void(base::TimeTicks timebase,
82 base::TimeDelta interval)> 85 base::TimeDelta interval)>
83 update_vsync_parameters_callback_; 86 update_vsync_parameters_callback_;
84 87
85 std::unique_ptr<ReflectorTexture> reflector_texture_; 88 std::unique_ptr<ReflectorTexture> reflector_texture_;
86 89
87 DISALLOW_COPY_AND_ASSIGN(GpuBrowserCompositorOutputSurface); 90 DISALLOW_COPY_AND_ASSIGN(GpuBrowserCompositorOutputSurface);
88 }; 91 };
89 92
90 } // namespace content 93 } // namespace content
91 94
92 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ 95 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698