diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-12 16:34:53 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-12 16:34:53 +0000 |
commit | 5c4824e1449f42aa88d6ccd2136d3170213e8803 (patch) | |
tree | 0a01c6a8ffa3a2acd1495f0f7ee2595aa47c1ef8 /cc/scrollbar_layer_impl.h | |
parent | b938d4f552356e79b96a7ecca85d98c782e2c659 (diff) | |
download | chromium_src-5c4824e1449f42aa88d6ccd2136d3170213e8803.zip chromium_src-5c4824e1449f42aa88d6ccd2136d3170213e8803.tar.gz chromium_src-5c4824e1449f42aa88d6ccd2136d3170213e8803.tar.bz2 |
Separate layer property pushes from tree structure syncs and clean up scrollbar layer pointers
We need sync the cc::Layer tree structure and layer properties to cc::LayerImpls
at commit time. We track when properties and tree structure change and use that
to decide whether to do a full tree sync or just a property push. This patch
separates the property push to always happen seperately from the tree sync.
The scrollbar and scroll layer pointer code needed a bit of cleanup to make this
work. Before this patch, the way that scrolling worked was during the scrollbar
pointer sync inside TreeSynchronizer::synchronizeTrees() was what actually
updated the scroll offsets as a side effect of setting the pointer values. This
patch rejiggers things so the ScrollbarAnimationController maintains the scroll
properties at all times and the scrollbar layers pull values from their
controller. As a bonus, this means changes to the scroll offset no longer need
a full tree sync - they just need a property push.
The scrollable bounds are also now pulled from the layer directly instead of the
first child of a layer to avoid depending on properties updating in a specific
order and be overall less hacky. This depends on webkit.org/b/106518
BUG=169143
Review URL: https://chromiumcodereview.appspot.com/11821064
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176540 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/scrollbar_layer_impl.h')
-rw-r--r-- | cc/scrollbar_layer_impl.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/cc/scrollbar_layer_impl.h b/cc/scrollbar_layer_impl.h index 116b24a..24bef0a 100644 --- a/cc/scrollbar_layer_impl.h +++ b/cc/scrollbar_layer_impl.h @@ -28,14 +28,12 @@ public: void setForeTrackResourceId(ResourceProvider::ResourceId id) { m_foreTrackResourceId = id; } void setThumbResourceId(ResourceProvider::ResourceId id) { m_thumbResourceId = id; } - virtual float currentPos() const OVERRIDE; - void setCurrentPos(float currentPos) { m_currentPos = currentPos; } + void setAnimationController(ScrollbarAnimationController* controller); + // ScrollbarLayerImplBase implementation. + virtual float currentPos() const OVERRIDE; virtual int totalSize() const OVERRIDE; - void setTotalSize(int totalSize) { m_totalSize = totalSize; } - virtual int maximum() const OVERRIDE; - void setMaximum(int maximum) { m_maximum = maximum; } virtual WebKit::WebScrollbar::Orientation orientation() const OVERRIDE; @@ -95,9 +93,9 @@ private: WebKit::WebScrollbar::ScrollbarPart m_pressedPart; WebKit::WebScrollbar::ScrollbarPart m_hoveredPart; - float m_currentPos; - int m_totalSize; - int m_maximum; + // This animation controller is owned by the scrollable LayerImpl, which + // is tied to the lifetime of the ScrollbarLayerImpls. + ScrollbarAnimationController* m_animationController; bool m_isScrollableAreaActive; bool m_isScrollViewScrollbar; |