OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_DELEGATE_H_ | 5 #ifndef CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_DELEGATE_H_ |
6 #define CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_DELEGATE_H_ | 6 #define CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_DELEGATE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 // Notifies that the draw commands for a committed frame have been issued. | 50 // Notifies that the draw commands for a committed frame have been issued. |
51 virtual void DidCommitAndDrawCompositorFrame() = 0; | 51 virtual void DidCommitAndDrawCompositorFrame() = 0; |
52 | 52 |
53 // Notifies about a compositor frame commit operation having finished. | 53 // Notifies about a compositor frame commit operation having finished. |
54 virtual void DidCommitCompositorFrame() = 0; | 54 virtual void DidCommitCompositorFrame() = 0; |
55 | 55 |
56 // Called by the compositor when page scale animation completed. | 56 // Called by the compositor when page scale animation completed. |
57 virtual void DidCompletePageScaleAnimation() = 0; | 57 virtual void DidCompletePageScaleAnimation() = 0; |
58 | 58 |
59 // Notifies that the compositor has posted a swapbuffers operation to the GPU | 59 // Notifies that the last submitted CompositorFrame has been processed and |
60 // process. | 60 // will be displayed. |
61 virtual void DidCompleteSwapBuffers() = 0; | 61 virtual void DidReceiveCompositorFrameAck() = 0; |
62 | 62 |
63 // Called by the compositor to forward a proto that represents serialized | 63 // Called by the compositor to forward a proto that represents serialized |
64 // compositor state. | 64 // compositor state. |
65 virtual void ForwardCompositorProto(const std::vector<uint8_t>& proto) = 0; | 65 virtual void ForwardCompositorProto(const std::vector<uint8_t>& proto) = 0; |
66 | 66 |
67 // Indicates whether the RenderWidgetCompositor is about to close. | 67 // Indicates whether the RenderWidgetCompositor is about to close. |
68 virtual bool IsClosing() const = 0; | 68 virtual bool IsClosing() const = 0; |
69 | 69 |
70 // Called by the compositor in single-threaded mode when a swap is aborted. | |
71 virtual void OnSwapBuffersAborted() = 0; | |
72 | |
73 // Called by the compositor in single-threaded mode when a swap completes. | |
74 virtual void OnSwapBuffersComplete() = 0; | |
75 | |
76 // Called by the compositor in single-threaded mode when a swap is posted. | |
77 virtual void OnSwapBuffersPosted() = 0; | |
78 | |
79 // Requests that the client schedule a composite now, and calculate | 70 // Requests that the client schedule a composite now, and calculate |
80 // appropriate delay for potential future frame. | 71 // appropriate delay for potential future frame. |
81 virtual void RequestScheduleAnimation() = 0; | 72 virtual void RequestScheduleAnimation() = 0; |
82 | 73 |
83 // Requests a visual frame-based update to the state of the delegate if there | 74 // Requests a visual frame-based update to the state of the delegate if there |
84 // an update available. | 75 // an update available. |
85 virtual void UpdateVisualState() = 0; | 76 virtual void UpdateVisualState() = 0; |
86 | 77 |
87 // Indicates that the compositor is about to begin a frame. This is primarily | 78 // Indicates that the compositor is about to begin a frame. This is primarily |
88 // to signal to flow control mechanisms that a frame is beginning, not to | 79 // to signal to flow control mechanisms that a frame is beginning, not to |
89 // perform actual painting work. | 80 // perform actual painting work. |
90 virtual void WillBeginCompositorFrame() = 0; | 81 virtual void WillBeginCompositorFrame() = 0; |
91 | 82 |
92 // For use in layout test mode only, attempts to copy the full content of the | 83 // For use in layout test mode only, attempts to copy the full content of the |
93 // compositor. | 84 // compositor. |
94 virtual std::unique_ptr<cc::SwapPromise> RequestCopyOfOutputForLayoutTest( | 85 virtual std::unique_ptr<cc::SwapPromise> RequestCopyOfOutputForLayoutTest( |
95 std::unique_ptr<cc::CopyOutputRequest> request) = 0; | 86 std::unique_ptr<cc::CopyOutputRequest> request) = 0; |
96 | 87 |
97 protected: | 88 protected: |
98 virtual ~RenderWidgetCompositorDelegate() {} | 89 virtual ~RenderWidgetCompositorDelegate() {} |
99 }; | 90 }; |
100 | 91 |
101 } // namespace content | 92 } // namespace content |
102 | 93 |
103 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_DELEGATE_H_ | 94 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_DELEGATE_H_ |
OLD | NEW |