OLD | NEW |
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 "cc/resources/picture_layer_tiling.h" | 5 #include "cc/resources/picture_layer_tiling.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 static void UpdateAllTilePriorities(PictureLayerTilingSet* set, | 37 static void UpdateAllTilePriorities(PictureLayerTilingSet* set, |
38 WhichTree tree, | 38 WhichTree tree, |
39 const gfx::Rect& visible_layer_rect, | 39 const gfx::Rect& visible_layer_rect, |
40 float layer_contents_scale, | 40 float layer_contents_scale, |
41 double current_frame_time_in_seconds) { | 41 double current_frame_time_in_seconds) { |
42 for (size_t i = 0; i < set->num_tilings(); ++i) { | 42 for (size_t i = 0; i < set->num_tilings(); ++i) { |
43 set->tiling_at(i)->UpdateTilePriorities(tree, | 43 set->tiling_at(i)->UpdateTilePriorities(tree, |
44 visible_layer_rect, | 44 visible_layer_rect, |
45 layer_contents_scale, | 45 layer_contents_scale, |
46 current_frame_time_in_seconds, | 46 current_frame_time_in_seconds, |
47 NULL, | 47 OcclusionChecker<LayerImpl>()); |
48 NULL, | |
49 gfx::Transform()); | |
50 } | 48 } |
51 } | 49 } |
52 | 50 |
53 class TestablePictureLayerTiling : public PictureLayerTiling { | 51 class TestablePictureLayerTiling : public PictureLayerTiling { |
54 public: | 52 public: |
55 using PictureLayerTiling::SetLiveTilesRect; | 53 using PictureLayerTiling::SetLiveTilesRect; |
56 using PictureLayerTiling::TileAt; | 54 using PictureLayerTiling::TileAt; |
57 | 55 |
58 static scoped_ptr<TestablePictureLayerTiling> Create( | 56 static scoped_ptr<TestablePictureLayerTiling> Create( |
59 float contents_scale, | 57 float contents_scale, |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 client.set_tree(ACTIVE_TREE); | 532 client.set_tree(ACTIVE_TREE); |
535 scoped_ptr<TestablePictureLayerTiling> tiling; | 533 scoped_ptr<TestablePictureLayerTiling> tiling; |
536 | 534 |
537 gfx::Rect viewport(0, 0, 100, 100); | 535 gfx::Rect viewport(0, 0, 100, 100); |
538 gfx::Size layer_bounds(200, 200); | 536 gfx::Size layer_bounds(200, 200); |
539 | 537 |
540 client.SetTileSize(gfx::Size(100, 100)); | 538 client.SetTileSize(gfx::Size(100, 100)); |
541 tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client); | 539 tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client); |
542 | 540 |
543 tiling->UpdateTilePriorities( | 541 tiling->UpdateTilePriorities( |
544 ACTIVE_TREE, viewport, 1.f, 1.0, NULL, NULL, gfx::Transform()); | 542 ACTIVE_TREE, viewport, 1.f, 1.0, OcclusionChecker<LayerImpl>()); |
545 | 543 |
546 // Move viewport down 50 pixels in 0.5 seconds. | 544 // Move viewport down 50 pixels in 0.5 seconds. |
547 gfx::Rect down_skewport = | 545 gfx::Rect down_skewport = |
548 tiling->ComputeSkewport(1.5, gfx::Rect(0, 50, 100, 100)); | 546 tiling->ComputeSkewport(1.5, gfx::Rect(0, 50, 100, 100)); |
549 | 547 |
550 EXPECT_EQ(0, down_skewport.x()); | 548 EXPECT_EQ(0, down_skewport.x()); |
551 EXPECT_EQ(50, down_skewport.y()); | 549 EXPECT_EQ(50, down_skewport.y()); |
552 EXPECT_EQ(100, down_skewport.width()); | 550 EXPECT_EQ(100, down_skewport.width()); |
553 EXPECT_EQ(175, down_skewport.height()); | 551 EXPECT_EQ(175, down_skewport.height()); |
554 EXPECT_TRUE(down_skewport.Contains(gfx::Rect(0, 50, 100, 100))); | 552 EXPECT_TRUE(down_skewport.Contains(gfx::Rect(0, 50, 100, 100))); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 scoped_ptr<TestablePictureLayerTiling> tiling; | 599 scoped_ptr<TestablePictureLayerTiling> tiling; |
602 | 600 |
603 gfx::Rect viewport(0, 0, 100, 100); | 601 gfx::Rect viewport(0, 0, 100, 100); |
604 gfx::Size layer_bounds(200, 200); | 602 gfx::Size layer_bounds(200, 200); |
605 | 603 |
606 client.SetTileSize(gfx::Size(100, 100)); | 604 client.SetTileSize(gfx::Size(100, 100)); |
607 client.set_tree(ACTIVE_TREE); | 605 client.set_tree(ACTIVE_TREE); |
608 tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client); | 606 tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client); |
609 | 607 |
610 tiling->UpdateTilePriorities( | 608 tiling->UpdateTilePriorities( |
611 ACTIVE_TREE, viewport, 1.f, 1.0, NULL, NULL, gfx::Transform()); | 609 ACTIVE_TREE, viewport, 1.f, 1.0, OcclusionChecker<LayerImpl>()); |
612 | 610 |
613 // Move viewport down 50 pixels in 0.5 seconds. | 611 // Move viewport down 50 pixels in 0.5 seconds. |
614 gfx::Rect down_skewport = | 612 gfx::Rect down_skewport = |
615 tiling->ComputeSkewport(1.5, gfx::Rect(0, 50, 100, 100)); | 613 tiling->ComputeSkewport(1.5, gfx::Rect(0, 50, 100, 100)); |
616 | 614 |
617 EXPECT_EQ(0, down_skewport.x()); | 615 EXPECT_EQ(0, down_skewport.x()); |
618 EXPECT_EQ(50, down_skewport.y()); | 616 EXPECT_EQ(50, down_skewport.y()); |
619 EXPECT_EQ(100, down_skewport.width()); | 617 EXPECT_EQ(100, down_skewport.width()); |
620 EXPECT_EQ(200, down_skewport.height()); | 618 EXPECT_EQ(200, down_skewport.height()); |
621 | 619 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 // Tiling at 0.25 scale: this should create 47x47 tiles of size 10x10. | 667 // Tiling at 0.25 scale: this should create 47x47 tiles of size 10x10. |
670 // The reason is that each tile has a one pixel border, so tile at (1, 2) | 668 // The reason is that each tile has a one pixel border, so tile at (1, 2) |
671 // for instance begins at (8, 16) pixels. So tile at (46, 46) will begin at | 669 // for instance begins at (8, 16) pixels. So tile at (46, 46) will begin at |
672 // (368, 368) and extend to the end of 1500 * 0.25 = 375 edge of the | 670 // (368, 368) and extend to the end of 1500 * 0.25 = 375 edge of the |
673 // tiling. | 671 // tiling. |
674 tiling = TestablePictureLayerTiling::Create(0.25f, layer_bounds, &client); | 672 tiling = TestablePictureLayerTiling::Create(0.25f, layer_bounds, &client); |
675 gfx::Rect viewport_in_content_space = | 673 gfx::Rect viewport_in_content_space = |
676 gfx::ToEnclosedRect(gfx::ScaleRect(viewport, 0.25f)); | 674 gfx::ToEnclosedRect(gfx::ScaleRect(viewport, 0.25f)); |
677 | 675 |
678 tiling->UpdateTilePriorities( | 676 tiling->UpdateTilePriorities( |
679 ACTIVE_TREE, viewport, 1.f, 1.0, NULL, NULL, gfx::Transform()); | 677 ACTIVE_TREE, viewport, 1.f, 1.0, OcclusionChecker<LayerImpl>()); |
680 | 678 |
681 gfx::Rect soon_rect = viewport; | 679 gfx::Rect soon_rect = viewport; |
682 soon_rect.Inset(-312.f, -312.f, -312.f, -312.f); | 680 soon_rect.Inset(-312.f, -312.f, -312.f, -312.f); |
683 gfx::Rect soon_rect_in_content_space = | 681 gfx::Rect soon_rect_in_content_space = |
684 gfx::ToEnclosedRect(gfx::ScaleRect(soon_rect, 0.25f)); | 682 gfx::ToEnclosedRect(gfx::ScaleRect(soon_rect, 0.25f)); |
685 | 683 |
686 // Sanity checks. | 684 // Sanity checks. |
687 for (int i = 0; i < 47; ++i) { | 685 for (int i = 0; i < 47; ++i) { |
688 for (int j = 0; j < 47; ++j) { | 686 for (int j = 0; j < 47; ++j) { |
689 EXPECT_TRUE(tiling->TileAt(i, j)) << "i: " << i << " j: " << j; | 687 EXPECT_TRUE(tiling->TileAt(i, j)) << "i: " << i << " j: " << j; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 soon_rect.Inset(-312.f, -312.f, -312.f, -312.f); | 752 soon_rect.Inset(-312.f, -312.f, -312.f, -312.f); |
755 soon_rect_in_content_space = | 753 soon_rect_in_content_space = |
756 gfx::ToEnclosedRect(gfx::ScaleRect(soon_rect, 0.25f)); | 754 gfx::ToEnclosedRect(gfx::ScaleRect(soon_rect, 0.25f)); |
757 | 755 |
758 EXPECT_EQ(0, skewport.x()); | 756 EXPECT_EQ(0, skewport.x()); |
759 EXPECT_EQ(10, skewport.y()); | 757 EXPECT_EQ(10, skewport.y()); |
760 EXPECT_EQ(25, skewport.width()); | 758 EXPECT_EQ(25, skewport.width()); |
761 EXPECT_EQ(35, skewport.height()); | 759 EXPECT_EQ(35, skewport.height()); |
762 | 760 |
763 tiling->UpdateTilePriorities( | 761 tiling->UpdateTilePriorities( |
764 ACTIVE_TREE, viewport, 1.f, 2.0, NULL, NULL, gfx::Transform()); | 762 ACTIVE_TREE, viewport, 1.f, 2.0, OcclusionChecker<LayerImpl>()); |
765 | 763 |
766 have_now = false; | 764 have_now = false; |
767 have_eventually = false; | 765 have_eventually = false; |
768 have_soon = false; | 766 have_soon = false; |
769 | 767 |
770 // Viewport moved, so we expect to find some NOW tiles, some SOON tiles and | 768 // Viewport moved, so we expect to find some NOW tiles, some SOON tiles and |
771 // some EVENTUALLY tiles. | 769 // some EVENTUALLY tiles. |
772 for (int i = 0; i < 47; ++i) { | 770 for (int i = 0; i < 47; ++i) { |
773 for (int j = 0; j < 47; ++j) { | 771 for (int j = 0; j < 47; ++j) { |
774 Tile* tile = tiling->TileAt(i, j); | 772 Tile* tile = tiling->TileAt(i, j); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 EXPECT_FLOAT_EQ(68.f, priority.distance_to_visible); | 804 EXPECT_FLOAT_EQ(68.f, priority.distance_to_visible); |
807 | 805 |
808 priority = tiling->TileAt(2, 5)->priority(ACTIVE_TREE); | 806 priority = tiling->TileAt(2, 5)->priority(ACTIVE_TREE); |
809 EXPECT_FLOAT_EQ(28.f, priority.distance_to_visible); | 807 EXPECT_FLOAT_EQ(28.f, priority.distance_to_visible); |
810 | 808 |
811 priority = tiling->TileAt(3, 4)->priority(ACTIVE_TREE); | 809 priority = tiling->TileAt(3, 4)->priority(ACTIVE_TREE); |
812 EXPECT_FLOAT_EQ(4.f, priority.distance_to_visible); | 810 EXPECT_FLOAT_EQ(4.f, priority.distance_to_visible); |
813 | 811 |
814 // Change the underlying layer scale. | 812 // Change the underlying layer scale. |
815 tiling->UpdateTilePriorities( | 813 tiling->UpdateTilePriorities( |
816 ACTIVE_TREE, viewport, 2.0f, 3.0, NULL, NULL, gfx::Transform()); | 814 ACTIVE_TREE, viewport, 2.0f, 3.0, OcclusionChecker<LayerImpl>()); |
817 | 815 |
818 priority = tiling->TileAt(5, 1)->priority(ACTIVE_TREE); | 816 priority = tiling->TileAt(5, 1)->priority(ACTIVE_TREE); |
819 EXPECT_FLOAT_EQ(136.f, priority.distance_to_visible); | 817 EXPECT_FLOAT_EQ(136.f, priority.distance_to_visible); |
820 | 818 |
821 priority = tiling->TileAt(2, 5)->priority(ACTIVE_TREE); | 819 priority = tiling->TileAt(2, 5)->priority(ACTIVE_TREE); |
822 EXPECT_FLOAT_EQ(56.f, priority.distance_to_visible); | 820 EXPECT_FLOAT_EQ(56.f, priority.distance_to_visible); |
823 | 821 |
824 priority = tiling->TileAt(3, 4)->priority(ACTIVE_TREE); | 822 priority = tiling->TileAt(3, 4)->priority(ACTIVE_TREE); |
825 EXPECT_FLOAT_EQ(8.f, priority.distance_to_visible); | 823 EXPECT_FLOAT_EQ(8.f, priority.distance_to_visible); |
826 | 824 |
827 // Test additional scales. | 825 // Test additional scales. |
828 tiling = TestablePictureLayerTiling::Create(0.2f, layer_bounds, &client); | 826 tiling = TestablePictureLayerTiling::Create(0.2f, layer_bounds, &client); |
829 tiling->UpdateTilePriorities( | 827 tiling->UpdateTilePriorities( |
830 ACTIVE_TREE, viewport, 1.0f, 4.0, NULL, NULL, gfx::Transform()); | 828 ACTIVE_TREE, viewport, 1.0f, 4.0, OcclusionChecker<LayerImpl>()); |
831 | 829 |
832 priority = tiling->TileAt(5, 1)->priority(ACTIVE_TREE); | 830 priority = tiling->TileAt(5, 1)->priority(ACTIVE_TREE); |
833 EXPECT_FLOAT_EQ(110.f, priority.distance_to_visible); | 831 EXPECT_FLOAT_EQ(110.f, priority.distance_to_visible); |
834 | 832 |
835 priority = tiling->TileAt(2, 5)->priority(ACTIVE_TREE); | 833 priority = tiling->TileAt(2, 5)->priority(ACTIVE_TREE); |
836 EXPECT_FLOAT_EQ(70.f, priority.distance_to_visible); | 834 EXPECT_FLOAT_EQ(70.f, priority.distance_to_visible); |
837 | 835 |
838 priority = tiling->TileAt(3, 4)->priority(ACTIVE_TREE); | 836 priority = tiling->TileAt(3, 4)->priority(ACTIVE_TREE); |
839 EXPECT_FLOAT_EQ(60.f, priority.distance_to_visible); | 837 EXPECT_FLOAT_EQ(60.f, priority.distance_to_visible); |
840 | 838 |
841 tiling->UpdateTilePriorities( | 839 tiling->UpdateTilePriorities( |
842 ACTIVE_TREE, viewport, 0.5f, 5.0, NULL, NULL, gfx::Transform()); | 840 ACTIVE_TREE, viewport, 0.5f, 5.0, OcclusionChecker<LayerImpl>()); |
843 | 841 |
844 priority = tiling->TileAt(5, 1)->priority(ACTIVE_TREE); | 842 priority = tiling->TileAt(5, 1)->priority(ACTIVE_TREE); |
845 EXPECT_FLOAT_EQ(55.f, priority.distance_to_visible); | 843 EXPECT_FLOAT_EQ(55.f, priority.distance_to_visible); |
846 | 844 |
847 priority = tiling->TileAt(2, 5)->priority(ACTIVE_TREE); | 845 priority = tiling->TileAt(2, 5)->priority(ACTIVE_TREE); |
848 EXPECT_FLOAT_EQ(35.f, priority.distance_to_visible); | 846 EXPECT_FLOAT_EQ(35.f, priority.distance_to_visible); |
849 | 847 |
850 priority = tiling->TileAt(3, 4)->priority(ACTIVE_TREE); | 848 priority = tiling->TileAt(3, 4)->priority(ACTIVE_TREE); |
851 EXPECT_FLOAT_EQ(30.f, priority.distance_to_visible); | 849 EXPECT_FLOAT_EQ(30.f, priority.distance_to_visible); |
852 } | 850 } |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 gfx::Size layer_bounds(800, 800); | 1075 gfx::Size layer_bounds(800, 800); |
1078 | 1076 |
1079 gfx::Rect soon_rect = viewport; | 1077 gfx::Rect soon_rect = viewport; |
1080 soon_rect.Inset(-312.f, -312.f, -312.f, -312.f); | 1078 soon_rect.Inset(-312.f, -312.f, -312.f, -312.f); |
1081 | 1079 |
1082 client.SetTileSize(gfx::Size(30, 30)); | 1080 client.SetTileSize(gfx::Size(30, 30)); |
1083 client.set_tree(ACTIVE_TREE); | 1081 client.set_tree(ACTIVE_TREE); |
1084 | 1082 |
1085 tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client); | 1083 tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client); |
1086 tiling->UpdateTilePriorities( | 1084 tiling->UpdateTilePriorities( |
1087 ACTIVE_TREE, viewport, 1.0f, 1.0, NULL, NULL, gfx::Transform()); | 1085 ACTIVE_TREE, viewport, 1.0f, 1.0, OcclusionChecker<LayerImpl>()); |
1088 | 1086 |
1089 PictureLayerTiling::TilingRasterTileIterator empty_iterator; | 1087 PictureLayerTiling::TilingRasterTileIterator empty_iterator; |
1090 EXPECT_FALSE(empty_iterator); | 1088 EXPECT_FALSE(empty_iterator); |
1091 | 1089 |
1092 std::vector<Tile*> all_tiles = tiling->AllTilesForTesting(); | 1090 std::vector<Tile*> all_tiles = tiling->AllTilesForTesting(); |
1093 | 1091 |
1094 // Sanity check. | 1092 // Sanity check. |
1095 EXPECT_EQ(841u, all_tiles.size()); | 1093 EXPECT_EQ(841u, all_tiles.size()); |
1096 | 1094 |
1097 // The explanation of each iteration is as follows: | 1095 // The explanation of each iteration is as follows: |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 | 1184 |
1187 gfx::Rect viewport(50, 0, 100, 100); | 1185 gfx::Rect viewport(50, 0, 100, 100); |
1188 gfx::Rect moved_viewport(50, 0, 100, 500); | 1186 gfx::Rect moved_viewport(50, 0, 100, 500); |
1189 gfx::Size layer_bounds(1000, 1000); | 1187 gfx::Size layer_bounds(1000, 1000); |
1190 | 1188 |
1191 client.SetTileSize(gfx::Size(30, 30)); | 1189 client.SetTileSize(gfx::Size(30, 30)); |
1192 client.set_tree(ACTIVE_TREE); | 1190 client.set_tree(ACTIVE_TREE); |
1193 | 1191 |
1194 tiling = TestablePictureLayerTiling::Create(1.f, layer_bounds, &client); | 1192 tiling = TestablePictureLayerTiling::Create(1.f, layer_bounds, &client); |
1195 tiling->UpdateTilePriorities( | 1193 tiling->UpdateTilePriorities( |
1196 ACTIVE_TREE, viewport, 1.0f, 1.0, NULL, NULL, gfx::Transform()); | 1194 ACTIVE_TREE, viewport, 1.0f, 1.0, OcclusionChecker<LayerImpl>()); |
1197 tiling->UpdateTilePriorities( | 1195 tiling->UpdateTilePriorities( |
1198 ACTIVE_TREE, moved_viewport, 1.0f, 2.0, NULL, NULL, gfx::Transform()); | 1196 ACTIVE_TREE, moved_viewport, 1.0f, 2.0, OcclusionChecker<LayerImpl>()); |
1199 | 1197 |
1200 gfx::Rect soon_rect = moved_viewport; | 1198 gfx::Rect soon_rect = moved_viewport; |
1201 soon_rect.Inset(-312.f, -312.f, -312.f, -312.f); | 1199 soon_rect.Inset(-312.f, -312.f, -312.f, -312.f); |
1202 | 1200 |
1203 // There are 3 bins in TilePriority. | 1201 // There are 3 bins in TilePriority. |
1204 bool have_tiles[3] = {}; | 1202 bool have_tiles[3] = {}; |
1205 Tile* last_tile = NULL; | 1203 Tile* last_tile = NULL; |
1206 int eventually_bin_order_correct_count = 0; | 1204 int eventually_bin_order_correct_count = 0; |
1207 int eventually_bin_order_incorrect_count = 0; | 1205 int eventually_bin_order_incorrect_count = 0; |
1208 for (PictureLayerTiling::TilingRasterTileIterator it(tiling.get(), | 1206 for (PictureLayerTiling::TilingRasterTileIterator it(tiling.get(), |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 scoped_ptr<TestablePictureLayerTiling> tiling; | 1260 scoped_ptr<TestablePictureLayerTiling> tiling; |
1263 | 1261 |
1264 gfx::Rect viewport(50, 50, 100, 100); | 1262 gfx::Rect viewport(50, 50, 100, 100); |
1265 gfx::Size layer_bounds(2000, 2000); | 1263 gfx::Size layer_bounds(2000, 2000); |
1266 | 1264 |
1267 client.SetTileSize(gfx::Size(30, 30)); | 1265 client.SetTileSize(gfx::Size(30, 30)); |
1268 client.set_tree(ACTIVE_TREE); | 1266 client.set_tree(ACTIVE_TREE); |
1269 | 1267 |
1270 tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client); | 1268 tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client); |
1271 tiling->UpdateTilePriorities( | 1269 tiling->UpdateTilePriorities( |
1272 ACTIVE_TREE, viewport, 1.0f, 1.0, NULL, NULL, gfx::Transform()); | 1270 ACTIVE_TREE, viewport, 1.0f, 1.0, OcclusionChecker<LayerImpl>()); |
1273 | 1271 |
1274 PictureLayerTiling::TilingRasterTileIterator empty_iterator; | 1272 PictureLayerTiling::TilingRasterTileIterator empty_iterator; |
1275 EXPECT_FALSE(empty_iterator); | 1273 EXPECT_FALSE(empty_iterator); |
1276 | 1274 |
1277 std::vector<Tile*> all_tiles = tiling->AllTilesForTesting(); | 1275 std::vector<Tile*> all_tiles = tiling->AllTilesForTesting(); |
1278 | 1276 |
1279 PictureLayerTiling::TilingEvictionTileIterator it( | 1277 PictureLayerTiling::TilingEvictionTileIterator it( |
1280 tiling.get(), SMOOTHNESS_TAKES_PRIORITY, PictureLayerTiling::NOW); | 1278 tiling.get(), SMOOTHNESS_TAKES_PRIORITY, PictureLayerTiling::NOW); |
1281 | 1279 |
1282 // Tiles don't have resources to evict. | 1280 // Tiles don't have resources to evict. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1340 Initialize(gfx::Size(100, 100), 1.f, layer_bounds); | 1338 Initialize(gfx::Size(100, 100), 1.f, layer_bounds); |
1341 VerifyTilesExactlyCoverRect(1.f, gfx::Rect(layer_bounds)); | 1339 VerifyTilesExactlyCoverRect(1.f, gfx::Rect(layer_bounds)); |
1342 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false)); | 1340 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false)); |
1343 | 1341 |
1344 client_.set_tree(ACTIVE_TREE); | 1342 client_.set_tree(ACTIVE_TREE); |
1345 tiling_->UpdateTilePriorities( | 1343 tiling_->UpdateTilePriorities( |
1346 ACTIVE_TREE, | 1344 ACTIVE_TREE, |
1347 gfx::Rect(layer_bounds), // visible content rect | 1345 gfx::Rect(layer_bounds), // visible content rect |
1348 1.f, // current contents scale | 1346 1.f, // current contents scale |
1349 1.0, // current frame time | 1347 1.0, // current frame time |
1350 NULL, // occlusion tracker | 1348 OcclusionChecker<LayerImpl>()); |
1351 NULL, // render target | |
1352 gfx::Transform()); // draw transform | |
1353 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true)); | 1349 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true)); |
1354 | 1350 |
1355 // Make the viewport rect empty. All tiles are killed and become zombies. | 1351 // Make the viewport rect empty. All tiles are killed and become zombies. |
1356 tiling_->UpdateTilePriorities(ACTIVE_TREE, | 1352 tiling_->UpdateTilePriorities(ACTIVE_TREE, |
1357 gfx::Rect(), // visible content rect | 1353 gfx::Rect(), // visible content rect |
1358 1.f, // current contents scale | 1354 1.f, // current contents scale |
1359 2.0, // current frame time | 1355 2.0, // current frame time |
1360 NULL, // occlusion tracker | 1356 OcclusionChecker<LayerImpl>()); |
1361 NULL, // render target | |
1362 gfx::Transform()); // draw transform | |
1363 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false)); | 1357 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false)); |
1364 } | 1358 } |
1365 | 1359 |
1366 TEST_F(PictureLayerTilingIteratorTest, TilesExistGiantViewport) { | 1360 TEST_F(PictureLayerTilingIteratorTest, TilesExistGiantViewport) { |
1367 gfx::Size layer_bounds(1099, 801); | 1361 gfx::Size layer_bounds(1099, 801); |
1368 Initialize(gfx::Size(100, 100), 1.f, layer_bounds); | 1362 Initialize(gfx::Size(100, 100), 1.f, layer_bounds); |
1369 VerifyTilesExactlyCoverRect(1.f, gfx::Rect(layer_bounds)); | 1363 VerifyTilesExactlyCoverRect(1.f, gfx::Rect(layer_bounds)); |
1370 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false)); | 1364 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false)); |
1371 | 1365 |
1372 gfx::Rect giant_rect(-10000000, -10000000, 1000000000, 1000000000); | 1366 gfx::Rect giant_rect(-10000000, -10000000, 1000000000, 1000000000); |
1373 | 1367 |
1374 client_.set_tree(ACTIVE_TREE); | 1368 client_.set_tree(ACTIVE_TREE); |
1375 tiling_->UpdateTilePriorities( | 1369 tiling_->UpdateTilePriorities( |
1376 ACTIVE_TREE, | 1370 ACTIVE_TREE, |
1377 gfx::Rect(layer_bounds), // visible content rect | 1371 gfx::Rect(layer_bounds), // visible content rect |
1378 1.f, // current contents scale | 1372 1.f, // current contents scale |
1379 1.0, // current frame time | 1373 1.0, // current frame time |
1380 NULL, // occlusion tracker | 1374 OcclusionChecker<LayerImpl>()); |
1381 NULL, // render target | |
1382 gfx::Transform()); // draw transform | |
1383 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true)); | 1375 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true)); |
1384 | 1376 |
1385 // If the visible content rect is empty, it should still have live tiles. | 1377 // If the visible content rect is empty, it should still have live tiles. |
1386 tiling_->UpdateTilePriorities(ACTIVE_TREE, | 1378 tiling_->UpdateTilePriorities(ACTIVE_TREE, |
1387 giant_rect, // visible content rect | 1379 giant_rect, // visible content rect |
1388 1.f, // current contents scale | 1380 1.f, // current contents scale |
1389 2.0, // current frame time | 1381 2.0, // current frame time |
1390 NULL, // occlusion tracker | 1382 OcclusionChecker<LayerImpl>()); |
1391 NULL, // render target | |
1392 gfx::Transform()); // draw transform | |
1393 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true)); | 1383 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true)); |
1394 } | 1384 } |
1395 | 1385 |
1396 TEST_F(PictureLayerTilingIteratorTest, TilesExistOutsideViewport) { | 1386 TEST_F(PictureLayerTilingIteratorTest, TilesExistOutsideViewport) { |
1397 gfx::Size layer_bounds(1099, 801); | 1387 gfx::Size layer_bounds(1099, 801); |
1398 Initialize(gfx::Size(100, 100), 1.f, layer_bounds); | 1388 Initialize(gfx::Size(100, 100), 1.f, layer_bounds); |
1399 VerifyTilesExactlyCoverRect(1.f, gfx::Rect(layer_bounds)); | 1389 VerifyTilesExactlyCoverRect(1.f, gfx::Rect(layer_bounds)); |
1400 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false)); | 1390 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false)); |
1401 | 1391 |
1402 // This rect does not intersect with the layer, as the layer is outside the | 1392 // This rect does not intersect with the layer, as the layer is outside the |
1403 // viewport. | 1393 // viewport. |
1404 gfx::Rect viewport_rect(1100, 0, 1000, 1000); | 1394 gfx::Rect viewport_rect(1100, 0, 1000, 1000); |
1405 EXPECT_FALSE(viewport_rect.Intersects(gfx::Rect(layer_bounds))); | 1395 EXPECT_FALSE(viewport_rect.Intersects(gfx::Rect(layer_bounds))); |
1406 | 1396 |
1407 client_.set_tree(ACTIVE_TREE); | 1397 client_.set_tree(ACTIVE_TREE); |
1408 tiling_->UpdateTilePriorities(ACTIVE_TREE, | 1398 tiling_->UpdateTilePriorities(ACTIVE_TREE, |
1409 viewport_rect, // visible content rect | 1399 viewport_rect, // visible content rect |
1410 1.f, // current contents scale | 1400 1.f, // current contents scale |
1411 1.0, // current frame time | 1401 1.0, // current frame time |
1412 NULL, // occlusion tracker | 1402 OcclusionChecker<LayerImpl>()); |
1413 NULL, // render target | |
1414 gfx::Transform()); // draw transform | |
1415 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true)); | 1403 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true)); |
1416 } | 1404 } |
1417 | 1405 |
1418 static void TilesIntersectingRectExist(const gfx::Rect& rect, | 1406 static void TilesIntersectingRectExist(const gfx::Rect& rect, |
1419 bool intersect_exists, | 1407 bool intersect_exists, |
1420 Tile* tile, | 1408 Tile* tile, |
1421 const gfx::Rect& geometry_rect) { | 1409 const gfx::Rect& geometry_rect) { |
1422 bool intersects = rect.Intersects(geometry_rect); | 1410 bool intersects = rect.Intersects(geometry_rect); |
1423 bool expected_exists = intersect_exists ? intersects : !intersects; | 1411 bool expected_exists = intersect_exists ? intersects : !intersects; |
1424 EXPECT_EQ(expected_exists, tile != NULL) | 1412 EXPECT_EQ(expected_exists, tile != NULL) |
1425 << "Rects intersecting " << rect.ToString() << " should exist. " | 1413 << "Rects intersecting " << rect.ToString() << " should exist. " |
1426 << "Current tile rect is " << geometry_rect.ToString(); | 1414 << "Current tile rect is " << geometry_rect.ToString(); |
1427 } | 1415 } |
1428 | 1416 |
1429 TEST_F(PictureLayerTilingIteratorTest, | 1417 TEST_F(PictureLayerTilingIteratorTest, |
1430 TilesExistLargeViewportAndLayerWithSmallVisibleArea) { | 1418 TilesExistLargeViewportAndLayerWithSmallVisibleArea) { |
1431 gfx::Size layer_bounds(10000, 10000); | 1419 gfx::Size layer_bounds(10000, 10000); |
1432 Initialize(gfx::Size(100, 100), 1.f, layer_bounds); | 1420 Initialize(gfx::Size(100, 100), 1.f, layer_bounds); |
1433 VerifyTilesExactlyCoverRect(1.f, gfx::Rect(layer_bounds)); | 1421 VerifyTilesExactlyCoverRect(1.f, gfx::Rect(layer_bounds)); |
1434 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false)); | 1422 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false)); |
1435 | 1423 |
1436 gfx::Rect visible_rect(8000, 8000, 50, 50); | 1424 gfx::Rect visible_rect(8000, 8000, 50, 50); |
1437 | 1425 |
1438 client_.set_tree(ACTIVE_TREE); | 1426 client_.set_tree(ACTIVE_TREE); |
1439 set_max_tiles_for_interest_area(1); | 1427 set_max_tiles_for_interest_area(1); |
1440 tiling_->UpdateTilePriorities(ACTIVE_TREE, | 1428 tiling_->UpdateTilePriorities(ACTIVE_TREE, |
1441 visible_rect, // visible content rect | 1429 visible_rect, // visible content rect |
1442 1.f, // current contents scale | 1430 1.f, // current contents scale |
1443 1.0, // current frame time | 1431 1.0, // current frame time |
1444 NULL, // occlusion tracker | 1432 OcclusionChecker<LayerImpl>()); |
1445 NULL, // render target | |
1446 gfx::Transform()); // draw transform | |
1447 VerifyTiles(1.f, | 1433 VerifyTiles(1.f, |
1448 gfx::Rect(layer_bounds), | 1434 gfx::Rect(layer_bounds), |
1449 base::Bind(&TilesIntersectingRectExist, visible_rect, true)); | 1435 base::Bind(&TilesIntersectingRectExist, visible_rect, true)); |
1450 } | 1436 } |
1451 | 1437 |
1452 static void CountExistingTiles(int *count, | 1438 static void CountExistingTiles(int *count, |
1453 Tile* tile, | 1439 Tile* tile, |
1454 const gfx::Rect& geometry_rect) { | 1440 const gfx::Rect& geometry_rect) { |
1455 if (tile != NULL) | 1441 if (tile != NULL) |
1456 ++(*count); | 1442 ++(*count); |
1457 } | 1443 } |
1458 | 1444 |
1459 TEST_F(PictureLayerTilingIteratorTest, | 1445 TEST_F(PictureLayerTilingIteratorTest, |
1460 TilesExistLargeViewportAndLayerWithLargeVisibleArea) { | 1446 TilesExistLargeViewportAndLayerWithLargeVisibleArea) { |
1461 gfx::Size layer_bounds(10000, 10000); | 1447 gfx::Size layer_bounds(10000, 10000); |
1462 Initialize(gfx::Size(100, 100), 1.f, layer_bounds); | 1448 Initialize(gfx::Size(100, 100), 1.f, layer_bounds); |
1463 VerifyTilesExactlyCoverRect(1.f, gfx::Rect(layer_bounds)); | 1449 VerifyTilesExactlyCoverRect(1.f, gfx::Rect(layer_bounds)); |
1464 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false)); | 1450 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false)); |
1465 | 1451 |
1466 client_.set_tree(ACTIVE_TREE); | 1452 client_.set_tree(ACTIVE_TREE); |
1467 set_max_tiles_for_interest_area(1); | 1453 set_max_tiles_for_interest_area(1); |
1468 tiling_->UpdateTilePriorities( | 1454 tiling_->UpdateTilePriorities( |
1469 ACTIVE_TREE, | 1455 ACTIVE_TREE, |
1470 gfx::Rect(layer_bounds), // visible content rect | 1456 gfx::Rect(layer_bounds), // visible content rect |
1471 1.f, // current contents scale | 1457 1.f, // current contents scale |
1472 1.0, // current frame time | 1458 1.0, // current frame time |
1473 NULL, // occlusion tracker | 1459 OcclusionChecker<LayerImpl>()); |
1474 NULL, // render target | |
1475 gfx::Transform()); // draw transform | |
1476 | 1460 |
1477 int num_tiles = 0; | 1461 int num_tiles = 0; |
1478 VerifyTiles(1.f, | 1462 VerifyTiles(1.f, |
1479 gfx::Rect(layer_bounds), | 1463 gfx::Rect(layer_bounds), |
1480 base::Bind(&CountExistingTiles, &num_tiles)); | 1464 base::Bind(&CountExistingTiles, &num_tiles)); |
1481 // If we're making a rect the size of one tile, it can only overlap up to 4 | 1465 // If we're making a rect the size of one tile, it can only overlap up to 4 |
1482 // tiles depending on its position. | 1466 // tiles depending on its position. |
1483 EXPECT_LE(num_tiles, 4); | 1467 EXPECT_LE(num_tiles, 4); |
1484 VerifyTiles(1.f, gfx::Rect(), base::Bind(&TileExists, false)); | 1468 VerifyTiles(1.f, gfx::Rect(), base::Bind(&TileExists, false)); |
1485 } | 1469 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1557 client.SetTileSize(gfx::Size(100, 100)); | 1541 client.SetTileSize(gfx::Size(100, 100)); |
1558 client.set_tree(ACTIVE_TREE); | 1542 client.set_tree(ACTIVE_TREE); |
1559 tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale | 1543 tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
1560 current_layer_bounds, | 1544 current_layer_bounds, |
1561 &client); | 1545 &client); |
1562 | 1546 |
1563 tiling->UpdateTilePriorities(ACTIVE_TREE, | 1547 tiling->UpdateTilePriorities(ACTIVE_TREE, |
1564 viewport_in_layer_space, | 1548 viewport_in_layer_space, |
1565 current_layer_contents_scale, | 1549 current_layer_contents_scale, |
1566 current_frame_time_in_seconds, | 1550 current_frame_time_in_seconds, |
1567 NULL, // occlusion tracker | 1551 OcclusionChecker<LayerImpl>()); |
1568 NULL, // render target | |
1569 gfx::Transform()); // draw transform | |
1570 | 1552 |
1571 ASSERT_TRUE(tiling->TileAt(0, 0)); | 1553 ASSERT_TRUE(tiling->TileAt(0, 0)); |
1572 ASSERT_TRUE(tiling->TileAt(0, 1)); | 1554 ASSERT_TRUE(tiling->TileAt(0, 1)); |
1573 ASSERT_TRUE(tiling->TileAt(1, 0)); | 1555 ASSERT_TRUE(tiling->TileAt(1, 0)); |
1574 ASSERT_TRUE(tiling->TileAt(1, 1)); | 1556 ASSERT_TRUE(tiling->TileAt(1, 1)); |
1575 | 1557 |
1576 TilePriority priority = tiling->TileAt(0, 0)->priority(ACTIVE_TREE); | 1558 TilePriority priority = tiling->TileAt(0, 0)->priority(ACTIVE_TREE); |
1577 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); | 1559 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); |
1578 EXPECT_FLOAT_EQ(TilePriority::NOW, priority.priority_bin); | 1560 EXPECT_FLOAT_EQ(TilePriority::NOW, priority.priority_bin); |
1579 | 1561 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1614 client.SetTileSize(gfx::Size(100, 100)); | 1596 client.SetTileSize(gfx::Size(100, 100)); |
1615 client.set_tree(ACTIVE_TREE); | 1597 client.set_tree(ACTIVE_TREE); |
1616 tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale | 1598 tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
1617 current_layer_bounds, | 1599 current_layer_bounds, |
1618 &client); | 1600 &client); |
1619 | 1601 |
1620 tiling->UpdateTilePriorities(ACTIVE_TREE, | 1602 tiling->UpdateTilePriorities(ACTIVE_TREE, |
1621 viewport_in_layer_space, | 1603 viewport_in_layer_space, |
1622 current_layer_contents_scale, | 1604 current_layer_contents_scale, |
1623 current_frame_time_in_seconds, | 1605 current_frame_time_in_seconds, |
1624 NULL, // occlusion tracker | 1606 OcclusionChecker<LayerImpl>()); |
1625 NULL, // render target | |
1626 gfx::Transform()); // draw transform | |
1627 | 1607 |
1628 ASSERT_TRUE(tiling->TileAt(0, 0)); | 1608 ASSERT_TRUE(tiling->TileAt(0, 0)); |
1629 ASSERT_TRUE(tiling->TileAt(0, 1)); | 1609 ASSERT_TRUE(tiling->TileAt(0, 1)); |
1630 ASSERT_TRUE(tiling->TileAt(1, 0)); | 1610 ASSERT_TRUE(tiling->TileAt(1, 0)); |
1631 ASSERT_TRUE(tiling->TileAt(1, 1)); | 1611 ASSERT_TRUE(tiling->TileAt(1, 1)); |
1632 | 1612 |
1633 TilePriority priority = tiling->TileAt(0, 0)->priority(ACTIVE_TREE); | 1613 TilePriority priority = tiling->TileAt(0, 0)->priority(ACTIVE_TREE); |
1634 EXPECT_GT(priority.distance_to_visible, 0.f); | 1614 EXPECT_GT(priority.distance_to_visible, 0.f); |
1635 EXPECT_NE(TilePriority::NOW, priority.priority_bin); | 1615 EXPECT_NE(TilePriority::NOW, priority.priority_bin); |
1636 | 1616 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 client.SetTileSize(gfx::Size(100, 100)); | 1661 client.SetTileSize(gfx::Size(100, 100)); |
1682 client.set_tree(ACTIVE_TREE); | 1662 client.set_tree(ACTIVE_TREE); |
1683 tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale | 1663 tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
1684 current_layer_bounds, | 1664 current_layer_bounds, |
1685 &client); | 1665 &client); |
1686 | 1666 |
1687 tiling->UpdateTilePriorities(ACTIVE_TREE, | 1667 tiling->UpdateTilePriorities(ACTIVE_TREE, |
1688 viewport_in_layer_space, | 1668 viewport_in_layer_space, |
1689 current_layer_contents_scale, | 1669 current_layer_contents_scale, |
1690 current_frame_time_in_seconds, | 1670 current_frame_time_in_seconds, |
1691 NULL, // occlusion tracker | 1671 OcclusionChecker<LayerImpl>()); |
1692 NULL, // render target | |
1693 gfx::Transform()); // draw transform | |
1694 | 1672 |
1695 ASSERT_TRUE(tiling->TileAt(0, 0)); | 1673 ASSERT_TRUE(tiling->TileAt(0, 0)); |
1696 ASSERT_TRUE(tiling->TileAt(0, 1)); | 1674 ASSERT_TRUE(tiling->TileAt(0, 1)); |
1697 ASSERT_TRUE(tiling->TileAt(1, 0)); | 1675 ASSERT_TRUE(tiling->TileAt(1, 0)); |
1698 ASSERT_TRUE(tiling->TileAt(1, 1)); | 1676 ASSERT_TRUE(tiling->TileAt(1, 1)); |
1699 | 1677 |
1700 TilePriority priority = tiling->TileAt(0, 0)->priority(ACTIVE_TREE); | 1678 TilePriority priority = tiling->TileAt(0, 0)->priority(ACTIVE_TREE); |
1701 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); | 1679 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); |
1702 EXPECT_FLOAT_EQ(TilePriority::NOW, priority.priority_bin); | 1680 EXPECT_FLOAT_EQ(TilePriority::NOW, priority.priority_bin); |
1703 | 1681 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1742 client.SetTileSize(gfx::Size(100, 100)); | 1720 client.SetTileSize(gfx::Size(100, 100)); |
1743 client.set_tree(ACTIVE_TREE); | 1721 client.set_tree(ACTIVE_TREE); |
1744 tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale | 1722 tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
1745 current_layer_bounds, | 1723 current_layer_bounds, |
1746 &client); | 1724 &client); |
1747 | 1725 |
1748 tiling->UpdateTilePriorities(ACTIVE_TREE, | 1726 tiling->UpdateTilePriorities(ACTIVE_TREE, |
1749 viewport_in_layer_space, | 1727 viewport_in_layer_space, |
1750 current_layer_contents_scale, | 1728 current_layer_contents_scale, |
1751 current_frame_time_in_seconds, | 1729 current_frame_time_in_seconds, |
1752 NULL, // occlusion tracker | 1730 OcclusionChecker<LayerImpl>()); |
1753 NULL, // render target | |
1754 gfx::Transform()); // draw transform | |
1755 | 1731 |
1756 ASSERT_TRUE(tiling->TileAt(0, 0)); | 1732 ASSERT_TRUE(tiling->TileAt(0, 0)); |
1757 ASSERT_TRUE(tiling->TileAt(0, 1)); | 1733 ASSERT_TRUE(tiling->TileAt(0, 1)); |
1758 ASSERT_TRUE(tiling->TileAt(1, 0)); | 1734 ASSERT_TRUE(tiling->TileAt(1, 0)); |
1759 ASSERT_TRUE(tiling->TileAt(1, 1)); | 1735 ASSERT_TRUE(tiling->TileAt(1, 1)); |
1760 | 1736 |
1761 TilePriority priority = tiling->TileAt(0, 0)->priority(ACTIVE_TREE); | 1737 TilePriority priority = tiling->TileAt(0, 0)->priority(ACTIVE_TREE); |
1762 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); | 1738 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); |
1763 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); | 1739 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); |
1764 | 1740 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1827 client.SetTileSize(gfx::Size(100, 100)); | 1803 client.SetTileSize(gfx::Size(100, 100)); |
1828 client.set_tree(ACTIVE_TREE); | 1804 client.set_tree(ACTIVE_TREE); |
1829 tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale | 1805 tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
1830 current_layer_bounds, | 1806 current_layer_bounds, |
1831 &client); | 1807 &client); |
1832 | 1808 |
1833 tiling->UpdateTilePriorities(ACTIVE_TREE, | 1809 tiling->UpdateTilePriorities(ACTIVE_TREE, |
1834 viewport_in_layer_space, | 1810 viewport_in_layer_space, |
1835 current_layer_contents_scale, | 1811 current_layer_contents_scale, |
1836 current_frame_time_in_seconds, | 1812 current_frame_time_in_seconds, |
1837 NULL, // occlusion tracker | 1813 OcclusionChecker<LayerImpl>()); |
1838 NULL, // render target | |
1839 gfx::Transform()); // draw transform | |
1840 | 1814 |
1841 ASSERT_TRUE(tiling->TileAt(0, 0)); | 1815 ASSERT_TRUE(tiling->TileAt(0, 0)); |
1842 ASSERT_TRUE(tiling->TileAt(0, 1)); | 1816 ASSERT_TRUE(tiling->TileAt(0, 1)); |
1843 ASSERT_TRUE(tiling->TileAt(1, 0)); | 1817 ASSERT_TRUE(tiling->TileAt(1, 0)); |
1844 ASSERT_TRUE(tiling->TileAt(1, 1)); | 1818 ASSERT_TRUE(tiling->TileAt(1, 1)); |
1845 | 1819 |
1846 // All tiles will have a positive distance_to_visible | 1820 // All tiles will have a positive distance_to_visible |
1847 // and an infinite time_to_visible. | 1821 // and an infinite time_to_visible. |
1848 TilePriority priority = tiling->TileAt(0, 0)->priority(ACTIVE_TREE); | 1822 TilePriority priority = tiling->TileAt(0, 0)->priority(ACTIVE_TREE); |
1849 EXPECT_FLOAT_EQ(priority.distance_to_visible, 0.f); | 1823 EXPECT_FLOAT_EQ(priority.distance_to_visible, 0.f); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1922 client.SetTileSize(gfx::Size(100, 100)); | 1896 client.SetTileSize(gfx::Size(100, 100)); |
1923 client.set_tree(ACTIVE_TREE); | 1897 client.set_tree(ACTIVE_TREE); |
1924 tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale | 1898 tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
1925 current_layer_bounds, | 1899 current_layer_bounds, |
1926 &client); | 1900 &client); |
1927 | 1901 |
1928 tiling->UpdateTilePriorities(ACTIVE_TREE, | 1902 tiling->UpdateTilePriorities(ACTIVE_TREE, |
1929 viewport_in_layer_space, | 1903 viewport_in_layer_space, |
1930 current_layer_contents_scale, | 1904 current_layer_contents_scale, |
1931 current_frame_time_in_seconds, | 1905 current_frame_time_in_seconds, |
1932 NULL, // occlusion tracker | 1906 OcclusionChecker<LayerImpl>()); |
1933 NULL, // render target | |
1934 gfx::Transform()); // draw transform | |
1935 | 1907 |
1936 ASSERT_TRUE(tiling->TileAt(0, 0)); | 1908 ASSERT_TRUE(tiling->TileAt(0, 0)); |
1937 ASSERT_TRUE(tiling->TileAt(0, 1)); | 1909 ASSERT_TRUE(tiling->TileAt(0, 1)); |
1938 ASSERT_TRUE(tiling->TileAt(1, 0)); | 1910 ASSERT_TRUE(tiling->TileAt(1, 0)); |
1939 ASSERT_TRUE(tiling->TileAt(1, 1)); | 1911 ASSERT_TRUE(tiling->TileAt(1, 1)); |
1940 | 1912 |
1941 // Left-side tiles will be clipped by the transform, so we have to assume | 1913 // Left-side tiles will be clipped by the transform, so we have to assume |
1942 // they are visible just in case. | 1914 // they are visible just in case. |
1943 TilePriority priority = tiling->TileAt(0, 0)->priority(ACTIVE_TREE); | 1915 TilePriority priority = tiling->TileAt(0, 0)->priority(ACTIVE_TREE); |
1944 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); | 1916 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1988 client.set_tree(ACTIVE_TREE); | 1960 client.set_tree(ACTIVE_TREE); |
1989 tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale | 1961 tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
1990 current_layer_bounds, | 1962 current_layer_bounds, |
1991 &client); | 1963 &client); |
1992 | 1964 |
1993 // previous ("last") frame | 1965 // previous ("last") frame |
1994 tiling->UpdateTilePriorities(ACTIVE_TREE, | 1966 tiling->UpdateTilePriorities(ACTIVE_TREE, |
1995 viewport_in_layer_space, | 1967 viewport_in_layer_space, |
1996 last_layer_contents_scale, | 1968 last_layer_contents_scale, |
1997 last_frame_time_in_seconds, | 1969 last_frame_time_in_seconds, |
1998 NULL, // occlusion tracker | 1970 OcclusionChecker<LayerImpl>()); |
1999 NULL, // render target | |
2000 gfx::Transform()); // draw transform | |
2001 | 1971 |
2002 // current frame | 1972 // current frame |
2003 tiling->UpdateTilePriorities(ACTIVE_TREE, | 1973 tiling->UpdateTilePriorities(ACTIVE_TREE, |
2004 viewport_in_layer_space, | 1974 viewport_in_layer_space, |
2005 current_layer_contents_scale, | 1975 current_layer_contents_scale, |
2006 current_frame_time_in_seconds, | 1976 current_frame_time_in_seconds, |
2007 NULL, // occlusion tracker | 1977 OcclusionChecker<LayerImpl>()); |
2008 NULL, // render target | |
2009 gfx::Transform()); // draw transform | |
2010 | 1978 |
2011 ASSERT_TRUE(tiling->TileAt(0, 0)); | 1979 ASSERT_TRUE(tiling->TileAt(0, 0)); |
2012 ASSERT_TRUE(tiling->TileAt(0, 1)); | 1980 ASSERT_TRUE(tiling->TileAt(0, 1)); |
2013 ASSERT_TRUE(tiling->TileAt(1, 0)); | 1981 ASSERT_TRUE(tiling->TileAt(1, 0)); |
2014 ASSERT_TRUE(tiling->TileAt(1, 1)); | 1982 ASSERT_TRUE(tiling->TileAt(1, 1)); |
2015 | 1983 |
2016 TilePriority priority = tiling->TileAt(0, 0)->priority(ACTIVE_TREE); | 1984 TilePriority priority = tiling->TileAt(0, 0)->priority(ACTIVE_TREE); |
2017 EXPECT_GT(priority.distance_to_visible, 0.f); | 1985 EXPECT_GT(priority.distance_to_visible, 0.f); |
2018 EXPECT_NE(TilePriority::NOW, priority.priority_bin); | 1986 EXPECT_NE(TilePriority::NOW, priority.priority_bin); |
2019 | 1987 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2070 client.set_tree(ACTIVE_TREE); | 2038 client.set_tree(ACTIVE_TREE); |
2071 tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale | 2039 tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
2072 current_layer_bounds, | 2040 current_layer_bounds, |
2073 &client); | 2041 &client); |
2074 | 2042 |
2075 // previous ("last") frame | 2043 // previous ("last") frame |
2076 tiling->UpdateTilePriorities(ACTIVE_TREE, | 2044 tiling->UpdateTilePriorities(ACTIVE_TREE, |
2077 viewport_in_layer_space, | 2045 viewport_in_layer_space, |
2078 last_layer_contents_scale, | 2046 last_layer_contents_scale, |
2079 last_frame_time_in_seconds, | 2047 last_frame_time_in_seconds, |
2080 NULL, // occlusion tracker | 2048 OcclusionChecker<LayerImpl>()); |
2081 NULL, // render target | |
2082 gfx::Transform()); // draw transform | |
2083 | 2049 |
2084 // current frame | 2050 // current frame |
2085 tiling->UpdateTilePriorities(ACTIVE_TREE, | 2051 tiling->UpdateTilePriorities(ACTIVE_TREE, |
2086 viewport_in_layer_space, | 2052 viewport_in_layer_space, |
2087 current_layer_contents_scale, | 2053 current_layer_contents_scale, |
2088 current_frame_time_in_seconds, | 2054 current_frame_time_in_seconds, |
2089 NULL, // occlusion tracker | 2055 OcclusionChecker<LayerImpl>()); |
2090 NULL, // render target | |
2091 gfx::Transform()); // draw transform | |
2092 | 2056 |
2093 ASSERT_TRUE(tiling->TileAt(0, 0)); | 2057 ASSERT_TRUE(tiling->TileAt(0, 0)); |
2094 ASSERT_TRUE(tiling->TileAt(0, 1)); | 2058 ASSERT_TRUE(tiling->TileAt(0, 1)); |
2095 ASSERT_TRUE(tiling->TileAt(1, 0)); | 2059 ASSERT_TRUE(tiling->TileAt(1, 0)); |
2096 ASSERT_TRUE(tiling->TileAt(1, 1)); | 2060 ASSERT_TRUE(tiling->TileAt(1, 1)); |
2097 | 2061 |
2098 TilePriority priority = tiling->TileAt(0, 0)->priority(ACTIVE_TREE); | 2062 TilePriority priority = tiling->TileAt(0, 0)->priority(ACTIVE_TREE); |
2099 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); | 2063 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); |
2100 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); | 2064 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); |
2101 | 2065 |
(...skipping 12 matching lines...) Expand all Loading... |
2114 | 2078 |
2115 client.SetTileSize(gfx::Size(100, 100)); | 2079 client.SetTileSize(gfx::Size(100, 100)); |
2116 client.set_tree(ACTIVE_TREE); | 2080 client.set_tree(ACTIVE_TREE); |
2117 tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale | 2081 tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
2118 gfx::Size(100, 100), | 2082 gfx::Size(100, 100), |
2119 &client); | 2083 &client); |
2120 tiling->UpdateTilePriorities(ACTIVE_TREE, | 2084 tiling->UpdateTilePriorities(ACTIVE_TREE, |
2121 gfx::Rect(0, 0, 100, 100), | 2085 gfx::Rect(0, 0, 100, 100), |
2122 1.0f, | 2086 1.0f, |
2123 1.0f, | 2087 1.0f, |
2124 NULL, // occlusion tracker | 2088 OcclusionChecker<LayerImpl>()); |
2125 NULL, // render target | |
2126 gfx::Transform()); // draw transform | |
2127 | 2089 |
2128 std::vector<scoped_refptr<Tile> > tiles = tiling->AllRefTilesForTesting(); | 2090 std::vector<scoped_refptr<Tile> > tiles = tiling->AllRefTilesForTesting(); |
2129 ASSERT_GT(tiles.size(), 0u); | 2091 ASSERT_GT(tiles.size(), 0u); |
2130 for (std::vector<scoped_refptr<Tile> >::const_iterator it = tiles.begin(); | 2092 for (std::vector<scoped_refptr<Tile> >::const_iterator it = tiles.begin(); |
2131 it != tiles.end(); | 2093 it != tiles.end(); |
2132 ++it) { | 2094 ++it) { |
2133 EXPECT_NE(TilePriority(), (*it)->priority(ACTIVE_TREE)); | 2095 EXPECT_NE(TilePriority(), (*it)->priority(ACTIVE_TREE)); |
2134 } | 2096 } |
2135 | 2097 |
2136 tiling->Reset(); | 2098 tiling->Reset(); |
(...skipping 23 matching lines...) Expand all Loading... |
2160 active_client.set_tree(ACTIVE_TREE); | 2122 active_client.set_tree(ACTIVE_TREE); |
2161 active_client.set_max_tiles_for_interest_area(10); | 2123 active_client.set_max_tiles_for_interest_area(10); |
2162 active_tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale | 2124 active_tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
2163 gfx::Size(10000, 10000), | 2125 gfx::Size(10000, 10000), |
2164 &active_client); | 2126 &active_client); |
2165 // Create all tiles on this tiling. | 2127 // Create all tiles on this tiling. |
2166 active_tiling->UpdateTilePriorities(ACTIVE_TREE, | 2128 active_tiling->UpdateTilePriorities(ACTIVE_TREE, |
2167 gfx::Rect(0, 0, 100, 100), | 2129 gfx::Rect(0, 0, 100, 100), |
2168 1.0f, | 2130 1.0f, |
2169 1.0f, | 2131 1.0f, |
2170 NULL, // occlusion tracker | 2132 OcclusionChecker<LayerImpl>()); |
2171 NULL, // render target | |
2172 gfx::Transform()); // draw transform | |
2173 | 2133 |
2174 FakePictureLayerTilingClient recycle_client; | 2134 FakePictureLayerTilingClient recycle_client; |
2175 recycle_client.SetTileSize(gfx::Size(100, 100)); | 2135 recycle_client.SetTileSize(gfx::Size(100, 100)); |
2176 recycle_client.set_tree(PENDING_TREE); | 2136 recycle_client.set_tree(PENDING_TREE); |
2177 recycle_client.set_twin_tiling(active_tiling.get()); | 2137 recycle_client.set_twin_tiling(active_tiling.get()); |
2178 recycle_client.set_max_tiles_for_interest_area(10); | 2138 recycle_client.set_max_tiles_for_interest_area(10); |
2179 | 2139 |
2180 scoped_ptr<TestablePictureLayerTiling> recycle_tiling; | 2140 scoped_ptr<TestablePictureLayerTiling> recycle_tiling; |
2181 recycle_tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale | 2141 recycle_tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
2182 gfx::Size(10000, 10000), | 2142 gfx::Size(10000, 10000), |
2183 &recycle_client); | 2143 &recycle_client); |
2184 | 2144 |
2185 // Create all tiles on the second tiling. All tiles should be shared. | 2145 // Create all tiles on the second tiling. All tiles should be shared. |
2186 recycle_tiling->UpdateTilePriorities(PENDING_TREE, | 2146 recycle_tiling->UpdateTilePriorities(PENDING_TREE, |
2187 gfx::Rect(0, 0, 100, 100), | 2147 gfx::Rect(0, 0, 100, 100), |
2188 1.0f, | 2148 1.0f, |
2189 1.0f, | 2149 1.0f, |
2190 NULL, // occlusion tracker | 2150 OcclusionChecker<LayerImpl>()); |
2191 NULL, // render target | |
2192 gfx::Transform()); // draw transform | |
2193 | 2151 |
2194 // Set the second tiling as recycled. | 2152 // Set the second tiling as recycled. |
2195 active_client.set_twin_tiling(NULL); | 2153 active_client.set_twin_tiling(NULL); |
2196 active_client.set_recycled_twin_tiling(recycle_tiling.get()); | 2154 active_client.set_recycled_twin_tiling(recycle_tiling.get()); |
2197 recycle_client.set_twin_tiling(NULL); | 2155 recycle_client.set_twin_tiling(NULL); |
2198 | 2156 |
2199 // Verify that tiles exist and are shared. | 2157 // Verify that tiles exist and are shared. |
2200 EXPECT_TRUE(active_tiling->TileAt(0, 0)); | 2158 EXPECT_TRUE(active_tiling->TileAt(0, 0)); |
2201 EXPECT_TRUE(recycle_tiling->TileAt(0, 0)); | 2159 EXPECT_TRUE(recycle_tiling->TileAt(0, 0)); |
2202 EXPECT_EQ(active_tiling->TileAt(0, 0), recycle_tiling->TileAt(0, 0)); | 2160 EXPECT_EQ(active_tiling->TileAt(0, 0), recycle_tiling->TileAt(0, 0)); |
2203 | 2161 |
2204 // Move the viewport far away from the (0, 0) tile. | 2162 // Move the viewport far away from the (0, 0) tile. |
2205 active_tiling->UpdateTilePriorities(ACTIVE_TREE, | 2163 active_tiling->UpdateTilePriorities(ACTIVE_TREE, |
2206 gfx::Rect(9000, 9000, 100, 100), | 2164 gfx::Rect(9000, 9000, 100, 100), |
2207 1.0f, | 2165 1.0f, |
2208 2.0, | 2166 2.0, |
2209 NULL, // occlusion tracker | 2167 OcclusionChecker<LayerImpl>()); |
2210 NULL, // render target | |
2211 gfx::Transform()); // draw transform | |
2212 // Ensure the tile was deleted on both tilings. | 2168 // Ensure the tile was deleted on both tilings. |
2213 EXPECT_FALSE(active_tiling->TileAt(0, 0)); | 2169 EXPECT_FALSE(active_tiling->TileAt(0, 0)); |
2214 EXPECT_FALSE(recycle_tiling->TileAt(0, 0)); | 2170 EXPECT_FALSE(recycle_tiling->TileAt(0, 0)); |
2215 | 2171 |
2216 // Move the viewport back to (0, 0) tile. | 2172 // Move the viewport back to (0, 0) tile. |
2217 active_tiling->UpdateTilePriorities(ACTIVE_TREE, | 2173 active_tiling->UpdateTilePriorities(ACTIVE_TREE, |
2218 gfx::Rect(0, 0, 100, 100), | 2174 gfx::Rect(0, 0, 100, 100), |
2219 1.0f, | 2175 1.0f, |
2220 3.0, | 2176 3.0, |
2221 NULL, // occlusion tracker | 2177 OcclusionChecker<LayerImpl>()); |
2222 NULL, // render target | |
2223 gfx::Transform()); // draw transform | |
2224 | 2178 |
2225 // Ensure that we now have a tile here, but the recycle tiling does not. | 2179 // Ensure that we now have a tile here, but the recycle tiling does not. |
2226 EXPECT_TRUE(active_tiling->TileAt(0, 0)); | 2180 EXPECT_TRUE(active_tiling->TileAt(0, 0)); |
2227 EXPECT_FALSE(recycle_tiling->TileAt(0, 0)); | 2181 EXPECT_FALSE(recycle_tiling->TileAt(0, 0)); |
2228 } | 2182 } |
2229 | 2183 |
2230 TEST(PictureLayerTilingTest, RecycledTilesClearedOnReset) { | 2184 TEST(PictureLayerTilingTest, RecycledTilesClearedOnReset) { |
2231 FakePictureLayerTilingClient active_client; | 2185 FakePictureLayerTilingClient active_client; |
2232 scoped_ptr<TestablePictureLayerTiling> active_tiling; | 2186 scoped_ptr<TestablePictureLayerTiling> active_tiling; |
2233 | 2187 |
2234 active_client.SetTileSize(gfx::Size(100, 100)); | 2188 active_client.SetTileSize(gfx::Size(100, 100)); |
2235 active_client.set_tree(ACTIVE_TREE); | 2189 active_client.set_tree(ACTIVE_TREE); |
2236 active_tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale | 2190 active_tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
2237 gfx::Size(100, 100), | 2191 gfx::Size(100, 100), |
2238 &active_client); | 2192 &active_client); |
2239 // Create all tiles on this tiling. | 2193 // Create all tiles on this tiling. |
2240 active_tiling->UpdateTilePriorities(ACTIVE_TREE, | 2194 active_tiling->UpdateTilePriorities(ACTIVE_TREE, |
2241 gfx::Rect(0, 0, 100, 100), | 2195 gfx::Rect(0, 0, 100, 100), |
2242 1.0f, | 2196 1.0f, |
2243 1.0f, | 2197 1.0f, |
2244 NULL, // occlusion tracker | 2198 OcclusionChecker<LayerImpl>()); |
2245 NULL, // render target | |
2246 gfx::Transform()); // draw transform | |
2247 | 2199 |
2248 FakePictureLayerTilingClient recycle_client; | 2200 FakePictureLayerTilingClient recycle_client; |
2249 recycle_client.SetTileSize(gfx::Size(100, 100)); | 2201 recycle_client.SetTileSize(gfx::Size(100, 100)); |
2250 recycle_client.set_tree(PENDING_TREE); | 2202 recycle_client.set_tree(PENDING_TREE); |
2251 recycle_client.set_twin_tiling(active_tiling.get()); | 2203 recycle_client.set_twin_tiling(active_tiling.get()); |
2252 recycle_client.set_max_tiles_for_interest_area(10); | 2204 recycle_client.set_max_tiles_for_interest_area(10); |
2253 | 2205 |
2254 scoped_ptr<TestablePictureLayerTiling> recycle_tiling; | 2206 scoped_ptr<TestablePictureLayerTiling> recycle_tiling; |
2255 recycle_tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale | 2207 recycle_tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
2256 gfx::Size(100, 100), | 2208 gfx::Size(100, 100), |
2257 &recycle_client); | 2209 &recycle_client); |
2258 | 2210 |
2259 // Create all tiles on the recycle tiling. All tiles should be shared. | 2211 // Create all tiles on the recycle tiling. All tiles should be shared. |
2260 recycle_tiling->UpdateTilePriorities(PENDING_TREE, | 2212 recycle_tiling->UpdateTilePriorities(PENDING_TREE, |
2261 gfx::Rect(0, 0, 100, 100), | 2213 gfx::Rect(0, 0, 100, 100), |
2262 1.0f, | 2214 1.0f, |
2263 1.0f, | 2215 1.0f, |
2264 NULL, // occlusion tracker | 2216 OcclusionChecker<LayerImpl>()); |
2265 NULL, // render target | |
2266 gfx::Transform()); // draw transform | |
2267 | 2217 |
2268 // Set the second tiling as recycled. | 2218 // Set the second tiling as recycled. |
2269 active_client.set_twin_tiling(NULL); | 2219 active_client.set_twin_tiling(NULL); |
2270 active_client.set_recycled_twin_tiling(recycle_tiling.get()); | 2220 active_client.set_recycled_twin_tiling(recycle_tiling.get()); |
2271 recycle_client.set_twin_tiling(NULL); | 2221 recycle_client.set_twin_tiling(NULL); |
2272 | 2222 |
2273 // Verify that tiles exist and are shared. | 2223 // Verify that tiles exist and are shared. |
2274 EXPECT_TRUE(active_tiling->TileAt(0, 0)); | 2224 EXPECT_TRUE(active_tiling->TileAt(0, 0)); |
2275 EXPECT_TRUE(recycle_tiling->TileAt(0, 0)); | 2225 EXPECT_TRUE(recycle_tiling->TileAt(0, 0)); |
2276 EXPECT_EQ(active_tiling->TileAt(0, 0), recycle_tiling->TileAt(0, 0)); | 2226 EXPECT_EQ(active_tiling->TileAt(0, 0), recycle_tiling->TileAt(0, 0)); |
2277 | 2227 |
2278 // Reset the active tiling. The recycle tiles should be released too. | 2228 // Reset the active tiling. The recycle tiles should be released too. |
2279 active_tiling->Reset(); | 2229 active_tiling->Reset(); |
2280 EXPECT_FALSE(active_tiling->TileAt(0, 0)); | 2230 EXPECT_FALSE(active_tiling->TileAt(0, 0)); |
2281 EXPECT_FALSE(recycle_tiling->TileAt(0, 0)); | 2231 EXPECT_FALSE(recycle_tiling->TileAt(0, 0)); |
2282 } | 2232 } |
2283 | 2233 |
2284 } // namespace | 2234 } // namespace |
2285 } // namespace cc | 2235 } // namespace cc |
OLD | NEW |