| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 namespace content { | 47 namespace content { |
| 48 | 48 |
| 49 class RenderWidgetCompositorDelegate; | 49 class RenderWidgetCompositorDelegate; |
| 50 struct ScreenInfo; | 50 struct ScreenInfo; |
| 51 | 51 |
| 52 class CONTENT_EXPORT RenderWidgetCompositor | 52 class CONTENT_EXPORT RenderWidgetCompositor |
| 53 : NON_EXPORTED_BASE(public blink::WebLayerTreeView), | 53 : NON_EXPORTED_BASE(public blink::WebLayerTreeView), |
| 54 NON_EXPORTED_BASE(public cc::LayerTreeHostClient), | 54 NON_EXPORTED_BASE(public cc::LayerTreeHostClient), |
| 55 NON_EXPORTED_BASE(public cc::LayerTreeHostSingleThreadClient) { | 55 NON_EXPORTED_BASE(public cc::LayerTreeHostSingleThreadClient) { |
| 56 using ReportTimeCallback = base::Callback<void(bool, double)>; |
| 57 |
| 56 public: | 58 public: |
| 57 // Attempt to construct and initialize a compositor instance for the widget | 59 // Attempt to construct and initialize a compositor instance for the widget |
| 58 // with the given settings. Returns NULL if initialization fails. | 60 // with the given settings. Returns NULL if initialization fails. |
| 59 static std::unique_ptr<RenderWidgetCompositor> Create( | 61 static std::unique_ptr<RenderWidgetCompositor> Create( |
| 60 RenderWidgetCompositorDelegate* delegate, | 62 RenderWidgetCompositorDelegate* delegate, |
| 61 CompositorDependencies* compositor_deps); | 63 CompositorDependencies* compositor_deps); |
| 62 | 64 |
| 63 ~RenderWidgetCompositor() override; | 65 ~RenderWidgetCompositor() override; |
| 64 | 66 |
| 65 static cc::LayerTreeSettings GenerateLayerTreeSettings( | 67 static cc::LayerTreeSettings GenerateLayerTreeSettings( |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 void UpdateEventRectsForSubframeIfNecessary() override; | 162 void UpdateEventRectsForSubframeIfNecessary() override; |
| 161 blink::WebEventListenerProperties EventListenerProperties( | 163 blink::WebEventListenerProperties EventListenerProperties( |
| 162 blink::WebEventListenerClass eventClass) const override; | 164 blink::WebEventListenerClass eventClass) const override; |
| 163 void SetHaveScrollEventHandlers(bool) override; | 165 void SetHaveScrollEventHandlers(bool) override; |
| 164 bool HaveScrollEventHandlers() const override; | 166 bool HaveScrollEventHandlers() const override; |
| 165 int LayerTreeId() const override; | 167 int LayerTreeId() const override; |
| 166 void SetShowFPSCounter(bool show) override; | 168 void SetShowFPSCounter(bool show) override; |
| 167 void SetShowPaintRects(bool show) override; | 169 void SetShowPaintRects(bool show) override; |
| 168 void SetShowDebugBorders(bool show) override; | 170 void SetShowDebugBorders(bool show) override; |
| 169 void SetShowScrollBottleneckRects(bool show) override; | 171 void SetShowScrollBottleneckRects(bool show) override; |
| 172 void NotifySwapTime(ReportTimeCallback callback) override; |
| 170 | 173 |
| 171 void UpdateBrowserControlsState(blink::WebBrowserControlsState constraints, | 174 void UpdateBrowserControlsState(blink::WebBrowserControlsState constraints, |
| 172 blink::WebBrowserControlsState current, | 175 blink::WebBrowserControlsState current, |
| 173 bool animate) override; | 176 bool animate) override; |
| 174 void SetBrowserControlsHeight(float height, bool shrink) override; | 177 void SetBrowserControlsHeight(float height, bool shrink) override; |
| 175 void SetBrowserControlsShownRatio(float) override; | 178 void SetBrowserControlsShownRatio(float) override; |
| 176 // TODO(ianwen): Move this method to WebLayerTreeView and implement main | 179 // TODO(ianwen): Move this method to WebLayerTreeView and implement main |
| 177 // thread scrolling. | 180 // thread scrolling. |
| 178 virtual void setBottomControlsHeight(float height); | 181 virtual void setBottomControlsHeight(float height); |
| 179 | 182 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 std::unique_ptr<cc::AnimationHost> animation_host_; | 236 std::unique_ptr<cc::AnimationHost> animation_host_; |
| 234 std::unique_ptr<cc::LayerTreeHost> layer_tree_host_; | 237 std::unique_ptr<cc::LayerTreeHost> layer_tree_host_; |
| 235 bool never_visible_; | 238 bool never_visible_; |
| 236 bool is_for_oopif_; | 239 bool is_for_oopif_; |
| 237 | 240 |
| 238 blink::WebLayoutAndPaintAsyncCallback* layout_and_paint_async_callback_; | 241 blink::WebLayoutAndPaintAsyncCallback* layout_and_paint_async_callback_; |
| 239 | 242 |
| 240 cc::FrameSinkId frame_sink_id_; | 243 cc::FrameSinkId frame_sink_id_; |
| 241 | 244 |
| 242 base::WeakPtrFactory<RenderWidgetCompositor> weak_factory_; | 245 base::WeakPtrFactory<RenderWidgetCompositor> weak_factory_; |
| 246 |
| 247 DISALLOW_COPY_AND_ASSIGN(RenderWidgetCompositor); |
| 243 }; | 248 }; |
| 244 | 249 |
| 245 } // namespace content | 250 } // namespace content |
| 246 | 251 |
| 247 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 252 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
| OLD | NEW |