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

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

Issue 1983543002: cc : Fix bug in LayerToPropertyTreeIndices map (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | cc/trees/property_tree_builder.cc » ('j') | 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.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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 break; 713 break;
714 case 3: 714 case 3:
715 // child_ should not create any property tree node. 715 // child_ should not create any property tree node.
716 child_->SetForceRenderSurfaceForTesting(false); 716 child_->SetForceRenderSurfaceForTesting(false);
717 child_->SetScrollClipLayerId(Layer::INVALID_ID); 717 child_->SetScrollClipLayerId(Layer::INVALID_ID);
718 } 718 }
719 } 719 }
720 720
721 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { 721 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
722 PropertyTrees* property_trees = impl->sync_tree()->property_trees(); 722 PropertyTrees* property_trees = impl->sync_tree()->property_trees();
723 auto root_transform_id_to_index =
724 property_trees->transform_id_to_index_map.find(root_->id());
725 auto child_transform_id_to_index =
726 property_trees->transform_id_to_index_map.find(child_->id());
727 auto root_effect_id_to_index =
728 property_trees->effect_id_to_index_map.find(root_->id());
729 auto child_effect_id_to_index =
730 property_trees->effect_id_to_index_map.find(child_->id());
731 auto root_clip_id_to_index =
732 property_trees->clip_id_to_index_map.find(root_->id());
733 auto child_clip_id_to_index =
734 property_trees->clip_id_to_index_map.find(child_->id());
735 auto root_scroll_id_to_index =
736 property_trees->scroll_id_to_index_map.find(root_->id());
737 auto child_scroll_id_to_index =
738 property_trees->scroll_id_to_index_map.find(child_->id());
723 switch (impl->sync_tree()->source_frame_number()) { 739 switch (impl->sync_tree()->source_frame_number()) {
724 case 0: 740 case 0:
725 // root_ should create every property tree node and child_ should not 741 // root_ should create every property tree node and child_ should not
726 // create any. 742 // create any.
727 EXPECT_NE(property_trees->transform_id_to_index_map.find(root_->id()), 743 EXPECT_NE(root_transform_id_to_index,
728 property_trees->transform_id_to_index_map.end()); 744 property_trees->transform_id_to_index_map.end());
729 EXPECT_NE(property_trees->effect_id_to_index_map.find(root_->id()), 745 EXPECT_EQ(root_transform_id_to_index->second,
746 root_->transform_tree_index());
747 EXPECT_NE(root_effect_id_to_index,
730 property_trees->effect_id_to_index_map.end()); 748 property_trees->effect_id_to_index_map.end());
731 EXPECT_NE(property_trees->clip_id_to_index_map.find(root_->id()), 749 EXPECT_EQ(root_effect_id_to_index->second, root_->effect_tree_index());
750 EXPECT_NE(root_clip_id_to_index,
732 property_trees->clip_id_to_index_map.end()); 751 property_trees->clip_id_to_index_map.end());
733 EXPECT_NE(property_trees->scroll_id_to_index_map.find(root_->id()), 752 EXPECT_EQ(root_clip_id_to_index->second, root_->clip_tree_index());
753 EXPECT_NE(root_scroll_id_to_index,
734 property_trees->scroll_id_to_index_map.end()); 754 property_trees->scroll_id_to_index_map.end());
735 EXPECT_EQ(property_trees->transform_id_to_index_map.find(child_->id()), 755 EXPECT_EQ(root_scroll_id_to_index->second, root_->scroll_tree_index());
756 EXPECT_EQ(child_transform_id_to_index,
736 property_trees->transform_id_to_index_map.end()); 757 property_trees->transform_id_to_index_map.end());
737 EXPECT_EQ(property_trees->effect_id_to_index_map.find(child_->id()), 758 EXPECT_EQ(child_effect_id_to_index,
738 property_trees->effect_id_to_index_map.end()); 759 property_trees->effect_id_to_index_map.end());
739 EXPECT_EQ(property_trees->clip_id_to_index_map.find(child_->id()), 760 EXPECT_EQ(child_clip_id_to_index,
740 property_trees->clip_id_to_index_map.end()); 761 property_trees->clip_id_to_index_map.end());
741 EXPECT_EQ(property_trees->scroll_id_to_index_map.find(child_->id()), 762 EXPECT_EQ(child_scroll_id_to_index,
742 property_trees->scroll_id_to_index_map.end()); 763 property_trees->scroll_id_to_index_map.end());
743 break; 764 break;
744 case 1: 765 case 1:
745 // child_ should create a transfrom, clip, effect nodes but not a scroll 766 // child_ should create a transfrom, clip, effect nodes but not a scroll
746 // node. 767 // node.
747 EXPECT_NE(property_trees->transform_id_to_index_map.find(child_->id()), 768 EXPECT_NE(property_trees->transform_id_to_index_map.find(child_->id()),
748 property_trees->transform_id_to_index_map.end()); 769 property_trees->transform_id_to_index_map.end());
770 EXPECT_EQ(child_transform_id_to_index->second,
771 child_->transform_tree_index());
749 EXPECT_NE(property_trees->effect_id_to_index_map.find(child_->id()), 772 EXPECT_NE(property_trees->effect_id_to_index_map.find(child_->id()),
750 property_trees->effect_id_to_index_map.end()); 773 property_trees->effect_id_to_index_map.end());
774 EXPECT_EQ(child_effect_id_to_index->second,
775 child_->effect_tree_index());
751 EXPECT_NE(property_trees->clip_id_to_index_map.find(child_->id()), 776 EXPECT_NE(property_trees->clip_id_to_index_map.find(child_->id()),
752 property_trees->clip_id_to_index_map.end()); 777 property_trees->clip_id_to_index_map.end());
778 EXPECT_EQ(child_clip_id_to_index->second, child_->clip_tree_index());
753 EXPECT_EQ(property_trees->scroll_id_to_index_map.find(child_->id()), 779 EXPECT_EQ(property_trees->scroll_id_to_index_map.find(child_->id()),
754 property_trees->scroll_id_to_index_map.end()); 780 property_trees->scroll_id_to_index_map.end());
755 break; 781 break;
756 case 2: 782 case 2:
757 // child_ should create a scroll node. 783 // child_ should create a scroll node.
758 EXPECT_NE(property_trees->scroll_id_to_index_map.find(child_->id()), 784 EXPECT_NE(property_trees->scroll_id_to_index_map.find(child_->id()),
759 property_trees->scroll_id_to_index_map.end()); 785 property_trees->scroll_id_to_index_map.end());
786 EXPECT_EQ(child_scroll_id_to_index->second,
787 child_->scroll_tree_index());
760 break; 788 break;
761 case 3: 789 case 3:
762 // child_ should not create any property tree nodes. 790 // child_ should not create any property tree nodes.
763 EXPECT_EQ(property_trees->transform_id_to_index_map.find(child_->id()), 791 EXPECT_EQ(property_trees->transform_id_to_index_map.find(child_->id()),
764 property_trees->transform_id_to_index_map.end()); 792 property_trees->transform_id_to_index_map.end());
765 EXPECT_EQ(property_trees->effect_id_to_index_map.find(child_->id()), 793 EXPECT_EQ(property_trees->effect_id_to_index_map.find(child_->id()),
766 property_trees->effect_id_to_index_map.end()); 794 property_trees->effect_id_to_index_map.end());
767 EXPECT_EQ(property_trees->clip_id_to_index_map.find(child_->id()), 795 EXPECT_EQ(property_trees->clip_id_to_index_map.find(child_->id()),
768 property_trees->clip_id_to_index_map.end()); 796 property_trees->clip_id_to_index_map.end());
769 EXPECT_EQ(property_trees->scroll_id_to_index_map.find(child_->id()), 797 EXPECT_EQ(property_trees->scroll_id_to_index_map.find(child_->id()),
(...skipping 5801 matching lines...) Expand 10 before | Expand all | Expand 10 after
6571 EndTest(); 6599 EndTest();
6572 } 6600 }
6573 6601
6574 void AfterTest() override {} 6602 void AfterTest() override {}
6575 }; 6603 };
6576 6604
6577 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); 6605 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor);
6578 6606
6579 } // namespace 6607 } // namespace
6580 } // namespace cc 6608 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698