| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_DELEGATE_H_ | |
| 6 #define CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_DELEGATE_H_ | |
| 7 | |
| 8 #include "cc/debug/frame_timing_tracker.h" | |
| 9 | |
| 10 namespace blink { | |
| 11 class WebWidget; | |
| 12 struct WebScreenInfo; | |
| 13 } | |
| 14 | |
| 15 namespace cc { | |
| 16 class BeginFrameSource; | |
| 17 class OutputSurface; | |
| 18 } | |
| 19 | |
| 20 namespace content { | |
| 21 | |
| 22 // Consumers of RenderWidgetCompositor implement this delegate in order to | |
| 23 // transport compositing information across processes. | |
| 24 class CONTENT_EXPORT RenderWidgetCompositorDelegate { | |
| 25 public: | |
| 26 // Report viewport related properties during a commit from the compositor | |
| 27 // thread. | |
| 28 virtual void ApplyViewportDeltas( | |
| 29 const gfx::Vector2dF& inner_delta, | |
| 30 const gfx::Vector2dF& outer_delta, | |
| 31 const gfx::Vector2dF& elastic_overscroll_delta, | |
| 32 float page_scale, | |
| 33 float top_controls_delta) = 0; | |
| 34 | |
| 35 // Notifies that the compositor has issed a BeginMainFrame. | |
| 36 virtual void BeginMainFrame(double frame_time_sec) = 0; | |
| 37 | |
| 38 // Requests an OutputSurface to render into. | |
| 39 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) = 0; | |
| 40 | |
| 41 // Requests an external BeginFrameSource from the delegate. | |
| 42 virtual scoped_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource() = 0; | |
| 43 | |
| 44 // Notifies that the draw commands for a committed frame have been issued. | |
| 45 virtual void DidCommitAndDrawCompositorFrame() = 0; | |
| 46 | |
| 47 // Notifies about a compositor frame commit operation having finished. | |
| 48 virtual void DidCommitCompositorFrame() = 0; | |
| 49 | |
| 50 // Called by the compositor when page scale animation completed. | |
| 51 virtual void DidCompletePageScaleAnimation() = 0; | |
| 52 | |
| 53 // Notifies that the compositor has posted a swapbuffers operation to the GPU | |
| 54 // process. | |
| 55 virtual void DidCompleteSwapBuffers() = 0; | |
| 56 | |
| 57 // TODO(simonhong, fsamuel): Remove this once crbug.com/471411 is resolved. | |
| 58 // Indicates whether this RenderWidgetCompositor is for an out-of-process | |
| 59 // iframe or not. | |
| 60 virtual bool ForOOPIF() const = 0; | |
| 61 | |
| 62 // Called by the compositor to forward a proto that represents serialized | |
| 63 // compositor state. | |
| 64 virtual void ForwardCompositorProto(const std::vector<uint8_t>& proto) = 0; | |
| 65 | |
| 66 // Called by the compositor in single-threaded mode when a swap is aborted. | |
| 67 virtual void OnSwapBuffersAborted() = 0; | |
| 68 | |
| 69 // Called by the compositor in single-threaded mode when a swap completes. | |
| 70 virtual void OnSwapBuffersComplete() = 0; | |
| 71 | |
| 72 // Called by the compositor in single-threaded mode when a swap is posted. | |
| 73 virtual void OnSwapBuffersPosted() = 0; | |
| 74 | |
| 75 // Called by the compositor to request the delegate to record frame timing. | |
| 76 virtual void RecordFrameTimingEvents( | |
| 77 scoped_ptr<cc::FrameTimingTracker::CompositeTimingSet> composite_events, | |
| 78 scoped_ptr<cc::FrameTimingTracker::MainFrameTimingSet> | |
| 79 main_frame_events) = 0; | |
| 80 | |
| 81 // Requests that the client schedule a composite now, and calculate | |
| 82 // appropriate delay for potential future frame. | |
| 83 virtual void ScheduleAnimation() = 0; | |
| 84 | |
| 85 // Requests a visual frame-based update to the state of the delegate if there | |
| 86 // an update available. | |
| 87 virtual void UpdateVisualState() = 0; | |
| 88 | |
| 89 // Indicates that the compositor is about to begin a frame. This is primarily | |
| 90 // to signal to flow control mechanisms that a frame is beginning, not to | |
| 91 // perform actual painting work. | |
| 92 virtual void WillBeginCompositorFrame() = 0; | |
| 93 | |
| 94 protected: | |
| 95 virtual ~RenderWidgetCompositorDelegate() {} | |
| 96 }; | |
| 97 | |
| 98 } // namespace content | |
| 99 | |
| 100 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_DELEGATE_H_ | |
| OLD | NEW |