| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 10356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10367 ->scroll_tree.GetScrollOffsetBaseForTesting( | 10367 ->scroll_tree.GetScrollOffsetBaseForTesting( |
| 10368 last_scrolled_layer->id()); | 10368 last_scrolled_layer->id()); |
| 10369 pending_tree->property_trees()->needs_rebuild = true; | 10369 pending_tree->property_trees()->needs_rebuild = true; |
| 10370 pending_tree->BuildPropertyTreesForTesting(); | 10370 pending_tree->BuildPropertyTreesForTesting(); |
| 10371 pending_tree->property_trees() | 10371 pending_tree->property_trees() |
| 10372 ->scroll_tree.UpdateScrollOffsetBaseForTesting( | 10372 ->scroll_tree.UpdateScrollOffsetBaseForTesting( |
| 10373 last_scrolled_layer->id(), pending_base); | 10373 last_scrolled_layer->id(), pending_base); |
| 10374 | 10374 |
| 10375 pending_tree->set_needs_update_draw_properties(); | 10375 pending_tree->set_needs_update_draw_properties(); |
| 10376 pending_tree->UpdateDrawProperties(false); | 10376 pending_tree->UpdateDrawProperties(false); |
| 10377 float jitter = | 10377 float jitter = LayerTreeHostCommon::CalculateLayerJitter(content_layer); |
| 10378 LayerTreeHostCommon::CalculateFrameJitter(last_scrolled_layer); | |
| 10379 // There should not be any jitter measured till we hit the fixed point hits | 10378 // There should not be any jitter measured till we hit the fixed point hits |
| 10380 // threshold. | 10379 // threshold. |
| 10381 float expected_jitter = | 10380 float expected_jitter = |
| 10382 (i == pending_tree->kFixedPointHitsThreshold) ? 500 : 0; | 10381 (i == pending_tree->kFixedPointHitsThreshold) ? 500 : 0; |
| 10383 EXPECT_EQ(jitter, expected_jitter); | 10382 EXPECT_EQ(jitter, expected_jitter); |
| 10384 } | 10383 } |
| 10385 } | 10384 } |
| 10386 | 10385 |
| 10387 } // namespace | 10386 } // namespace |
| 10388 } // namespace cc | 10387 } // namespace cc |
| OLD | NEW |