diff options
author | mkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-24 12:10:25 +0000 |
---|---|---|
committer | mkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-24 12:10:25 +0000 |
commit | 7b14f39769532717317b8a48d0fc03bc66a6cc0b (patch) | |
tree | 7ad4bd344d4ce65d36a6945d36e37adf9dcaac07 /cc/layers/scrollbar_layer_impl_base.cc | |
parent | 10587c5fbaba1b747884792a8e6e6403f73d7fe1 (diff) | |
download | chromium_src-7b14f39769532717317b8a48d0fc03bc66a6cc0b.zip chromium_src-7b14f39769532717317b8a48d0fc03bc66a6cc0b.tar.gz chromium_src-7b14f39769532717317b8a48d0fc03bc66a6cc0b.tar.bz2 |
Revert of Pinch/Zoom Infrastructure & Plumbing CL (https://codereview.chromium.org/23983047/)
Reason for revert:
This patch broke several blink-side compositing/rtl tests[1][2]. It's
unclear whether these tests are valuable, given some comments
in TestExpectations, but since I know nothing about compositing
I'll leave the decision about what to do with these tests up to
someone who does.
[1]: http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%40ToT%20Blink&tests=compositing/rtl/rtl-iframe-absolute-overflow-scrolled.html,compositing/rtl/rtl-iframe-absolute-overflow.html,compositing/rtl/rtl-iframe-fixed-overflow-scrolled.html,compositing/rtl/rtl-iframe-fixed-overflow.html
[2]: http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.7/builds/22131
Original issue's description:
> 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
TBR=enne@chromium.org,aelias@chromium.org,joi@chromium.org,sky@chromium.org,piman@chromium.org,tony@chromium.org,wjmaclean@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=148816
Review URL: https://codereview.chromium.org/146713002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246842 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers/scrollbar_layer_impl_base.cc')
-rw-r--r-- | cc/layers/scrollbar_layer_impl_base.cc | 53 |
1 files changed, 4 insertions, 49 deletions
diff --git a/cc/layers/scrollbar_layer_impl_base.cc b/cc/layers/scrollbar_layer_impl_base.cc index 22583a1..55f46f5 100644 --- a/cc/layers/scrollbar_layer_impl_base.cc +++ b/cc/layers/scrollbar_layer_impl_base.cc @@ -5,7 +5,7 @@ #include "cc/layers/scrollbar_layer_impl_base.h" #include <algorithm> -#include "cc/trees/layer_tree_impl.h" +#include "cc/layers/layer.h" #include "ui/gfx/rect_conversions.h" namespace cc { @@ -14,12 +14,10 @@ ScrollbarLayerImplBase::ScrollbarLayerImplBase( LayerTreeImpl* tree_impl, int id, ScrollbarOrientation orientation, - bool is_left_side_vertical_scrollbar, - bool is_overlay) + bool is_left_side_vertical_scrollbar) : LayerImpl(tree_impl, id), - scroll_layer_(NULL), - clip_layer_(NULL), - is_overlay_scrollbar_(is_overlay), + scroll_layer_id_(Layer::INVALID_ID), + is_overlay_scrollbar_(false), thumb_thickness_scale_factor_(1.f), current_pos_(0.f), maximum_(0), @@ -28,50 +26,14 @@ ScrollbarLayerImplBase::ScrollbarLayerImplBase( vertical_adjust_(0.f), visible_to_total_length_ratio_(1.f) {} -ScrollbarLayerImplBase::~ScrollbarLayerImplBase() { -} - void ScrollbarLayerImplBase::PushPropertiesTo(LayerImpl* layer) { LayerImpl::PushPropertiesTo(layer); - DCHECK(layer->ToScrollbarLayer()); - layer->ToScrollbarLayer()->set_is_overlay_scrollbar(is_overlay_scrollbar_); - PushScrollClipPropertiesTo(layer); -} - -void ScrollbarLayerImplBase::PushScrollClipPropertiesTo(LayerImpl* layer) { - DCHECK(layer->ToScrollbarLayer()); - layer->ToScrollbarLayer()->SetScrollLayerById(ScrollLayerId()); - layer->ToScrollbarLayer()->SetClipLayerById(ClipLayerId()); } ScrollbarLayerImplBase* ScrollbarLayerImplBase::ToScrollbarLayer() { return this; } -void ScrollbarLayerImplBase::SetScrollLayerById(int id) { - LayerImpl* scroll_layer = layer_tree_impl()->LayerById(id); - if (scroll_layer_ == scroll_layer) - return; - - if (scroll_layer_) - scroll_layer_->RemoveScrollbar(this); - scroll_layer_ = scroll_layer; - if (scroll_layer_) - scroll_layer_->AddScrollbar(this); -} - -void ScrollbarLayerImplBase::SetClipLayerById(int id) { - LayerImpl* clip_layer = layer_tree_impl()->LayerById(id); - if (clip_layer_ == clip_layer) - return; - - if (clip_layer_) - clip_layer_->RemoveScrollbar(this); - clip_layer_ = clip_layer; - if (clip_layer_) - clip_layer_->AddScrollbar(this); -} - gfx::Rect ScrollbarLayerImplBase::ScrollbarLayerRectToContentRect( const gfx::RectF& layer_rect) const { // Don't intersect with the bounds as in LayerRectToContentRect() because @@ -215,11 +177,4 @@ gfx::Rect ScrollbarLayerImplBase::ComputeThumbQuadRect() const { return ScrollbarLayerRectToContentRect(thumb_rect); } -void ScrollbarLayerImplBase::ScrollbarParametersDidChange() { - if (!clip_layer_ || !scroll_layer_) - return; - - scroll_layer_->SetScrollbarPosition(this, clip_layer_); -} - } // namespace cc |