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

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

Issue 2080223010: cc: Clean up root_layer code in LTI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase++ Created 4 years, 5 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 DRAWS_CONTENT, 610 DRAWS_CONTENT,
611 DONE, 611 DONE,
612 }; 612 };
613 613
614 void BeginTest() override { 614 void BeginTest() override {
615 index_ = STARTUP; 615 index_ = STARTUP;
616 PostSetNeedsCommitToMainThread(); 616 PostSetNeedsCommitToMainThread();
617 } 617 }
618 618
619 void DrawLayersOnThread(LayerTreeHostImpl* impl) override { 619 void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
620 VerifyAfterValues(impl->active_tree()->root_layer()); 620 VerifyAfterValues(impl->active_tree()->root_layer_for_testing());
621 } 621 }
622 622
623 void DidCommitAndDrawFrame() override { 623 void DidCommitAndDrawFrame() override {
624 SetBeforeValues(layer_tree_host()->root_layer()); 624 SetBeforeValues(layer_tree_host()->root_layer());
625 VerifyBeforeValues(layer_tree_host()->root_layer()); 625 VerifyBeforeValues(layer_tree_host()->root_layer());
626 626
627 ++index_; 627 ++index_;
628 if (index_ == DONE) { 628 if (index_ == DONE) {
629 EndTest(); 629 EndTest();
630 return; 630 return;
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 scoped_refptr<Layer> replica_layer = Layer::Create(); 831 scoped_refptr<Layer> replica_layer = Layer::Create();
832 layer_tree_host()->root_layer()->SetReplicaLayer(replica_layer.get()); 832 layer_tree_host()->root_layer()->SetReplicaLayer(replica_layer.get());
833 break; 833 break;
834 } 834 }
835 } 835 }
836 836
837 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { 837 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
838 switch (index_) { 838 switch (index_) {
839 case 0: 839 case 0:
840 impl->sync_tree()->ResetAllChangeTracking(); 840 impl->sync_tree()->ResetAllChangeTracking();
841 EXPECT_FALSE(impl->sync_tree()->root_layer()->LayerPropertyChanged()); 841 EXPECT_FALSE(impl->sync_tree()
842 ->root_layer_for_testing()
843 ->LayerPropertyChanged());
842 PostSetNeedsCommitToMainThread(); 844 PostSetNeedsCommitToMainThread();
843 index_++; 845 index_++;
844 break; 846 break;
845 case 1: 847 case 1:
846 EXPECT_TRUE(impl->sync_tree()->root_layer()->LayerPropertyChanged()); 848 EXPECT_TRUE(impl->sync_tree()
849 ->root_layer_for_testing()
850 ->LayerPropertyChanged());
847 EndTest(); 851 EndTest();
848 break; 852 break;
849 } 853 }
850 } 854 }
851 855
852 void AfterTest() override {} 856 void AfterTest() override {}
853 857
854 int index_; 858 int index_;
855 }; 859 };
856 860
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 } 897 }
894 } 898 }
895 899
896 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { 900 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
897 gfx::Transform transform; 901 gfx::Transform transform;
898 FilterOperations filters; 902 FilterOperations filters;
899 switch (static_cast<Animations>(index_)) { 903 switch (static_cast<Animations>(index_)) {
900 case OPACITY: 904 case OPACITY:
901 index_++; 905 index_++;
902 impl->active_tree()->ResetAllChangeTracking(); 906 impl->active_tree()->ResetAllChangeTracking();
903 impl->active_tree()->root_layer()->OnOpacityAnimated(0.5f); 907 impl->active_tree()->root_layer_for_testing()->OnOpacityAnimated(0.5f);
904 PostSetNeedsCommitToMainThread(); 908 PostSetNeedsCommitToMainThread();
905 break; 909 break;
906 case TRANSFORM: 910 case TRANSFORM:
907 index_++; 911 index_++;
908 EXPECT_TRUE(impl->active_tree() 912 EXPECT_TRUE(impl->active_tree()
909 ->LayerById(root_->id()) 913 ->LayerById(root_->id())
910 ->LayerPropertyChanged()); 914 ->LayerPropertyChanged());
911 impl->active_tree()->ResetAllChangeTracking(); 915 impl->active_tree()->ResetAllChangeTracking();
912 EXPECT_FALSE(impl->active_tree() 916 EXPECT_FALSE(impl->active_tree()
913 ->LayerById(root_->id()) 917 ->LayerById(root_->id())
914 ->LayerPropertyChanged()); 918 ->LayerPropertyChanged());
915 EXPECT_FALSE(impl->active_tree() 919 EXPECT_FALSE(impl->active_tree()
916 ->LayerById(child_->id()) 920 ->LayerById(child_->id())
917 ->LayerPropertyChanged()); 921 ->LayerPropertyChanged());
918 transform.Translate(10, 10); 922 transform.Translate(10, 10);
919 impl->active_tree()->root_layer()->OnTransformAnimated(transform); 923 impl->active_tree()->root_layer_for_testing()->OnTransformAnimated(
924 transform);
920 PostSetNeedsCommitToMainThread(); 925 PostSetNeedsCommitToMainThread();
921 break; 926 break;
922 case FILTER: 927 case FILTER:
923 index_++; 928 index_++;
924 EXPECT_TRUE(impl->active_tree()->root_layer()->LayerPropertyChanged()); 929 EXPECT_TRUE(impl->active_tree()
930 ->root_layer_for_testing()
931 ->LayerPropertyChanged());
925 EXPECT_TRUE(impl->active_tree() 932 EXPECT_TRUE(impl->active_tree()
926 ->LayerById(child_->id()) 933 ->LayerById(child_->id())
927 ->LayerPropertyChanged()); 934 ->LayerPropertyChanged());
928 impl->active_tree()->ResetAllChangeTracking(); 935 impl->active_tree()->ResetAllChangeTracking();
929 EXPECT_FALSE(impl->active_tree()->root_layer()->LayerPropertyChanged()); 936 EXPECT_FALSE(impl->active_tree()
937 ->root_layer_for_testing()
938 ->LayerPropertyChanged());
930 EXPECT_FALSE(impl->active_tree() 939 EXPECT_FALSE(impl->active_tree()
931 ->LayerById(child_->id()) 940 ->LayerById(child_->id())
932 ->LayerPropertyChanged()); 941 ->LayerPropertyChanged());
933 filters.Append(FilterOperation::CreateOpacityFilter(0.5f)); 942 filters.Append(FilterOperation::CreateOpacityFilter(0.5f));
934 impl->active_tree()->root_layer()->OnFilterAnimated(filters); 943 impl->active_tree()->root_layer_for_testing()->OnFilterAnimated(
944 filters);
935 PostSetNeedsCommitToMainThread(); 945 PostSetNeedsCommitToMainThread();
936 break; 946 break;
937 case END: 947 case END:
938 EXPECT_TRUE(impl->active_tree()->root_layer()->LayerPropertyChanged()); 948 EXPECT_TRUE(impl->active_tree()
949 ->root_layer_for_testing()
950 ->LayerPropertyChanged());
939 EndTest(); 951 EndTest();
940 break; 952 break;
941 } 953 }
942 } 954 }
943 955
944 void AfterTest() override {} 956 void AfterTest() override {}
945 957
946 private: 958 private:
947 int index_; 959 int index_;
948 scoped_refptr<Layer> root_; 960 scoped_refptr<Layer> root_;
(...skipping 21 matching lines...) Expand all
970 node->data.is_currently_animating_opacity = true; 982 node->data.is_currently_animating_opacity = true;
971 break; 983 break;
972 case 2: 984 case 2:
973 node->data.is_currently_animating_opacity = false; 985 node->data.is_currently_animating_opacity = false;
974 break; 986 break;
975 } 987 }
976 } 988 }
977 989
978 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { 990 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
979 EffectTree& effect_tree = impl->sync_tree()->property_trees()->effect_tree; 991 EffectTree& effect_tree = impl->sync_tree()->property_trees()->effect_tree;
980 EffectNode* node = 992 EffectNode* node = effect_tree.Node(
981 effect_tree.Node(impl->sync_tree()->root_layer()->effect_tree_index()); 993 impl->sync_tree()->root_layer_for_testing()->effect_tree_index());
982 switch (impl->sync_tree()->source_frame_number()) { 994 switch (impl->sync_tree()->source_frame_number()) {
983 case 0: 995 case 0:
984 impl->sync_tree()->root_layer()->OnOpacityAnimated(0.75f); 996 impl->sync_tree()->root_layer_for_testing()->OnOpacityAnimated(0.75f);
985 PostSetNeedsCommitToMainThread(); 997 PostSetNeedsCommitToMainThread();
986 break; 998 break;
987 case 1: 999 case 1:
988 EXPECT_EQ(node->data.opacity, 0.75f); 1000 EXPECT_EQ(node->data.opacity, 0.75f);
989 impl->sync_tree()->root_layer()->OnOpacityAnimated(0.75f); 1001 impl->sync_tree()->root_layer_for_testing()->OnOpacityAnimated(0.75f);
990 PostSetNeedsCommitToMainThread(); 1002 PostSetNeedsCommitToMainThread();
991 break; 1003 break;
992 case 2: 1004 case 2:
993 EXPECT_EQ(node->data.opacity, 0.5f); 1005 EXPECT_EQ(node->data.opacity, 0.5f);
994 EndTest(); 1006 EndTest();
995 break; 1007 break;
996 } 1008 }
997 } 1009 }
998 1010
999 void AfterTest() override {} 1011 void AfterTest() override {}
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 case 3: 1043 case 3:
1032 node->data.is_currently_animating = false; 1044 node->data.is_currently_animating = false;
1033 break; 1045 break;
1034 } 1046 }
1035 } 1047 }
1036 1048
1037 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { 1049 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
1038 TransformTree& transform_tree = 1050 TransformTree& transform_tree =
1039 impl->sync_tree()->property_trees()->transform_tree; 1051 impl->sync_tree()->property_trees()->transform_tree;
1040 TransformNode* node = transform_tree.Node( 1052 TransformNode* node = transform_tree.Node(
1041 impl->sync_tree()->root_layer()->transform_tree_index()); 1053 impl->sync_tree()->root_layer_for_testing()->transform_tree_index());
1042 gfx::Transform rotate10; 1054 gfx::Transform rotate10;
1043 rotate10.Rotate(10.f); 1055 rotate10.Rotate(10.f);
1044 gfx::Transform rotate20; 1056 gfx::Transform rotate20;
1045 rotate20.Rotate(20.f); 1057 rotate20.Rotate(20.f);
1046 switch (impl->sync_tree()->source_frame_number()) { 1058 switch (impl->sync_tree()->source_frame_number()) {
1047 case 0: 1059 case 0:
1048 impl->sync_tree()->root_layer()->OnTransformAnimated(rotate20); 1060 impl->sync_tree()->root_layer_for_testing()->OnTransformAnimated(
1061 rotate20);
1049 PostSetNeedsCommitToMainThread(); 1062 PostSetNeedsCommitToMainThread();
1050 break; 1063 break;
1051 case 1: 1064 case 1:
1052 EXPECT_EQ(node->data.local, rotate20); 1065 EXPECT_EQ(node->data.local, rotate20);
1053 impl->sync_tree()->root_layer()->OnTransformAnimated(rotate20); 1066 impl->sync_tree()->root_layer_for_testing()->OnTransformAnimated(
1067 rotate20);
1054 PostSetNeedsCommitToMainThread(); 1068 PostSetNeedsCommitToMainThread();
1055 break; 1069 break;
1056 case 2: 1070 case 2:
1057 EXPECT_EQ(node->data.local, rotate20); 1071 EXPECT_EQ(node->data.local, rotate20);
1058 impl->sync_tree()->root_layer()->OnTransformAnimated(rotate20); 1072 impl->sync_tree()->root_layer_for_testing()->OnTransformAnimated(
1073 rotate20);
1059 PostSetNeedsCommitToMainThread(); 1074 PostSetNeedsCommitToMainThread();
1060 break; 1075 break;
1061 case 3: 1076 case 3:
1062 EXPECT_EQ(node->data.local, rotate10); 1077 EXPECT_EQ(node->data.local, rotate10);
1063 EndTest(); 1078 EndTest();
1064 } 1079 }
1065 } 1080 }
1066 1081
1067 void AfterTest() override {} 1082 void AfterTest() override {}
1068 1083
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 layer_tree_host()->root_layer()->RemoveAllChildren(); 1202 layer_tree_host()->root_layer()->RemoveAllChildren();
1188 layer_tree_host()->root_layer()->SetMaskLayer(mask_layer.get()); 1203 layer_tree_host()->root_layer()->SetMaskLayer(mask_layer.get());
1189 break; 1204 break;
1190 } 1205 }
1191 } 1206 }
1192 1207
1193 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { 1208 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
1194 switch (index_) { 1209 switch (index_) {
1195 case 0: 1210 case 0:
1196 index_++; 1211 index_++;
1197 EXPECT_FALSE( 1212 EXPECT_FALSE(impl->sync_tree()
1198 impl->sync_tree()->root_layer()->render_surface()->MaskLayer()); 1213 ->root_layer_for_testing()
1214 ->render_surface()
1215 ->MaskLayer());
1199 break; 1216 break;
1200 case 1: 1217 case 1:
1201 EXPECT_TRUE( 1218 EXPECT_TRUE(impl->sync_tree()
1202 impl->sync_tree()->root_layer()->render_surface()->MaskLayer()); 1219 ->root_layer_for_testing()
1220 ->render_surface()
1221 ->MaskLayer());
1203 EndTest(); 1222 EndTest();
1204 break; 1223 break;
1205 } 1224 }
1206 } 1225 }
1207 1226
1208 void AfterTest() override {} 1227 void AfterTest() override {}
1209 1228
1210 scoped_refptr<Layer> mask_layer; 1229 scoped_refptr<Layer> mask_layer;
1211 int index_; 1230 int index_;
1212 }; 1231 };
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 void DrawLayersOnThread(LayerTreeHostImpl* impl) override { 1358 void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
1340 if (num_draws_ < 2) { 1359 if (num_draws_ < 2) {
1341 PostSetNeedsRedrawRectToMainThread(invalid_rect_); 1360 PostSetNeedsRedrawRectToMainThread(invalid_rect_);
1342 num_draws_++; 1361 num_draws_++;
1343 } 1362 }
1344 } 1363 }
1345 1364
1346 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { 1365 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
1347 if (num_draws_ == 2) { 1366 if (num_draws_ == 2) {
1348 auto pending_tree = host_impl->pending_tree(); 1367 auto pending_tree = host_impl->pending_tree();
1349 auto pending_layer_impl = 1368 auto pending_layer_impl = static_cast<FakePictureLayerImpl*>(
1350 static_cast<FakePictureLayerImpl*>(pending_tree->root_layer()); 1369 pending_tree->root_layer_for_testing());
1351 EXPECT_NE(pending_layer_impl, nullptr); 1370 EXPECT_NE(pending_layer_impl, nullptr);
1352 1371
1353 auto active_tree = host_impl->pending_tree(); 1372 auto active_tree = host_impl->pending_tree();
1354 auto active_layer_impl = 1373 auto active_layer_impl = static_cast<FakePictureLayerImpl*>(
1355 static_cast<FakePictureLayerImpl*>(active_tree->root_layer()); 1374 active_tree->root_layer_for_testing());
1356 EXPECT_NE(pending_layer_impl, nullptr); 1375 EXPECT_NE(pending_layer_impl, nullptr);
1357 1376
1358 auto active_tiling_set = active_layer_impl->picture_layer_tiling_set(); 1377 auto active_tiling_set = active_layer_impl->picture_layer_tiling_set();
1359 auto active_tiling = active_tiling_set->tiling_at(0); 1378 auto active_tiling = active_tiling_set->tiling_at(0);
1360 auto pending_tiling_set = pending_layer_impl->picture_layer_tiling_set(); 1379 auto pending_tiling_set = pending_layer_impl->picture_layer_tiling_set();
1361 auto pending_tiling = pending_tiling_set->tiling_at(0); 1380 auto pending_tiling = pending_tiling_set->tiling_at(0);
1362 EXPECT_EQ( 1381 EXPECT_EQ(
1363 pending_tiling->TilingDataForTesting().max_texture_size().width(), 1382 pending_tiling->TilingDataForTesting().max_texture_size().width(),
1364 active_tiling->TilingDataForTesting().max_texture_size().width()); 1383 active_tiling->TilingDataForTesting().max_texture_size().width());
1365 EndTest(); 1384 EndTest();
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 } 1554 }
1536 1555
1537 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, 1556 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
1538 LayerTreeHostImpl::FrameData* frame_data, 1557 LayerTreeHostImpl::FrameData* frame_data,
1539 DrawResult draw_result) override { 1558 DrawResult draw_result) override {
1540 if (host_impl->active_tree()->source_frame_number() == 0) { 1559 if (host_impl->active_tree()->source_frame_number() == 0) {
1541 EXPECT_EQ(1.f, host_impl->active_tree()->device_scale_factor()); 1560 EXPECT_EQ(1.f, host_impl->active_tree()->device_scale_factor());
1542 } else { 1561 } else {
1543 gfx::Rect root_damage_rect = 1562 gfx::Rect root_damage_rect =
1544 frame_data->render_passes.back()->damage_rect; 1563 frame_data->render_passes.back()->damage_rect;
1545 EXPECT_EQ(gfx::Rect(host_impl->active_tree()->root_layer()->bounds()), 1564 EXPECT_EQ(
1546 root_damage_rect); 1565 gfx::Rect(
1566 host_impl->active_tree()->root_layer_for_testing()->bounds()),
1567 root_damage_rect);
1547 EXPECT_EQ(4.f, host_impl->active_tree()->device_scale_factor()); 1568 EXPECT_EQ(4.f, host_impl->active_tree()->device_scale_factor());
1548 EndTest(); 1569 EndTest();
1549 } 1570 }
1550 1571
1551 return draw_result; 1572 return draw_result;
1552 } 1573 }
1553 1574
1554 void AfterTest() override {} 1575 void AfterTest() override {}
1555 1576
1556 private: 1577 private:
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
2138 2159
2139 void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { 2160 void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
2140 // Should only do one commit. 2161 // Should only do one commit.
2141 EXPECT_EQ(0, impl->active_tree()->source_frame_number()); 2162 EXPECT_EQ(0, impl->active_tree()->source_frame_number());
2142 // Device scale factor should come over to impl. 2163 // Device scale factor should come over to impl.
2143 EXPECT_NEAR(impl->active_tree()->device_scale_factor(), 1.5f, 0.00001f); 2164 EXPECT_NEAR(impl->active_tree()->device_scale_factor(), 1.5f, 0.00001f);
2144 2165
2145 // Device viewport is scaled. 2166 // Device viewport is scaled.
2146 EXPECT_EQ(gfx::Size(60, 60), impl->DrawViewportSize()); 2167 EXPECT_EQ(gfx::Size(60, 60), impl->DrawViewportSize());
2147 2168
2148 FakePictureLayerImpl* root = 2169 FakePictureLayerImpl* root = static_cast<FakePictureLayerImpl*>(
2149 static_cast<FakePictureLayerImpl*>(impl->active_tree()->root_layer()); 2170 impl->active_tree()->root_layer_for_testing());
2150 FakePictureLayerImpl* child = static_cast<FakePictureLayerImpl*>( 2171 FakePictureLayerImpl* child = static_cast<FakePictureLayerImpl*>(
2151 impl->active_tree()->LayerById(child_layer_->id())); 2172 impl->active_tree()->LayerById(child_layer_->id()));
2152 2173
2153 // Positions remain in layout pixels. 2174 // Positions remain in layout pixels.
2154 EXPECT_EQ(gfx::PointF(), root->position()); 2175 EXPECT_EQ(gfx::PointF(), root->position());
2155 EXPECT_EQ(gfx::PointF(2.f, 2.f), child->position()); 2176 EXPECT_EQ(gfx::PointF(2.f, 2.f), child->position());
2156 2177
2157 // Compute all the layer transforms for the frame. 2178 // Compute all the layer transforms for the frame.
2158 LayerTreeHostImpl::FrameData frame_data; 2179 LayerTreeHostImpl::FrameData frame_data;
2159 impl->PrepareToDraw(&frame_data); 2180 impl->PrepareToDraw(&frame_data);
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
2428 break; 2449 break;
2429 } 2450 }
2430 } 2451 }
2431 2452
2432 void NotifyTileStateChangedOnThread(LayerTreeHostImpl* host_impl, 2453 void NotifyTileStateChangedOnThread(LayerTreeHostImpl* host_impl,
2433 const Tile* tile) override { 2454 const Tile* tile) override {
2434 ++num_tiles_rastered_; 2455 ++num_tiles_rastered_;
2435 } 2456 }
2436 2457
2437 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { 2458 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
2438 PictureLayerImpl* root_layer = 2459 PictureLayerImpl* root_layer = static_cast<PictureLayerImpl*>(
2439 static_cast<PictureLayerImpl*>(host_impl->active_tree()->root_layer()); 2460 host_impl->active_tree()->root_layer_for_testing());
2440 bool can_use_lcd_text = 2461 bool can_use_lcd_text =
2441 host_impl->active_tree()->root_layer()->CanUseLCDText(); 2462 host_impl->active_tree()->root_layer_for_testing()->CanUseLCDText();
2442 switch (host_impl->active_tree()->source_frame_number()) { 2463 switch (host_impl->active_tree()->source_frame_number()) {
2443 case 0: 2464 case 0:
2444 // The first draw. 2465 // The first draw.
2445 EXPECT_EQ(1, num_tiles_rastered_); 2466 EXPECT_EQ(1, num_tiles_rastered_);
2446 EXPECT_TRUE(can_use_lcd_text); 2467 EXPECT_TRUE(can_use_lcd_text);
2447 EXPECT_TRUE(root_layer->RasterSourceUsesLCDText()); 2468 EXPECT_TRUE(root_layer->RasterSourceUsesLCDText());
2448 break; 2469 break;
2449 case 1: 2470 case 1:
2450 // Nothing changed on the layer. 2471 // Nothing changed on the layer.
2451 EXPECT_EQ(1, num_tiles_rastered_); 2472 EXPECT_EQ(1, num_tiles_rastered_);
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
3214 // Root is swapped here. 3235 // Root is swapped here.
3215 // Clear the expected push properties the tree will be rebuilt. 3236 // Clear the expected push properties the tree will be rebuilt.
3216 expected_push_properties_root_impl_ = 0; 3237 expected_push_properties_root_impl_ = 0;
3217 expected_push_properties_child_impl_ = 0; 3238 expected_push_properties_child_impl_ = 0;
3218 expected_push_properties_grandchild_impl_ = 0; 3239 expected_push_properties_grandchild_impl_ = 0;
3219 expected_push_properties_child2_impl_ = 0; 3240 expected_push_properties_child2_impl_ = 0;
3220 expected_push_properties_grandchild2_impl_ = 0; 3241 expected_push_properties_grandchild2_impl_ = 0;
3221 3242
3222 // Make sure the new root is pushed. 3243 // Make sure the new root is pushed.
3223 EXPECT_EQ(1u, static_cast<PushPropertiesCountingLayerImpl*>( 3244 EXPECT_EQ(1u, static_cast<PushPropertiesCountingLayerImpl*>(
3224 host_impl->active_tree()->root_layer()) 3245 host_impl->active_tree()->root_layer_for_testing())
3225 ->push_properties_count()); 3246 ->push_properties_count());
3226 return; 3247 return;
3227 case 4: 3248 case 4:
3228 // Root is swapped back all of the layers in the tree get pushed. 3249 // Root is swapped back all of the layers in the tree get pushed.
3229 ++expected_push_properties_root_impl_; 3250 ++expected_push_properties_root_impl_;
3230 ++expected_push_properties_child_impl_; 3251 ++expected_push_properties_child_impl_;
3231 ++expected_push_properties_grandchild_impl_; 3252 ++expected_push_properties_grandchild_impl_;
3232 ++expected_push_properties_child2_impl_; 3253 ++expected_push_properties_child2_impl_;
3233 ++expected_push_properties_grandchild2_impl_; 3254 ++expected_push_properties_grandchild2_impl_;
3234 break; 3255 break;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
3320 3341
3321 PushPropertiesCountingLayerImpl* root_impl_ = NULL; 3342 PushPropertiesCountingLayerImpl* root_impl_ = NULL;
3322 PushPropertiesCountingLayerImpl* child_impl_ = NULL; 3343 PushPropertiesCountingLayerImpl* child_impl_ = NULL;
3323 PushPropertiesCountingLayerImpl* child2_impl_ = NULL; 3344 PushPropertiesCountingLayerImpl* child2_impl_ = NULL;
3324 PushPropertiesCountingLayerImpl* grandchild_impl_ = NULL; 3345 PushPropertiesCountingLayerImpl* grandchild_impl_ = NULL;
3325 PushPropertiesCountingLayerImpl* leaf_always_pushing_layer_impl_ = NULL; 3346 PushPropertiesCountingLayerImpl* leaf_always_pushing_layer_impl_ = NULL;
3326 3347
3327 // Pull the layers that we need from the tree assuming the same structure 3348 // Pull the layers that we need from the tree assuming the same structure
3328 // as LayerTreeHostTestLayersPushProperties 3349 // as LayerTreeHostTestLayersPushProperties
3329 root_impl_ = static_cast<PushPropertiesCountingLayerImpl*>( 3350 root_impl_ = static_cast<PushPropertiesCountingLayerImpl*>(
3330 host_impl->active_tree()->root_layer()); 3351 host_impl->active_tree()->root_layer_for_testing());
3331 3352
3332 LayerTreeImpl* impl = root_impl_->layer_tree_impl(); 3353 LayerTreeImpl* impl = root_impl_->layer_tree_impl();
3333 if (impl->LayerById(child_->id())) { 3354 if (impl->LayerById(child_->id())) {
3334 child_impl_ = static_cast<PushPropertiesCountingLayerImpl*>( 3355 child_impl_ = static_cast<PushPropertiesCountingLayerImpl*>(
3335 impl->LayerById(child_->id())); 3356 impl->LayerById(child_->id()));
3336 3357
3337 if (impl->LayerById(grandchild_->id())) 3358 if (impl->LayerById(grandchild_->id()))
3338 grandchild_impl_ = static_cast<PushPropertiesCountingLayerImpl*>( 3359 grandchild_impl_ = static_cast<PushPropertiesCountingLayerImpl*>(
3339 impl->LayerById(grandchild_->id())); 3360 impl->LayerById(grandchild_->id()));
3340 } 3361 }
(...skipping 3329 matching lines...) Expand 10 before | Expand all | Expand 10 after
6670 EndTest(); 6691 EndTest();
6671 } 6692 }
6672 6693
6673 void AfterTest() override {} 6694 void AfterTest() override {}
6674 }; 6695 };
6675 6696
6676 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); 6697 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor);
6677 6698
6678 } // namespace 6699 } // namespace
6679 } // namespace cc 6700 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698