diff options
author | wjmaclean@chromium.org <wjmaclean@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-29 13:54:33 +0000 |
---|---|---|
committer | wjmaclean@chromium.org <wjmaclean@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-29 13:54:33 +0000 |
commit | 610834cb98728532e1f296c77552f640f7c0ff7a (patch) | |
tree | ba2aee5588ed23c8ccfb0adf5be2ff14ddab29a4 /cc/layers/layer.h | |
parent | 167f3c414c3d087653ac9d712add50b3b854fcbb (diff) | |
download | chromium_src-610834cb98728532e1f296c77552f640f7c0ff7a.zip chromium_src-610834cb98728532e1f296c77552f640f7c0ff7a.tar.gz chromium_src-610834cb98728532e1f296c77552f640f7c0ff7a.tar.bz2 |
Pinch/Zoom Infrastructure & Plumbing CL
This CL supplies the necessary changes to CC to support the
inner/outer viewport model for pinch-zoom and fixed-position
elements. The specification for these changes is contained in
the document "Layer-based Solution for Pinch Zoom / Fixed
Position".
It incorporates a change to how scrollbar parameters are
computed (removes the notion of max_scroll_offset as a
quantity set be the embedder, and instead inferred from the
relative sizes of a clip layer w.r.t. the scroll layer).
Scrollbars are generalized so that a layer may have more than
two scrollbars, and the parameters of the scrollbar are set
w.r.t. the sizes and positions of a clip and a scroll layer.
Further, changes to the scrip/scroll layer automatically
notify any attached scrollbars.
The CL also removes existing references to root_scroll_layer
from LTH, LTI and LTHI and replaces them with either
Inner/OuterViewportScrollLayer (dual-layer operation only
exists at present if the --enable-pinch-virtual-viewport flag
is specified, otherwise behavior is unchanged).
Logic is added to (i) combine scroll offsets for the two
viewports before passing it to the embedder, and (ii)
splitting any offsets received from the embedder
appropriately between the two viewports.
This CL relies on https://codereview.chromium.org/138453004/
for changes in Blink to support it.
BUG=148816
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=246812
R=aelias@chromium.org, enne@chromium.org, joi@chromium.org, piman@chromium.org, sky@chromium.org
Review URL: https://codereview.chromium.org/23983047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247684 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers/layer.h')
-rw-r--r-- | cc/layers/layer.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cc/layers/layer.h b/cc/layers/layer.h index df358f2..68b67e25 100644 --- a/cc/layers/layer.h +++ b/cc/layers/layer.h @@ -269,11 +269,10 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>, gfx::Vector2d scroll_offset() const { return scroll_offset_; } void SetScrollOffsetFromImplSide(gfx::Vector2d scroll_offset); - void SetMaxScrollOffset(gfx::Vector2d max_scroll_offset); - gfx::Vector2d max_scroll_offset() const { return max_scroll_offset_; } + gfx::Vector2d MaxScrollOffset() const; - void SetScrollable(bool scrollable); - bool scrollable() const { return scrollable_; } + void SetScrollClipLayer(Layer* clip_layer); + bool scrollable() const { return !!scroll_clip_layer_; } void SetUserScrollable(bool horizontal, bool vertical); bool user_scrollable_horizontal() const { @@ -565,7 +564,10 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>, gfx::Size bounds_; gfx::Vector2d scroll_offset_; - gfx::Vector2d max_scroll_offset_; + // This variable indicates which ancestor layer (if any) whose size, + // transformed relative to this layer, defines the maximum scroll offset for + // this layer. + Layer* scroll_clip_layer_; bool scrollable_ : 1; bool should_scroll_on_main_thread_ : 1; bool have_wheel_event_handlers_ : 1; |