| 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 26 matching lines...) Expand all Loading... |
| 37 public cc::LayerTreeHostSingleThreadClient { | 37 public cc::LayerTreeHostSingleThreadClient { |
| 38 public: | 38 public: |
| 39 // Attempt to construct and initialize a compositor instance for the widget | 39 // Attempt to construct and initialize a compositor instance for the widget |
| 40 // with the given settings. Returns NULL if initialization fails. | 40 // with the given settings. Returns NULL if initialization fails. |
| 41 static scoped_ptr<RenderWidgetCompositor> Create(RenderWidget* widget, | 41 static scoped_ptr<RenderWidgetCompositor> Create(RenderWidget* widget, |
| 42 bool threaded); | 42 bool threaded); |
| 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 void SetSuppressScheduleComposite(bool suppress); | |
| 48 bool BeginMainFrameRequested() const; | 47 bool BeginMainFrameRequested() const; |
| 49 void SetNeedsDisplayOnAllLayers(); | 48 void SetNeedsDisplayOnAllLayers(); |
| 50 void SetRasterizeOnlyVisibleContent(); | 49 void SetRasterizeOnlyVisibleContent(); |
| 51 void UpdateTopControlsState(cc::TopControlsState constraints, | 50 void UpdateTopControlsState(cc::TopControlsState constraints, |
| 52 cc::TopControlsState current, | 51 cc::TopControlsState current, |
| 53 bool animate); | 52 bool animate); |
| 54 void SetOverdrawBottomHeight(float overdraw_bottom_height); | 53 void SetOverdrawBottomHeight(float overdraw_bottom_height); |
| 55 void SetNeedsRedrawRect(gfx::Rect damage_rect); | 54 void SetNeedsRedrawRect(gfx::Rect damage_rect); |
| 56 // 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. |
| 57 // Redraw will be forced after the next commit | 56 // Redraw will be forced after the next commit |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) | 134 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) |
| 136 OVERRIDE; | 135 OVERRIDE; |
| 137 virtual void DidInitializeOutputSurface() OVERRIDE; | 136 virtual void DidInitializeOutputSurface() OVERRIDE; |
| 138 virtual void WillCommit() OVERRIDE; | 137 virtual void WillCommit() OVERRIDE; |
| 139 virtual void DidCommit() OVERRIDE; | 138 virtual void DidCommit() OVERRIDE; |
| 140 virtual void DidCommitAndDrawFrame() OVERRIDE; | 139 virtual void DidCommitAndDrawFrame() OVERRIDE; |
| 141 virtual void DidCompleteSwapBuffers() OVERRIDE; | 140 virtual void DidCompleteSwapBuffers() OVERRIDE; |
| 142 virtual void RateLimitSharedMainThreadContext() OVERRIDE; | 141 virtual void RateLimitSharedMainThreadContext() OVERRIDE; |
| 143 | 142 |
| 144 // cc::LayerTreeHostSingleThreadClient implementation. | 143 // cc::LayerTreeHostSingleThreadClient implementation. |
| 145 virtual void ScheduleComposite() OVERRIDE; | |
| 146 virtual void ScheduleAnimation() OVERRIDE; | 144 virtual void ScheduleAnimation() OVERRIDE; |
| 147 virtual void DidPostSwapBuffers() OVERRIDE; | 145 virtual void DidPostSwapBuffers() OVERRIDE; |
| 148 virtual void DidAbortSwapBuffers() OVERRIDE; | 146 virtual void DidAbortSwapBuffers() OVERRIDE; |
| 149 | 147 |
| 150 private: | 148 private: |
| 151 RenderWidgetCompositor(RenderWidget* widget, bool threaded); | 149 RenderWidgetCompositor(RenderWidget* widget, bool threaded); |
| 152 | 150 |
| 153 void Initialize(cc::LayerTreeSettings settings); | 151 void Initialize(cc::LayerTreeSettings settings); |
| 154 | 152 |
| 155 bool threaded_; | 153 bool threaded_; |
| 156 bool suppress_schedule_composite_; | |
| 157 RenderWidget* widget_; | 154 RenderWidget* widget_; |
| 158 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; | 155 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; |
| 159 }; | 156 }; |
| 160 | 157 |
| 161 } // namespace content | 158 } // namespace content |
| 162 | 159 |
| 163 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 160 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
| OLD | NEW |