| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 void startPageScaleAnimation(const blink::WebPoint& destination, | 114 void startPageScaleAnimation(const blink::WebPoint& destination, |
| 115 bool use_anchor, | 115 bool use_anchor, |
| 116 float new_page_scale, | 116 float new_page_scale, |
| 117 double duration_sec) override; | 117 double duration_sec) override; |
| 118 bool hasPendingPageScaleAnimation() const override; | 118 bool hasPendingPageScaleAnimation() const override; |
| 119 void heuristicsForGpuRasterizationUpdated(bool matches_heuristics) override; | 119 void heuristicsForGpuRasterizationUpdated(bool matches_heuristics) override; |
| 120 void setNeedsAnimate() override; | 120 void setNeedsAnimate() override; |
| 121 void setNeedsBeginFrame() override; | 121 void setNeedsBeginFrame() override; |
| 122 void setNeedsCompositorUpdate() override; | 122 void setNeedsCompositorUpdate() override; |
| 123 void didStopFlinging() override; | 123 void didStopFlinging() override; |
| 124 void layoutAndPaintAsync( | |
| 125 blink::WebLayoutAndPaintAsyncCallback* callback) override; | |
| 126 void compositeAndReadbackAsync( | 124 void compositeAndReadbackAsync( |
| 127 blink::WebCompositeAndReadbackAsyncCallback* callback) override; | 125 blink::WebCompositeAndReadbackAsyncCallback* callback) override; |
| 128 void setDeferCommits(bool defer_commits) override; | 126 void setDeferCommits(bool defer_commits) override; |
| 129 void registerViewportLayers( | 127 void registerViewportLayers( |
| 130 const blink::WebLayer* overscrollElasticityLayer, | 128 const blink::WebLayer* overscrollElasticityLayer, |
| 131 const blink::WebLayer* pageScaleLayer, | 129 const blink::WebLayer* pageScaleLayer, |
| 132 const blink::WebLayer* innerViewportScrollLayer, | 130 const blink::WebLayer* innerViewportScrollLayer, |
| 133 const blink::WebLayer* outerViewportScrollLayer) override; | 131 const blink::WebLayer* outerViewportScrollLayer) override; |
| 134 void clearViewportLayers() override; | 132 void clearViewportLayers() override; |
| 135 void registerSelection(const blink::WebSelection& selection) override; | 133 void registerSelection(const blink::WebSelection& selection) override; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 protected: | 193 protected: |
| 196 friend class RenderViewImplScaleFactorTest; | 194 friend class RenderViewImplScaleFactorTest; |
| 197 | 195 |
| 198 RenderWidgetCompositor(RenderWidgetCompositorDelegate* delegate, | 196 RenderWidgetCompositor(RenderWidgetCompositorDelegate* delegate, |
| 199 CompositorDependencies* compositor_deps); | 197 CompositorDependencies* compositor_deps); |
| 200 | 198 |
| 201 void Initialize(float device_scale_factor); | 199 void Initialize(float device_scale_factor); |
| 202 cc::LayerTreeHost* layer_tree_host() { return layer_tree_host_.get(); } | 200 cc::LayerTreeHost* layer_tree_host() { return layer_tree_host_.get(); } |
| 203 | 201 |
| 204 private: | 202 private: |
| 205 void LayoutAndUpdateLayers(); | |
| 206 void InvokeLayoutAndPaintCallback(); | |
| 207 bool CompositeIsSynchronous() const; | 203 bool CompositeIsSynchronous() const; |
| 208 void SynchronouslyComposite(); | 204 void SynchronouslyComposite(); |
| 209 | 205 |
| 210 int num_failed_recreate_attempts_; | 206 int num_failed_recreate_attempts_; |
| 211 RenderWidgetCompositorDelegate* const delegate_; | 207 RenderWidgetCompositorDelegate* const delegate_; |
| 212 CompositorDependencies* const compositor_deps_; | 208 CompositorDependencies* const compositor_deps_; |
| 213 std::unique_ptr<cc::LayerTreeHost> layer_tree_host_; | 209 std::unique_ptr<cc::LayerTreeHost> layer_tree_host_; |
| 214 bool never_visible_; | 210 bool never_visible_; |
| 215 | 211 |
| 216 blink::WebLayoutAndPaintAsyncCallback* layout_and_paint_async_callback_; | |
| 217 std::unique_ptr<cc::CopyOutputRequest> temporary_copy_output_request_; | 212 std::unique_ptr<cc::CopyOutputRequest> temporary_copy_output_request_; |
| 218 | 213 |
| 219 cc::RemoteProtoChannel::ProtoReceiver* remote_proto_channel_receiver_; | 214 cc::RemoteProtoChannel::ProtoReceiver* remote_proto_channel_receiver_; |
| 220 | 215 |
| 221 base::WeakPtrFactory<RenderWidgetCompositor> weak_factory_; | 216 base::WeakPtrFactory<RenderWidgetCompositor> weak_factory_; |
| 222 }; | 217 }; |
| 223 | 218 |
| 224 } // namespace content | 219 } // namespace content |
| 225 | 220 |
| 226 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 221 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
| OLD | NEW |