| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/browser/android/overscroll_glow.h" | 5 #include "content/browser/android/overscroll_glow.h" |
| 6 | 6 |
| 7 #include "cc/layers/layer.h" | 7 #include "cc/layers/layer.h" |
| 8 #include "content/browser/android/edge_effect_base.h" | 8 #include "content/browser/android/edge_effect_base.h" |
| 9 | 9 |
| 10 using std::max; | 10 using std::max; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 Edge edge = static_cast<Edge>(i); | 160 Edge edge = static_cast<Edge>(i); |
| 161 edge_effects_[i]->ApplyToLayers( | 161 edge_effects_[i]->ApplyToLayers( |
| 162 ComputeSize(edge, viewport_size_), | 162 ComputeSize(edge, viewport_size_), |
| 163 ComputeTransform(edge, viewport_size_, edge_offsets_[i])); | 163 ComputeTransform(edge, viewport_size_, edge_offsets_[i])); |
| 164 } | 164 } |
| 165 } | 165 } |
| 166 | 166 |
| 167 return CheckNeedsAnimate(); | 167 return CheckNeedsAnimate(); |
| 168 } | 168 } |
| 169 | 169 |
| 170 void OverscrollGlow::UpdateDisplay( | 170 void OverscrollGlow::OnFrameUpdated( |
| 171 const gfx::SizeF& viewport_size, | 171 const gfx::SizeF& viewport_size, |
| 172 const gfx::SizeF& content_size, | 172 const gfx::SizeF& content_size, |
| 173 const gfx::Vector2dF& content_scroll_offset) { | 173 const gfx::Vector2dF& content_scroll_offset) { |
| 174 viewport_size_ = viewport_size; | 174 viewport_size_ = viewport_size; |
| 175 edge_offsets_[OverscrollGlow::EDGE_TOP] = -content_scroll_offset.y(); | 175 edge_offsets_[OverscrollGlow::EDGE_TOP] = -content_scroll_offset.y(); |
| 176 edge_offsets_[OverscrollGlow::EDGE_LEFT] = -content_scroll_offset.x(); | 176 edge_offsets_[OverscrollGlow::EDGE_LEFT] = -content_scroll_offset.x(); |
| 177 edge_offsets_[OverscrollGlow::EDGE_BOTTOM] = content_size.height() - | 177 edge_offsets_[OverscrollGlow::EDGE_BOTTOM] = content_size.height() - |
| 178 content_scroll_offset.y() - | 178 content_scroll_offset.y() - |
| 179 viewport_size.height(); | 179 viewport_size.height(); |
| 180 edge_offsets_[OverscrollGlow::EDGE_RIGHT] = | 180 edge_offsets_[OverscrollGlow::EDGE_RIGHT] = |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 for (size_t i = 0; i < EDGE_COUNT; ++i) | 297 for (size_t i = 0; i < EDGE_COUNT; ++i) |
| 298 edge_effects_[i]->Release(current_time); | 298 edge_effects_[i]->Release(current_time); |
| 299 } | 299 } |
| 300 | 300 |
| 301 EdgeEffectBase* OverscrollGlow::GetOppositeEdge(int edge_index) { | 301 EdgeEffectBase* OverscrollGlow::GetOppositeEdge(int edge_index) { |
| 302 DCHECK(initialized_); | 302 DCHECK(initialized_); |
| 303 return edge_effects_[(edge_index + 2) % EDGE_COUNT].get(); | 303 return edge_effects_[(edge_index + 2) % EDGE_COUNT].get(); |
| 304 } | 304 } |
| 305 | 305 |
| 306 } // namespace content | 306 } // namespace content |
| OLD | NEW |