Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 1840883002: cc : Calculate jitter without using layer hierarchy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_common.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698