Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3359)

Unified Diff: cc/trees/layer_tree_impl.h

Issue 1038173002: Refactor delegated scrolling in LayerImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove "scrollOffsetDelegate" Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_impl.h
diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h
index 8ab42634cc835c209f37da7d24623a93248e5b30..1d3367e0e00d5c5c1fbc9e3b15b46647d1ac6be6 100644
--- a/cc/trees/layer_tree_impl.h
+++ b/cc/trees/layer_tree_impl.h
@@ -33,7 +33,8 @@ class ContextProvider;
class DebugRectHistory;
class FrameRateCounter;
class HeadsUpDisplayLayerImpl;
-class LayerScrollOffsetDelegateProxy;
+class LayerExternalScrollOffsetListener;
+class LayerScrollOffsetDelegate;
class LayerTreeDebugState;
class LayerTreeImpl;
class LayerTreeSettings;
@@ -138,6 +139,7 @@ class CC_EXPORT LayerTreeImpl {
hud_layer_ = layer_impl;
}
+ // This function may return NULL, it is the caller's responsibility to check.
LayerImpl* InnerViewportScrollLayer() const;
// This function may return NULL, it is the caller's responsibility to check.
LayerImpl* OuterViewportScrollLayer() const;
@@ -263,9 +265,10 @@ class CC_EXPORT LayerTreeImpl {
void SetRootLayerScrollOffsetDelegate(
LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate);
- void OnRootLayerDelegatedScrollOffsetChanged();
- void UpdateScrollOffsetDelegate();
- gfx::ScrollOffset GetDelegatedScrollOffset(LayerImpl* layer);
+ void UpdateRootScrollOffsetDelegate();
+ // Distribute the rool scroll between outer and inner viewport scroll layer.
+ // The outer viewport scroll layer scrolls first.
+ void DistributeRootScrollOffset();
// Call this function when you expect there to be a swap buffer.
// See swap_promise.h for how to use SwapPromise.
@@ -355,10 +358,7 @@ class CC_EXPORT LayerTreeImpl {
HeadsUpDisplayLayerImpl* hud_layer_;
LayerImpl* currently_scrolling_layer_;
LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_;
- scoped_ptr<LayerScrollOffsetDelegateProxy>
- inner_viewport_scroll_delegate_proxy_;
- scoped_ptr<LayerScrollOffsetDelegateProxy>
- outer_viewport_scroll_delegate_proxy_;
+ scoped_ptr<LayerExternalScrollOffsetListener> layer_scroll_offset_listener_;
SkColor background_color_;
bool has_transparent_background_;

Powered by Google App Engine
This is Rietveld 408576698