| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_H_ | 5 #ifndef CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
| 6 #define CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 6 #define CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 virtual ~RenderWidgetCompositor(); | 44 virtual ~RenderWidgetCompositor(); |
| 45 | 45 |
| 46 const base::WeakPtr<cc::InputHandler>& GetInputHandler(); | 46 const base::WeakPtr<cc::InputHandler>& GetInputHandler(); |
| 47 bool BeginMainFrameRequested() const; | 47 bool BeginMainFrameRequested() const; |
| 48 void SetNeedsDisplayOnAllLayers(); | 48 void SetNeedsDisplayOnAllLayers(); |
| 49 void SetRasterizeOnlyVisibleContent(); | 49 void SetRasterizeOnlyVisibleContent(); |
| 50 void UpdateTopControlsState(cc::TopControlsState constraints, | 50 void UpdateTopControlsState(cc::TopControlsState constraints, |
| 51 cc::TopControlsState current, | 51 cc::TopControlsState current, |
| 52 bool animate); | 52 bool animate); |
| 53 void SetTopControlsLayoutHeight(float top_controls_layout_height); | 53 void SetTopControlsLayoutHeight(float height); |
| 54 void SetNeedsRedrawRect(gfx::Rect damage_rect); | 54 void SetNeedsRedrawRect(gfx::Rect damage_rect); |
| 55 // Like setNeedsRedraw but forces the frame to be drawn, without early-outs. | 55 // Like setNeedsRedraw but forces the frame to be drawn, without early-outs. |
| 56 // Redraw will be forced after the next commit | 56 // Redraw will be forced after the next commit |
| 57 void SetNeedsForcedRedraw(); | 57 void SetNeedsForcedRedraw(); |
| 58 // Calling CreateLatencyInfoSwapPromiseMonitor() to get a scoped | 58 // Calling CreateLatencyInfoSwapPromiseMonitor() to get a scoped |
| 59 // LatencyInfoSwapPromiseMonitor. During the life time of the | 59 // LatencyInfoSwapPromiseMonitor. During the life time of the |
| 60 // LatencyInfoSwapPromiseMonitor, if SetNeedsCommit() or SetNeedsUpdateLayer() | 60 // LatencyInfoSwapPromiseMonitor, if SetNeedsCommit() or SetNeedsUpdateLayer() |
| 61 // is called on LayerTreeHost, the original latency info will be turned | 61 // is called on LayerTreeHost, the original latency info will be turned |
| 62 // into a LatencyInfoSwapPromise. | 62 // into a LatencyInfoSwapPromise. |
| 63 scoped_ptr<cc::SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( | 63 scoped_ptr<cc::SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 const blink::WebLayer* outerViewportScrollLayer) OVERRIDE; | 116 const blink::WebLayer* outerViewportScrollLayer) OVERRIDE; |
| 117 virtual void clearViewportLayers() OVERRIDE; | 117 virtual void clearViewportLayers() OVERRIDE; |
| 118 virtual void registerSelection(const blink::WebSelectionBound& start, | 118 virtual void registerSelection(const blink::WebSelectionBound& start, |
| 119 const blink::WebSelectionBound& end) OVERRIDE; | 119 const blink::WebSelectionBound& end) OVERRIDE; |
| 120 virtual void clearSelection() OVERRIDE; | 120 virtual void clearSelection() OVERRIDE; |
| 121 virtual void setShowFPSCounter(bool show); | 121 virtual void setShowFPSCounter(bool show); |
| 122 virtual void setShowPaintRects(bool show); | 122 virtual void setShowPaintRects(bool show); |
| 123 virtual void setShowDebugBorders(bool show); | 123 virtual void setShowDebugBorders(bool show); |
| 124 virtual void setContinuousPaintingEnabled(bool enabled); | 124 virtual void setContinuousPaintingEnabled(bool enabled); |
| 125 virtual void setShowScrollBottleneckRects(bool show); | 125 virtual void setShowScrollBottleneckRects(bool show); |
| 126 virtual void setTopControlsContentOffset(float); |
| 126 | 127 |
| 127 // cc::LayerTreeHostClient implementation. | 128 // cc::LayerTreeHostClient implementation. |
| 128 virtual void WillBeginMainFrame(int frame_id) OVERRIDE; | 129 virtual void WillBeginMainFrame(int frame_id) OVERRIDE; |
| 129 virtual void DidBeginMainFrame() OVERRIDE; | 130 virtual void DidBeginMainFrame() OVERRIDE; |
| 130 virtual void BeginMainFrame(const cc::BeginFrameArgs& args) OVERRIDE; | 131 virtual void BeginMainFrame(const cc::BeginFrameArgs& args) OVERRIDE; |
| 131 virtual void Layout() OVERRIDE; | 132 virtual void Layout() OVERRIDE; |
| 132 virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta, | 133 virtual void ApplyViewportProperties(const gfx::Vector2d& scroll_delta, |
| 133 float page_scale) OVERRIDE; | 134 float page_scale, |
| 135 float top_controls_delta) OVERRIDE; |
| 134 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) | 136 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) |
| 135 OVERRIDE; | 137 OVERRIDE; |
| 136 virtual void DidInitializeOutputSurface() OVERRIDE; | 138 virtual void DidInitializeOutputSurface() OVERRIDE; |
| 137 virtual void WillCommit() OVERRIDE; | 139 virtual void WillCommit() OVERRIDE; |
| 138 virtual void DidCommit() OVERRIDE; | 140 virtual void DidCommit() OVERRIDE; |
| 139 virtual void DidCommitAndDrawFrame() OVERRIDE; | 141 virtual void DidCommitAndDrawFrame() OVERRIDE; |
| 140 virtual void DidCompleteSwapBuffers() OVERRIDE; | 142 virtual void DidCompleteSwapBuffers() OVERRIDE; |
| 141 virtual void RateLimitSharedMainThreadContext() OVERRIDE; | 143 virtual void RateLimitSharedMainThreadContext() OVERRIDE; |
| 142 | 144 |
| 143 // cc::LayerTreeHostSingleThreadClient implementation. | 145 // cc::LayerTreeHostSingleThreadClient implementation. |
| 144 virtual void ScheduleAnimation() OVERRIDE; | 146 virtual void ScheduleAnimation() OVERRIDE; |
| 145 virtual void DidPostSwapBuffers() OVERRIDE; | 147 virtual void DidPostSwapBuffers() OVERRIDE; |
| 146 virtual void DidAbortSwapBuffers() OVERRIDE; | 148 virtual void DidAbortSwapBuffers() OVERRIDE; |
| 147 | 149 |
| 148 private: | 150 private: |
| 149 RenderWidgetCompositor(RenderWidget* widget, bool threaded); | 151 RenderWidgetCompositor(RenderWidget* widget, bool threaded); |
| 150 | 152 |
| 151 void Initialize(cc::LayerTreeSettings settings); | 153 void Initialize(cc::LayerTreeSettings settings); |
| 152 | 154 |
| 153 bool threaded_; | 155 bool threaded_; |
| 154 RenderWidget* widget_; | 156 RenderWidget* widget_; |
| 155 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; | 157 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; |
| 156 }; | 158 }; |
| 157 | 159 |
| 158 } // namespace content | 160 } // namespace content |
| 159 | 161 |
| 160 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 162 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
| OLD | NEW |