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

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

Issue 2616353003: Clarify property tree id-to-index map names. (Closed)
Patch Set: Created 3 years, 11 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 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.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 case 3: 816 case 3:
817 // child_ should not create any property tree node. 817 // child_ should not create any property tree node.
818 child_->SetForceRenderSurfaceForTesting(false); 818 child_->SetForceRenderSurfaceForTesting(false);
819 child_->SetScrollClipLayerId(Layer::INVALID_ID); 819 child_->SetScrollClipLayerId(Layer::INVALID_ID);
820 } 820 }
821 } 821 }
822 822
823 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { 823 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
824 PropertyTrees* property_trees = impl->sync_tree()->property_trees(); 824 PropertyTrees* property_trees = impl->sync_tree()->property_trees();
825 auto root_transform_id_to_index = 825 auto root_transform_id_to_index =
826 property_trees->transform_id_to_index_map.find(root_->id()); 826 property_trees->layer_id_to_transform_node_index.find(root_->id());
827 auto child_transform_id_to_index = 827 auto child_transform_id_to_index =
828 property_trees->transform_id_to_index_map.find(child_->id()); 828 property_trees->layer_id_to_transform_node_index.find(child_->id());
829 auto root_effect_id_to_index = 829 auto root_effect_id_to_index =
830 property_trees->effect_id_to_index_map.find(root_->id()); 830 property_trees->layer_id_to_effect_node_index.find(root_->id());
831 auto child_effect_id_to_index = 831 auto child_effect_id_to_index =
832 property_trees->effect_id_to_index_map.find(child_->id()); 832 property_trees->layer_id_to_effect_node_index.find(child_->id());
833 auto root_clip_id_to_index = 833 auto root_clip_id_to_index =
834 property_trees->clip_id_to_index_map.find(root_->id()); 834 property_trees->layer_id_to_clip_node_index.find(root_->id());
835 auto child_clip_id_to_index = 835 auto child_clip_id_to_index =
836 property_trees->clip_id_to_index_map.find(child_->id()); 836 property_trees->layer_id_to_clip_node_index.find(child_->id());
837 auto root_scroll_id_to_index = 837 auto root_scroll_id_to_index =
838 property_trees->scroll_id_to_index_map.find(root_->id()); 838 property_trees->layer_id_to_scroll_node_index.find(root_->id());
839 auto child_scroll_id_to_index = 839 auto child_scroll_id_to_index =
840 property_trees->scroll_id_to_index_map.find(child_->id()); 840 property_trees->layer_id_to_scroll_node_index.find(child_->id());
841 switch (impl->sync_tree()->source_frame_number()) { 841 switch (impl->sync_tree()->source_frame_number()) {
842 case 0: 842 case 0:
843 // root_ should create every property tree node and child_ should not 843 // root_ should create every property tree node and child_ should not
844 // create any. 844 // create any.
845 EXPECT_NE(root_transform_id_to_index, 845 EXPECT_NE(root_transform_id_to_index,
846 property_trees->transform_id_to_index_map.end()); 846 property_trees->layer_id_to_transform_node_index.end());
847 EXPECT_EQ(root_transform_id_to_index->second, 847 EXPECT_EQ(root_transform_id_to_index->second,
848 root_->transform_tree_index()); 848 root_->transform_tree_index());
849 EXPECT_NE(root_effect_id_to_index, 849 EXPECT_NE(root_effect_id_to_index,
850 property_trees->effect_id_to_index_map.end()); 850 property_trees->layer_id_to_effect_node_index.end());
851 EXPECT_EQ(root_effect_id_to_index->second, root_->effect_tree_index()); 851 EXPECT_EQ(root_effect_id_to_index->second, root_->effect_tree_index());
852 EXPECT_NE(root_clip_id_to_index, 852 EXPECT_NE(root_clip_id_to_index,
853 property_trees->clip_id_to_index_map.end()); 853 property_trees->layer_id_to_clip_node_index.end());
854 EXPECT_EQ(root_clip_id_to_index->second, root_->clip_tree_index()); 854 EXPECT_EQ(root_clip_id_to_index->second, root_->clip_tree_index());
855 EXPECT_NE(root_scroll_id_to_index, 855 EXPECT_NE(root_scroll_id_to_index,
856 property_trees->scroll_id_to_index_map.end()); 856 property_trees->layer_id_to_scroll_node_index.end());
857 EXPECT_EQ(root_scroll_id_to_index->second, root_->scroll_tree_index()); 857 EXPECT_EQ(root_scroll_id_to_index->second, root_->scroll_tree_index());
858 EXPECT_EQ(child_transform_id_to_index, 858 EXPECT_EQ(child_transform_id_to_index,
859 property_trees->transform_id_to_index_map.end()); 859 property_trees->layer_id_to_transform_node_index.end());
860 EXPECT_EQ(child_effect_id_to_index, 860 EXPECT_EQ(child_effect_id_to_index,
861 property_trees->effect_id_to_index_map.end()); 861 property_trees->layer_id_to_effect_node_index.end());
862 EXPECT_EQ(child_clip_id_to_index, 862 EXPECT_EQ(child_clip_id_to_index,
863 property_trees->clip_id_to_index_map.end()); 863 property_trees->layer_id_to_clip_node_index.end());
864 EXPECT_EQ(child_scroll_id_to_index, 864 EXPECT_EQ(child_scroll_id_to_index,
865 property_trees->scroll_id_to_index_map.end()); 865 property_trees->layer_id_to_scroll_node_index.end());
866 break; 866 break;
867 case 1: 867 case 1:
868 // child_ should create a transfrom, clip, effect nodes but not a scroll 868 // child_ should create a transfrom, clip, effect nodes but not a scroll
869 // node. 869 // node.
870 EXPECT_NE(property_trees->transform_id_to_index_map.find(child_->id()), 870 EXPECT_NE(
871 property_trees->transform_id_to_index_map.end()); 871 property_trees->layer_id_to_transform_node_index.find(child_->id()),
872 property_trees->layer_id_to_transform_node_index.end());
872 EXPECT_EQ(child_transform_id_to_index->second, 873 EXPECT_EQ(child_transform_id_to_index->second,
873 child_->transform_tree_index()); 874 child_->transform_tree_index());
874 EXPECT_NE(property_trees->effect_id_to_index_map.find(child_->id()), 875 EXPECT_NE(
875 property_trees->effect_id_to_index_map.end()); 876 property_trees->layer_id_to_effect_node_index.find(child_->id()),
877 property_trees->layer_id_to_effect_node_index.end());
876 EXPECT_EQ(child_effect_id_to_index->second, 878 EXPECT_EQ(child_effect_id_to_index->second,
877 child_->effect_tree_index()); 879 child_->effect_tree_index());
878 EXPECT_NE(property_trees->clip_id_to_index_map.find(child_->id()), 880 EXPECT_NE(
879 property_trees->clip_id_to_index_map.end()); 881 property_trees->layer_id_to_clip_node_index.find(child_->id()),
882 property_trees->layer_id_to_clip_node_index.end());
880 EXPECT_EQ(child_clip_id_to_index->second, child_->clip_tree_index()); 883 EXPECT_EQ(child_clip_id_to_index->second, child_->clip_tree_index());
881 EXPECT_EQ(property_trees->scroll_id_to_index_map.find(child_->id()), 884 EXPECT_EQ(
882 property_trees->scroll_id_to_index_map.end()); 885 property_trees->layer_id_to_scroll_node_index.find(child_->id()),
886 property_trees->layer_id_to_scroll_node_index.end());
883 break; 887 break;
884 case 2: 888 case 2:
885 // child_ should create a scroll node. 889 // child_ should create a scroll node.
886 EXPECT_NE(property_trees->scroll_id_to_index_map.find(child_->id()), 890 EXPECT_NE(
887 property_trees->scroll_id_to_index_map.end()); 891 property_trees->layer_id_to_scroll_node_index.find(child_->id()),
892 property_trees->layer_id_to_scroll_node_index.end());
888 EXPECT_EQ(child_scroll_id_to_index->second, 893 EXPECT_EQ(child_scroll_id_to_index->second,
889 child_->scroll_tree_index()); 894 child_->scroll_tree_index());
890 break; 895 break;
891 case 3: 896 case 3:
892 // child_ should not create any property tree nodes. 897 // child_ should not create any property tree nodes.
893 EXPECT_EQ(property_trees->transform_id_to_index_map.find(child_->id()), 898 EXPECT_EQ(
894 property_trees->transform_id_to_index_map.end()); 899 property_trees->layer_id_to_transform_node_index.find(child_->id()),
895 EXPECT_EQ(property_trees->effect_id_to_index_map.find(child_->id()), 900 property_trees->layer_id_to_transform_node_index.end());
896 property_trees->effect_id_to_index_map.end()); 901 EXPECT_EQ(
897 EXPECT_EQ(property_trees->clip_id_to_index_map.find(child_->id()), 902 property_trees->layer_id_to_effect_node_index.find(child_->id()),
898 property_trees->clip_id_to_index_map.end()); 903 property_trees->layer_id_to_effect_node_index.end());
899 EXPECT_EQ(property_trees->scroll_id_to_index_map.find(child_->id()), 904 EXPECT_EQ(
900 property_trees->scroll_id_to_index_map.end()); 905 property_trees->layer_id_to_clip_node_index.find(child_->id()),
906 property_trees->layer_id_to_clip_node_index.end());
907 EXPECT_EQ(
908 property_trees->layer_id_to_scroll_node_index.find(child_->id()),
909 property_trees->layer_id_to_scroll_node_index.end());
901 910
902 EndTest(); 911 EndTest();
903 break; 912 break;
904 } 913 }
905 } 914 }
906 915
907 void AfterTest() override {} 916 void AfterTest() override {}
908 917
909 private: 918 private:
910 scoped_refptr<Layer> root_; 919 scoped_refptr<Layer> root_;
(...skipping 6163 matching lines...) Expand 10 before | Expand all | Expand 10 after
7074 EndTest(); 7083 EndTest();
7075 } 7084 }
7076 7085
7077 void AfterTest() override {} 7086 void AfterTest() override {}
7078 }; 7087 };
7079 7088
7080 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSubmitFrameResources); 7089 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSubmitFrameResources);
7081 7090
7082 } // namespace 7091 } // namespace
7083 } // namespace cc 7092 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698