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

Side by Side Diff: cc/layers/scrollbar_layer_unittest.cc

Issue 2762123004: cc: LayerTreeHostImpl uses element id to tick animations (Closed)
Patch Set: review comments Created 3 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
OLDNEW
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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <unordered_map> 7 #include <unordered_map>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 node = layer_tree_impl->property_trees()->effect_tree.Node( 620 node = layer_tree_impl->property_trees()->effect_tree.Node(
621 scrollbar_layer->effect_tree_index()); 621 scrollbar_layer->effect_tree_index());
622 EXPECT_EQ(node->opacity, 0.f); 622 EXPECT_EQ(node->opacity, 0.f);
623 host_impl->ActivateSyncTree(); 623 host_impl->ActivateSyncTree();
624 layer_tree_impl = host_impl->active_tree(); 624 layer_tree_impl = host_impl->active_tree();
625 node = layer_tree_impl->property_trees()->effect_tree.Node( 625 node = layer_tree_impl->property_trees()->effect_tree.Node(
626 scrollbar_layer->effect_tree_index()); 626 scrollbar_layer->effect_tree_index());
627 EXPECT_EQ(node->opacity, 0.f); 627 EXPECT_EQ(node->opacity, 0.f);
628 628
629 // This tests that activation does not change the opacity of scrollbar layer. 629 // This tests that activation does not change the opacity of scrollbar layer.
630 LayerImpl* scrollbar_layer_impl = 630 ScrollbarLayerImplBase* scrollbar_layer_impl =
631 layer_tree_impl->LayerById(scrollbar_layer->id()); 631 static_cast<ScrollbarLayerImplBase*>(
632 layer_tree_impl->property_trees()->effect_tree.OnOpacityAnimated( 632 layer_tree_impl->LayerById(scrollbar_layer->id()));
633 0.25f, scrollbar_layer_impl->effect_tree_index(), layer_tree_impl); 633 scrollbar_layer_impl->SetOverlayScrollbarLayerOpacityAnimated(0.25f);
634 host_impl->CreatePendingTree(); 634 host_impl->CreatePendingTree();
635 layer_impl_tree_root = layer_tree_host_->CommitAndCreatePendingTree(); 635 layer_impl_tree_root = layer_tree_host_->CommitAndCreatePendingTree();
636 layer_tree_impl = layer_impl_tree_root->layer_tree_impl(); 636 layer_tree_impl = layer_impl_tree_root->layer_tree_impl();
637 EXPECT_TRUE(layer_tree_impl->IsPendingTree()); 637 EXPECT_TRUE(layer_tree_impl->IsPendingTree());
638 node = layer_tree_impl->property_trees()->effect_tree.Node( 638 node = layer_tree_impl->property_trees()->effect_tree.Node(
639 scrollbar_layer->effect_tree_index()); 639 scrollbar_layer->effect_tree_index());
640 EXPECT_EQ(node->opacity, 0.f); 640 EXPECT_EQ(node->opacity, 0.f);
641 host_impl->ActivateSyncTree(); 641 host_impl->ActivateSyncTree();
642 layer_tree_impl = host_impl->active_tree(); 642 layer_tree_impl = host_impl->active_tree();
643 node = layer_tree_impl->property_trees()->effect_tree.Node( 643 node = layer_tree_impl->property_trees()->effect_tree.Node(
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); 1165 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f);
1166 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); 1166 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f);
1167 1167
1168 // Horizontal Scrollbars. 1168 // Horizontal Scrollbars.
1169 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); 1169 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f);
1170 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); 1170 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f);
1171 } 1171 }
1172 1172
1173 } // namespace 1173 } // namespace
1174 } // namespace cc 1174 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698