OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 3200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3211 InputHandler::NonBubblingGesture)); | 3211 InputHandler::NonBubblingGesture)); |
3212 EXPECT_EQ(InputHandler::ScrollStarted, host_impl_->FlingScrollBegin()); | 3212 EXPECT_EQ(InputHandler::ScrollStarted, host_impl_->FlingScrollBegin()); |
3213 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0, 20)); | 3213 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0, 20)); |
3214 EXPECT_EQ(gfx::Vector2dF(0.000000f, 17.699997f).ToString(), | 3214 EXPECT_EQ(gfx::Vector2dF(0.000000f, 17.699997f).ToString(), |
3215 host_impl_->accumulated_root_overscroll().ToString()); | 3215 host_impl_->accumulated_root_overscroll().ToString()); |
3216 | 3216 |
3217 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0.02f, -0.01f)); | 3217 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0.02f, -0.01f)); |
3218 EXPECT_EQ(gfx::Vector2dF(0.000000f, 17.699997f).ToString(), | 3218 EXPECT_EQ(gfx::Vector2dF(0.000000f, 17.699997f).ToString(), |
3219 host_impl_->accumulated_root_overscroll().ToString()); | 3219 host_impl_->accumulated_root_overscroll().ToString()); |
3220 host_impl_->ScrollEnd(); | 3220 host_impl_->ScrollEnd(); |
| 3221 // TestCase to check kEpsilon, which prevents minute values to trigger |
| 3222 // gloweffect without reaching edge. |
| 3223 EXPECT_EQ(InputHandler::ScrollStarted, |
| 3224 host_impl_->ScrollBegin(gfx::Point(0, 0), InputHandler::Wheel)); |
| 3225 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(-0.12f, 0.1f)); |
| 3226 EXPECT_EQ(gfx::Vector2dF().ToString(), |
| 3227 host_impl_->accumulated_root_overscroll().ToString()); |
| 3228 host_impl_->ScrollEnd(); |
3221 } | 3229 } |
3222 } | 3230 } |
3223 | 3231 |
3224 class BlendStateCheckLayer : public LayerImpl { | 3232 class BlendStateCheckLayer : public LayerImpl { |
3225 public: | 3233 public: |
3226 static scoped_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl, | 3234 static scoped_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl, |
3227 int id, | 3235 int id, |
3228 ResourceProvider* resource_provider) { | 3236 ResourceProvider* resource_provider) { |
3229 return scoped_ptr<LayerImpl>(new BlendStateCheckLayer(tree_impl, | 3237 return scoped_ptr<LayerImpl>(new BlendStateCheckLayer(tree_impl, |
3230 id, | 3238 id, |
(...skipping 3033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6264 EXPECT_EQ(host_impl_->global_tile_state().hard_memory_limit_in_bytes, | 6272 EXPECT_EQ(host_impl_->global_tile_state().hard_memory_limit_in_bytes, |
6265 300u * 1024u * 1024u); | 6273 300u * 1024u * 1024u); |
6266 EXPECT_EQ(host_impl_->global_tile_state().soft_memory_limit_in_bytes, | 6274 EXPECT_EQ(host_impl_->global_tile_state().soft_memory_limit_in_bytes, |
6267 150u * 1024u * 1024u); | 6275 150u * 1024u * 1024u); |
6268 EXPECT_EQ(host_impl_->global_tile_state().unused_memory_limit_in_bytes, | 6276 EXPECT_EQ(host_impl_->global_tile_state().unused_memory_limit_in_bytes, |
6269 75u * 1024u * 1024u); | 6277 75u * 1024u * 1024u); |
6270 } | 6278 } |
6271 | 6279 |
6272 } // namespace | 6280 } // namespace |
6273 } // namespace cc | 6281 } // namespace cc |
OLD | NEW |