| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/layers/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/debug/trace_event_argument.h" | 8 #include "base/debug/trace_event_argument.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1162 | 1162 |
| 1163 gfx::ScrollOffset LayerImpl::MaxScrollOffset() const { | 1163 gfx::ScrollOffset LayerImpl::MaxScrollOffset() const { |
| 1164 if (!scroll_clip_layer_ || bounds().IsEmpty()) | 1164 if (!scroll_clip_layer_ || bounds().IsEmpty()) |
| 1165 return gfx::ScrollOffset(); | 1165 return gfx::ScrollOffset(); |
| 1166 | 1166 |
| 1167 LayerImpl const* page_scale_layer = layer_tree_impl()->page_scale_layer(); | 1167 LayerImpl const* page_scale_layer = layer_tree_impl()->page_scale_layer(); |
| 1168 DCHECK(this != page_scale_layer); | 1168 DCHECK(this != page_scale_layer); |
| 1169 DCHECK(this != layer_tree_impl()->InnerViewportScrollLayer() || | 1169 DCHECK(this != layer_tree_impl()->InnerViewportScrollLayer() || |
| 1170 IsContainerForFixedPositionLayers()); | 1170 IsContainerForFixedPositionLayers()); |
| 1171 | 1171 |
| 1172 gfx::SizeF scaled_scroll_bounds(bounds()); | 1172 // Don't use LayerImpl::bounds() since it snaps to integral values. We'll |
| 1173 // snap post-scaling. |
| 1174 gfx::SizeF scaled_scroll_bounds(bounds_.width() + bounds_delta_.x(), |
| 1175 bounds_.height() + bounds_delta_.y()); |
| 1173 | 1176 |
| 1174 float scale_factor = 1.f; | 1177 float scale_factor = 1.f; |
| 1175 for (LayerImpl const* current_layer = this; | 1178 for (LayerImpl const* current_layer = this; |
| 1176 current_layer != scroll_clip_layer_; | 1179 current_layer != scroll_clip_layer_; |
| 1177 current_layer = current_layer->parent()) { | 1180 current_layer = current_layer->parent()) { |
| 1178 DCHECK(current_layer); | 1181 DCHECK(current_layer); |
| 1179 float current_layer_scale = 1.f; | 1182 float current_layer_scale = 1.f; |
| 1180 | 1183 |
| 1181 const gfx::Transform& layer_transform = current_layer->transform(); | 1184 const gfx::Transform& layer_transform = current_layer->transform(); |
| 1182 if (current_layer == page_scale_layer) { | 1185 if (current_layer == page_scale_layer) { |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1555 } | 1558 } |
| 1556 | 1559 |
| 1557 void LayerImpl::NotifyAnimationFinished( | 1560 void LayerImpl::NotifyAnimationFinished( |
| 1558 base::TimeTicks monotonic_time, | 1561 base::TimeTicks monotonic_time, |
| 1559 Animation::TargetProperty target_property) { | 1562 Animation::TargetProperty target_property) { |
| 1560 if (target_property == Animation::ScrollOffset) | 1563 if (target_property == Animation::ScrollOffset) |
| 1561 layer_tree_impl_->InputScrollAnimationFinished(); | 1564 layer_tree_impl_->InputScrollAnimationFinished(); |
| 1562 } | 1565 } |
| 1563 | 1566 |
| 1564 } // namespace cc | 1567 } // namespace cc |
| OLD | NEW |