diff options
author | aelias <aelias@chromium.org> | 2016-03-14 22:10:30 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-15 05:11:42 +0000 |
commit | a9aad960d0bf105c2153a517cedcc57e4d53b0b5 (patch) | |
tree | e6605471d6dc59c2604b0b8fa1c09e6d70538ec2 /cc/layers | |
parent | 5e7d057ea31f81d2658c3783ce41c8d458821e0f (diff) | |
download | chromium_src-a9aad960d0bf105c2153a517cedcc57e4d53b0b5.zip chromium_src-a9aad960d0bf105c2153a517cedcc57e4d53b0b5.tar.gz chromium_src-a9aad960d0bf105c2153a517cedcc57e4d53b0b5.tar.bz2 |
Delete scrollCompensationAdjustment.
This feature was added to compensate for fixed-position layers getting
positioned at integer positions but counterscrolled by a full,
fractional amount. It wound up getting unused because it caused a
performance regression due to defeating the "aborted commit"
optimization during scrolling (every scroll increment with a fractional
change would cause a commit).
There are two ways we can move forward with main-thread fractional
scroll support from here, either 1) have CC automatically compute the
fractional part on the impl thread, or 2) change Blink so that
fixed-position elements don't include the scroll offset in their layout
position at all. Either way, this scroll compensation feature is dead
code, so we can delete it now.
BUG=414283
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1385123003
Cr-Commit-Position: refs/heads/master@{#381180}
Diffstat (limited to 'cc/layers')
-rw-r--r-- | cc/layers/layer.cc | 17 | ||||
-rw-r--r-- | cc/layers/layer.h | 4 | ||||
-rw-r--r-- | cc/layers/layer_impl.cc | 2 | ||||
-rw-r--r-- | cc/layers/layer_impl.h | 8 | ||||
-rw-r--r-- | cc/layers/layer_unittest.cc | 4 |
5 files changed, 0 insertions, 35 deletions
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc index dc02b4c..d8d7e51 100644 --- a/cc/layers/layer.cc +++ b/cc/layers/layer.cc @@ -835,18 +835,6 @@ void Layer::SetScrollOffset(const gfx::ScrollOffset& scroll_offset) { SetNeedsCommit(); } -void Layer::SetScrollCompensationAdjustment( - const gfx::Vector2dF& scroll_compensation_adjustment) { - if (scroll_compensation_adjustment_ == scroll_compensation_adjustment) - return; - scroll_compensation_adjustment_ = scroll_compensation_adjustment; - SetNeedsCommit(); -} - -gfx::Vector2dF Layer::ScrollCompensationAdjustment() const { - return scroll_compensation_adjustment_; -} - void Layer::SetScrollOffsetFromImplSide( const gfx::ScrollOffset& scroll_offset) { DCHECK(IsPropertyChangeAllowed()); @@ -1283,7 +1271,6 @@ void Layer::PushPropertiesTo(LayerImpl* layer) { ->property_trees() ->scroll_tree.synced_scroll_offset(layer->id()) ->set_clobber_active_value(); - layer->SetScrollCompensationAdjustment(ScrollCompensationAdjustment()); { TRACE_EVENT0("cc", "Layer::PushPropertiesTo::CopyOutputRequests"); @@ -1529,8 +1516,6 @@ void Layer::LayerSpecificPropertiesToProto(proto::LayerProperties* proto) { } ScrollOffsetToProto(scroll_offset_, base->mutable_scroll_offset()); - Vector2dFToProto(scroll_compensation_adjustment_, - base->mutable_scroll_compensation_adjustment()); // TODO(nyquist): Figure out what to do with CopyRequests. // See crbug.com/570374. @@ -1634,8 +1619,6 @@ void Layer::FromLayerSpecificPropertiesProto( } scroll_offset_ = ProtoToScrollOffset(base.scroll_offset()); - scroll_compensation_adjustment_ = - ProtoToVector2dF(base.scroll_compensation_adjustment()); update_rect_.Union(ProtoToRect(base.update_rect())); } diff --git a/cc/layers/layer.h b/cc/layers/layer.h index 5cb2a25..64540492 100644 --- a/cc/layers/layer.h +++ b/cc/layers/layer.h @@ -253,9 +253,6 @@ class CC_EXPORT Layer : public base::RefCounted<Layer> { } void SetScrollOffset(const gfx::ScrollOffset& scroll_offset); - void SetScrollCompensationAdjustment( - const gfx::Vector2dF& scroll_compensation_adjustment); - gfx::Vector2dF ScrollCompensationAdjustment() const; gfx::ScrollOffset scroll_offset() const { return scroll_offset_; } void SetScrollOffsetFromImplSide(const gfx::ScrollOffset& scroll_offset); @@ -653,7 +650,6 @@ class CC_EXPORT Layer : public base::RefCounted<Layer> { gfx::Size bounds_; gfx::ScrollOffset scroll_offset_; - gfx::Vector2dF scroll_compensation_adjustment_; // This variable indicates which ancestor layer (if any) whose size, // transformed relative to this layer, defines the maximum scroll offset for // this layer. diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc index 753beca..b3a3fc4 100644 --- a/cc/layers/layer_impl.cc +++ b/cc/layers/layer_impl.cc @@ -539,8 +539,6 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) { layer->set_user_scrollable_horizontal(user_scrollable_horizontal_); layer->set_user_scrollable_vertical(user_scrollable_vertical_); - layer->SetScrollCompensationAdjustment(scroll_compensation_adjustment_); - layer->Set3dSortingContextId(sorting_context_id_); layer->SetNumDescendantsThatDrawContent(num_descendants_that_draw_content_); diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h index 1bc1bc6..b9f8c77 100644 --- a/cc/layers/layer_impl.h +++ b/cc/layers/layer_impl.h @@ -431,12 +431,6 @@ class CC_EXPORT LayerImpl { gfx::ScrollOffset MaxScrollOffset() const; gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const; gfx::Vector2dF ClampScrollToMaxScrollOffset(); - void SetScrollCompensationAdjustment(const gfx::Vector2dF& scroll_offset) { - scroll_compensation_adjustment_ = scroll_offset; - } - gfx::Vector2dF ScrollCompensationAdjustment() const { - return scroll_compensation_adjustment_; - } // Returns the delta of the scroll that was outside of the bounds of the // initial scroll @@ -735,8 +729,6 @@ class CC_EXPORT LayerImpl { LayerPositionConstraint position_constraint_; - gfx::Vector2dF scroll_compensation_adjustment_; - int num_descendants_that_draw_content_; gfx::Rect clip_rect_in_target_space_; diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc index 59a2b5c..73aebe9 100644 --- a/cc/layers/layer_unittest.cc +++ b/cc/layers/layer_unittest.cc @@ -180,8 +180,6 @@ class LayerSerializationTest : public testing::Test { dest->user_scrollable_horizontal_); EXPECT_EQ(src->user_scrollable_vertical_, dest->user_scrollable_vertical_); EXPECT_EQ(src->scroll_offset_, dest->scroll_offset_); - EXPECT_EQ(src->scroll_compensation_adjustment_, - dest->scroll_compensation_adjustment_); EXPECT_EQ(update_rect, dest->update_rect_); if (src->scroll_parent_) { @@ -287,7 +285,6 @@ class LayerSerializationTest : public testing::Test { layer->user_scrollable_horizontal_ = false; layer->user_scrollable_vertical_ = true; layer->scroll_offset_ = gfx::ScrollOffset(3, 14); - layer->scroll_compensation_adjustment_ = gfx::Vector2dF(6.28f, 3.14f); layer->update_rect_ = gfx::Rect(14, 15); VerifyBaseLayerPropertiesSerializationAndDeserialization(layer.get()); @@ -337,7 +334,6 @@ class LayerSerializationTest : public testing::Test { layer->user_scrollable_horizontal_ = !layer->user_scrollable_horizontal_; layer->user_scrollable_vertical_ = !layer->user_scrollable_vertical_; layer->scroll_offset_ = gfx::ScrollOffset(3, 14); - layer->scroll_compensation_adjustment_ = gfx::Vector2dF(6.28f, 3.14f); layer->update_rect_ = gfx::Rect(14, 15); VerifyBaseLayerPropertiesSerializationAndDeserialization(layer.get()); |