| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 2757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2768 animating_transform = false; | 2768 animating_transform = false; |
| 2769 | 2769 |
| 2770 SetContentsScaleOnBothLayers(contents_scale, | 2770 SetContentsScaleOnBothLayers(contents_scale, |
| 2771 device_scale, | 2771 device_scale, |
| 2772 page_scale, | 2772 page_scale, |
| 2773 maximum_animation_scale, | 2773 maximum_animation_scale, |
| 2774 animating_transform); | 2774 animating_transform); |
| 2775 EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), 4.f); | 2775 EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), 4.f); |
| 2776 } | 2776 } |
| 2777 | 2777 |
| 2778 TEST_F(PictureLayerImplTest, LayerRasterTileIterator) { | 2778 TEST_F(PictureLayerImplTest, TilingSetRasterQueue) { |
| 2779 base::TimeTicks time_ticks; | 2779 base::TimeTicks time_ticks; |
| 2780 time_ticks += base::TimeDelta::FromMilliseconds(1); | 2780 time_ticks += base::TimeDelta::FromMilliseconds(1); |
| 2781 host_impl_.SetCurrentBeginFrameArgs( | 2781 host_impl_.SetCurrentBeginFrameArgs( |
| 2782 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); | 2782 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); |
| 2783 | 2783 |
| 2784 gfx::Size tile_size(100, 100); | 2784 gfx::Size tile_size(100, 100); |
| 2785 gfx::Size layer_bounds(1000, 1000); | 2785 gfx::Size layer_bounds(1000, 1000); |
| 2786 | 2786 |
| 2787 scoped_refptr<FakePicturePileImpl> pending_pile = | 2787 scoped_refptr<FakePicturePileImpl> pending_pile = |
| 2788 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); | 2788 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); |
| 2789 | 2789 |
| 2790 SetupPendingTree(pending_pile); | 2790 SetupPendingTree(pending_pile); |
| 2791 | 2791 |
| 2792 ASSERT_TRUE(pending_layer_->CanHaveTilings()); | 2792 ASSERT_TRUE(pending_layer_->CanHaveTilings()); |
| 2793 | 2793 |
| 2794 float low_res_factor = host_impl_.settings().low_res_contents_scale_factor; | 2794 float low_res_factor = host_impl_.settings().low_res_contents_scale_factor; |
| 2795 | 2795 |
| 2796 // Empty iterator | |
| 2797 PictureLayerImpl::LayerRasterTileIterator it; | |
| 2798 EXPECT_FALSE(it); | |
| 2799 | |
| 2800 // No tilings. | 2796 // No tilings. |
| 2801 it = PictureLayerImpl::LayerRasterTileIterator(pending_layer_, false); | 2797 scoped_ptr<TilingSetRasterQueue> queue = |
| 2802 EXPECT_FALSE(it); | 2798 pending_layer_->CreateRasterQueue(false); |
| 2799 EXPECT_TRUE(queue->IsEmpty()); |
| 2803 | 2800 |
| 2804 pending_layer_->AddTiling(low_res_factor); | 2801 pending_layer_->AddTiling(low_res_factor); |
| 2805 pending_layer_->AddTiling(0.3f); | 2802 pending_layer_->AddTiling(0.3f); |
| 2806 pending_layer_->AddTiling(0.7f); | 2803 pending_layer_->AddTiling(0.7f); |
| 2807 PictureLayerTiling* high_res_tiling = pending_layer_->AddTiling(1.0f); | 2804 PictureLayerTiling* high_res_tiling = pending_layer_->AddTiling(1.0f); |
| 2808 pending_layer_->AddTiling(2.0f); | 2805 pending_layer_->AddTiling(2.0f); |
| 2809 | 2806 |
| 2810 host_impl_.SetViewportSize(gfx::Size(500, 500)); | 2807 host_impl_.SetViewportSize(gfx::Size(500, 500)); |
| 2811 host_impl_.pending_tree()->UpdateDrawProperties(); | 2808 host_impl_.pending_tree()->UpdateDrawProperties(); |
| 2812 | 2809 |
| 2813 std::set<Tile*> unique_tiles; | 2810 std::set<Tile*> unique_tiles; |
| 2814 bool reached_prepaint = false; | 2811 bool reached_prepaint = false; |
| 2815 size_t non_ideal_tile_count = 0u; | 2812 size_t non_ideal_tile_count = 0u; |
| 2816 size_t low_res_tile_count = 0u; | 2813 size_t low_res_tile_count = 0u; |
| 2817 size_t high_res_tile_count = 0u; | 2814 size_t high_res_tile_count = 0u; |
| 2818 for (it = PictureLayerImpl::LayerRasterTileIterator(pending_layer_, false); | 2815 queue = pending_layer_->CreateRasterQueue(false); |
| 2819 it; | 2816 while (!queue->IsEmpty()) { |
| 2820 ++it) { | 2817 Tile* tile = queue->Top(); |
| 2821 Tile* tile = *it; | |
| 2822 TilePriority priority = tile->priority(PENDING_TREE); | 2818 TilePriority priority = tile->priority(PENDING_TREE); |
| 2823 | 2819 |
| 2824 EXPECT_TRUE(tile); | 2820 EXPECT_TRUE(tile); |
| 2825 | 2821 |
| 2826 // Non-high res tiles only get visible tiles. Also, prepaint should only | 2822 // Non-high res tiles only get visible tiles. Also, prepaint should only |
| 2827 // come at the end of the iteration. | 2823 // come at the end of the iteration. |
| 2828 if (priority.resolution != HIGH_RESOLUTION) | 2824 if (priority.resolution != HIGH_RESOLUTION) |
| 2829 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); | 2825 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); |
| 2830 else if (reached_prepaint) | 2826 else if (reached_prepaint) |
| 2831 EXPECT_NE(TilePriority::NOW, priority.priority_bin); | 2827 EXPECT_NE(TilePriority::NOW, priority.priority_bin); |
| 2832 else | 2828 else |
| 2833 reached_prepaint = priority.priority_bin != TilePriority::NOW; | 2829 reached_prepaint = priority.priority_bin != TilePriority::NOW; |
| 2834 | 2830 |
| 2835 non_ideal_tile_count += priority.resolution == NON_IDEAL_RESOLUTION; | 2831 non_ideal_tile_count += priority.resolution == NON_IDEAL_RESOLUTION; |
| 2836 low_res_tile_count += priority.resolution == LOW_RESOLUTION; | 2832 low_res_tile_count += priority.resolution == LOW_RESOLUTION; |
| 2837 high_res_tile_count += priority.resolution == HIGH_RESOLUTION; | 2833 high_res_tile_count += priority.resolution == HIGH_RESOLUTION; |
| 2838 | 2834 |
| 2839 unique_tiles.insert(tile); | 2835 unique_tiles.insert(tile); |
| 2836 queue->Pop(); |
| 2840 } | 2837 } |
| 2841 | 2838 |
| 2842 EXPECT_TRUE(reached_prepaint); | 2839 EXPECT_TRUE(reached_prepaint); |
| 2843 EXPECT_EQ(0u, non_ideal_tile_count); | 2840 EXPECT_EQ(0u, non_ideal_tile_count); |
| 2844 EXPECT_EQ(0u, low_res_tile_count); | 2841 EXPECT_EQ(0u, low_res_tile_count); |
| 2845 EXPECT_EQ(16u, high_res_tile_count); | 2842 EXPECT_EQ(16u, high_res_tile_count); |
| 2846 EXPECT_EQ(low_res_tile_count + high_res_tile_count + non_ideal_tile_count, | 2843 EXPECT_EQ(low_res_tile_count + high_res_tile_count + non_ideal_tile_count, |
| 2847 unique_tiles.size()); | 2844 unique_tiles.size()); |
| 2848 | 2845 |
| 2849 // No NOW tiles. | 2846 // No NOW tiles. |
| 2850 time_ticks += base::TimeDelta::FromMilliseconds(200); | 2847 time_ticks += base::TimeDelta::FromMilliseconds(200); |
| 2851 host_impl_.SetCurrentBeginFrameArgs( | 2848 host_impl_.SetCurrentBeginFrameArgs( |
| 2852 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); | 2849 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); |
| 2853 | 2850 |
| 2854 pending_layer_->draw_properties().visible_content_rect = | 2851 pending_layer_->draw_properties().visible_content_rect = |
| 2855 gfx::Rect(1100, 1100, 500, 500); | 2852 gfx::Rect(1100, 1100, 500, 500); |
| 2856 bool resourceless_software_draw = false; | 2853 bool resourceless_software_draw = false; |
| 2857 pending_layer_->UpdateTiles(Occlusion(), resourceless_software_draw); | 2854 pending_layer_->UpdateTiles(Occlusion(), resourceless_software_draw); |
| 2858 | 2855 |
| 2859 unique_tiles.clear(); | 2856 unique_tiles.clear(); |
| 2860 high_res_tile_count = 0u; | 2857 high_res_tile_count = 0u; |
| 2861 for (it = PictureLayerImpl::LayerRasterTileIterator(pending_layer_, false); | 2858 queue = pending_layer_->CreateRasterQueue(false); |
| 2862 it; | 2859 while (!queue->IsEmpty()) { |
| 2863 ++it) { | 2860 Tile* tile = queue->Top(); |
| 2864 Tile* tile = *it; | |
| 2865 TilePriority priority = tile->priority(PENDING_TREE); | 2861 TilePriority priority = tile->priority(PENDING_TREE); |
| 2866 | 2862 |
| 2867 EXPECT_TRUE(tile); | 2863 EXPECT_TRUE(tile); |
| 2868 | 2864 |
| 2869 // Non-high res tiles only get visible tiles. | 2865 // Non-high res tiles only get visible tiles. |
| 2870 EXPECT_EQ(HIGH_RESOLUTION, priority.resolution); | 2866 EXPECT_EQ(HIGH_RESOLUTION, priority.resolution); |
| 2871 EXPECT_NE(TilePriority::NOW, priority.priority_bin); | 2867 EXPECT_NE(TilePriority::NOW, priority.priority_bin); |
| 2872 | 2868 |
| 2873 high_res_tile_count += priority.resolution == HIGH_RESOLUTION; | 2869 high_res_tile_count += priority.resolution == HIGH_RESOLUTION; |
| 2874 | 2870 |
| 2875 unique_tiles.insert(tile); | 2871 unique_tiles.insert(tile); |
| 2872 queue->Pop(); |
| 2876 } | 2873 } |
| 2877 | 2874 |
| 2878 EXPECT_EQ(16u, high_res_tile_count); | 2875 EXPECT_EQ(16u, high_res_tile_count); |
| 2879 EXPECT_EQ(high_res_tile_count, unique_tiles.size()); | 2876 EXPECT_EQ(high_res_tile_count, unique_tiles.size()); |
| 2880 | 2877 |
| 2881 time_ticks += base::TimeDelta::FromMilliseconds(200); | 2878 time_ticks += base::TimeDelta::FromMilliseconds(200); |
| 2882 host_impl_.SetCurrentBeginFrameArgs( | 2879 host_impl_.SetCurrentBeginFrameArgs( |
| 2883 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); | 2880 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); |
| 2884 | 2881 |
| 2885 pending_layer_->draw_properties().visible_content_rect = | 2882 pending_layer_->draw_properties().visible_content_rect = |
| 2886 gfx::Rect(0, 0, 500, 500); | 2883 gfx::Rect(0, 0, 500, 500); |
| 2887 pending_layer_->UpdateTiles(Occlusion(), resourceless_software_draw); | 2884 pending_layer_->UpdateTiles(Occlusion(), resourceless_software_draw); |
| 2888 | 2885 |
| 2889 std::vector<Tile*> high_res_tiles = high_res_tiling->AllTilesForTesting(); | 2886 std::vector<Tile*> high_res_tiles = high_res_tiling->AllTilesForTesting(); |
| 2890 for (std::vector<Tile*>::iterator tile_it = high_res_tiles.begin(); | 2887 for (std::vector<Tile*>::iterator tile_it = high_res_tiles.begin(); |
| 2891 tile_it != high_res_tiles.end(); | 2888 tile_it != high_res_tiles.end(); |
| 2892 ++tile_it) { | 2889 ++tile_it) { |
| 2893 Tile* tile = *tile_it; | 2890 Tile* tile = *tile_it; |
| 2894 ManagedTileState::DrawInfo& draw_info = tile->draw_info(); | 2891 ManagedTileState::DrawInfo& draw_info = tile->draw_info(); |
| 2895 draw_info.SetSolidColorForTesting(SK_ColorRED); | 2892 draw_info.SetSolidColorForTesting(SK_ColorRED); |
| 2896 } | 2893 } |
| 2897 | 2894 |
| 2898 non_ideal_tile_count = 0; | 2895 non_ideal_tile_count = 0; |
| 2899 low_res_tile_count = 0; | 2896 low_res_tile_count = 0; |
| 2900 high_res_tile_count = 0; | 2897 high_res_tile_count = 0; |
| 2901 for (it = PictureLayerImpl::LayerRasterTileIterator(pending_layer_, true); it; | 2898 queue = pending_layer_->CreateRasterQueue(true); |
| 2902 ++it) { | 2899 while (!queue->IsEmpty()) { |
| 2903 Tile* tile = *it; | 2900 Tile* tile = queue->Top(); |
| 2904 TilePriority priority = tile->priority(PENDING_TREE); | 2901 TilePriority priority = tile->priority(PENDING_TREE); |
| 2905 | 2902 |
| 2906 EXPECT_TRUE(tile); | 2903 EXPECT_TRUE(tile); |
| 2907 | 2904 |
| 2908 non_ideal_tile_count += priority.resolution == NON_IDEAL_RESOLUTION; | 2905 non_ideal_tile_count += priority.resolution == NON_IDEAL_RESOLUTION; |
| 2909 low_res_tile_count += priority.resolution == LOW_RESOLUTION; | 2906 low_res_tile_count += priority.resolution == LOW_RESOLUTION; |
| 2910 high_res_tile_count += priority.resolution == HIGH_RESOLUTION; | 2907 high_res_tile_count += priority.resolution == HIGH_RESOLUTION; |
| 2908 queue->Pop(); |
| 2911 } | 2909 } |
| 2912 | 2910 |
| 2913 EXPECT_EQ(0u, non_ideal_tile_count); | 2911 EXPECT_EQ(0u, non_ideal_tile_count); |
| 2914 EXPECT_EQ(1u, low_res_tile_count); | 2912 EXPECT_EQ(1u, low_res_tile_count); |
| 2915 EXPECT_EQ(0u, high_res_tile_count); | 2913 EXPECT_EQ(0u, high_res_tile_count); |
| 2916 } | 2914 } |
| 2917 | 2915 |
| 2918 TEST_F(PictureLayerImplTest, TilingSetEvictionQueue) { | 2916 TEST_F(PictureLayerImplTest, TilingSetEvictionQueue) { |
| 2919 gfx::Size tile_size(100, 100); | 2917 gfx::Size tile_size(100, 100); |
| 2920 gfx::Size layer_bounds(1000, 1000); | 2918 gfx::Size layer_bounds(1000, 1000); |
| (...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3916 scoped_refptr<FakePicturePileImpl> pending_pile = | 3914 scoped_refptr<FakePicturePileImpl> pending_pile = |
| 3917 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); | 3915 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); |
| 3918 SetupPendingTree(pending_pile); | 3916 SetupPendingTree(pending_pile); |
| 3919 pending_layer_->set_fixed_tile_size(tile_size); | 3917 pending_layer_->set_fixed_tile_size(tile_size); |
| 3920 | 3918 |
| 3921 host_impl_.SetViewportSize(viewport_size); | 3919 host_impl_.SetViewportSize(viewport_size); |
| 3922 host_impl_.pending_tree()->UpdateDrawProperties(); | 3920 host_impl_.pending_tree()->UpdateDrawProperties(); |
| 3923 | 3921 |
| 3924 // No occlusion. | 3922 // No occlusion. |
| 3925 int unoccluded_tile_count = 0; | 3923 int unoccluded_tile_count = 0; |
| 3926 for (PictureLayerImpl::LayerRasterTileIterator it = | 3924 scoped_ptr<TilingSetRasterQueue> queue = |
| 3927 PictureLayerImpl::LayerRasterTileIterator(pending_layer_, false); | 3925 pending_layer_->CreateRasterQueue(false); |
| 3928 it; | 3926 while (!queue->IsEmpty()) { |
| 3929 ++it) { | 3927 Tile* tile = queue->Top(); |
| 3930 Tile* tile = *it; | |
| 3931 | 3928 |
| 3932 // Occluded tiles should not be iterated over. | 3929 // Occluded tiles should not be iterated over. |
| 3933 EXPECT_FALSE(tile->is_occluded(PENDING_TREE)); | 3930 EXPECT_FALSE(tile->is_occluded(PENDING_TREE)); |
| 3934 | 3931 |
| 3935 // Some tiles may not be visible (i.e. outside the viewport). The rest are | 3932 // Some tiles may not be visible (i.e. outside the viewport). The rest are |
| 3936 // visible and at least partially unoccluded, verified by the above expect. | 3933 // visible and at least partially unoccluded, verified by the above expect. |
| 3937 bool tile_is_visible = | 3934 bool tile_is_visible = |
| 3938 tile->content_rect().Intersects(pending_layer_->visible_content_rect()); | 3935 tile->content_rect().Intersects(pending_layer_->visible_content_rect()); |
| 3939 if (tile_is_visible) | 3936 if (tile_is_visible) |
| 3940 unoccluded_tile_count++; | 3937 unoccluded_tile_count++; |
| 3938 queue->Pop(); |
| 3941 } | 3939 } |
| 3942 EXPECT_EQ(unoccluded_tile_count, 25); | 3940 EXPECT_EQ(unoccluded_tile_count, 25); |
| 3943 | 3941 |
| 3944 // Partial occlusion. | 3942 // Partial occlusion. |
| 3945 pending_layer_->AddChild(LayerImpl::Create(host_impl_.pending_tree(), 1)); | 3943 pending_layer_->AddChild(LayerImpl::Create(host_impl_.pending_tree(), 1)); |
| 3946 LayerImpl* layer1 = pending_layer_->children()[0]; | 3944 LayerImpl* layer1 = pending_layer_->children()[0]; |
| 3947 layer1->SetBounds(layer_bounds); | 3945 layer1->SetBounds(layer_bounds); |
| 3948 layer1->SetContentBounds(layer_bounds); | 3946 layer1->SetContentBounds(layer_bounds); |
| 3949 layer1->SetDrawsContent(true); | 3947 layer1->SetDrawsContent(true); |
| 3950 layer1->SetContentsOpaque(true); | 3948 layer1->SetContentsOpaque(true); |
| 3951 layer1->SetPosition(occluding_layer_position); | 3949 layer1->SetPosition(occluding_layer_position); |
| 3952 | 3950 |
| 3953 time_ticks += base::TimeDelta::FromMilliseconds(200); | 3951 time_ticks += base::TimeDelta::FromMilliseconds(200); |
| 3954 host_impl_.SetCurrentBeginFrameArgs( | 3952 host_impl_.SetCurrentBeginFrameArgs( |
| 3955 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); | 3953 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); |
| 3956 host_impl_.pending_tree()->UpdateDrawProperties(); | 3954 host_impl_.pending_tree()->UpdateDrawProperties(); |
| 3957 | 3955 |
| 3958 unoccluded_tile_count = 0; | 3956 unoccluded_tile_count = 0; |
| 3959 for (PictureLayerImpl::LayerRasterTileIterator it = | 3957 queue = pending_layer_->CreateRasterQueue(false); |
| 3960 PictureLayerImpl::LayerRasterTileIterator(pending_layer_, false); | 3958 while (!queue->IsEmpty()) { |
| 3961 it; | 3959 Tile* tile = queue->Top(); |
| 3962 ++it) { | |
| 3963 Tile* tile = *it; | |
| 3964 | 3960 |
| 3965 EXPECT_FALSE(tile->is_occluded(PENDING_TREE)); | 3961 EXPECT_FALSE(tile->is_occluded(PENDING_TREE)); |
| 3966 | 3962 |
| 3967 bool tile_is_visible = | 3963 bool tile_is_visible = |
| 3968 tile->content_rect().Intersects(pending_layer_->visible_content_rect()); | 3964 tile->content_rect().Intersects(pending_layer_->visible_content_rect()); |
| 3969 if (tile_is_visible) | 3965 if (tile_is_visible) |
| 3970 unoccluded_tile_count++; | 3966 unoccluded_tile_count++; |
| 3967 queue->Pop(); |
| 3971 } | 3968 } |
| 3972 EXPECT_EQ(20, unoccluded_tile_count); | 3969 EXPECT_EQ(20, unoccluded_tile_count); |
| 3973 | 3970 |
| 3974 // Full occlusion. | 3971 // Full occlusion. |
| 3975 layer1->SetPosition(gfx::Point(0, 0)); | 3972 layer1->SetPosition(gfx::Point(0, 0)); |
| 3976 | 3973 |
| 3977 time_ticks += base::TimeDelta::FromMilliseconds(200); | 3974 time_ticks += base::TimeDelta::FromMilliseconds(200); |
| 3978 host_impl_.SetCurrentBeginFrameArgs( | 3975 host_impl_.SetCurrentBeginFrameArgs( |
| 3979 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); | 3976 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); |
| 3980 host_impl_.pending_tree()->UpdateDrawProperties(); | 3977 host_impl_.pending_tree()->UpdateDrawProperties(); |
| 3981 | 3978 |
| 3982 unoccluded_tile_count = 0; | 3979 unoccluded_tile_count = 0; |
| 3983 for (PictureLayerImpl::LayerRasterTileIterator it = | 3980 queue = pending_layer_->CreateRasterQueue(false); |
| 3984 PictureLayerImpl::LayerRasterTileIterator(pending_layer_, false); | 3981 while (!queue->IsEmpty()) { |
| 3985 it; | 3982 Tile* tile = queue->Top(); |
| 3986 ++it) { | |
| 3987 Tile* tile = *it; | |
| 3988 | 3983 |
| 3989 EXPECT_FALSE(tile->is_occluded(PENDING_TREE)); | 3984 EXPECT_FALSE(tile->is_occluded(PENDING_TREE)); |
| 3990 | 3985 |
| 3991 bool tile_is_visible = | 3986 bool tile_is_visible = |
| 3992 tile->content_rect().Intersects(pending_layer_->visible_content_rect()); | 3987 tile->content_rect().Intersects(pending_layer_->visible_content_rect()); |
| 3993 if (tile_is_visible) | 3988 if (tile_is_visible) |
| 3994 unoccluded_tile_count++; | 3989 unoccluded_tile_count++; |
| 3990 queue->Pop(); |
| 3995 } | 3991 } |
| 3996 EXPECT_EQ(unoccluded_tile_count, 0); | 3992 EXPECT_EQ(unoccluded_tile_count, 0); |
| 3997 } | 3993 } |
| 3998 | 3994 |
| 3999 TEST_F(OcclusionTrackingPictureLayerImplTest, | 3995 TEST_F(OcclusionTrackingPictureLayerImplTest, |
| 4000 OccludedTilesNotMarkedAsRequired) { | 3996 OccludedTilesNotMarkedAsRequired) { |
| 4001 base::TimeTicks time_ticks; | 3997 base::TimeTicks time_ticks; |
| 4002 time_ticks += base::TimeDelta::FromMilliseconds(1); | 3998 time_ticks += base::TimeDelta::FromMilliseconds(1); |
| 4003 host_impl_.SetCurrentBeginFrameArgs( | 3999 host_impl_.SetCurrentBeginFrameArgs( |
| 4004 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); | 4000 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4760 result = layer->CalculateTileSize(gfx::Size(447, 400)); | 4756 result = layer->CalculateTileSize(gfx::Size(447, 400)); |
| 4761 EXPECT_EQ(result.width(), 448); | 4757 EXPECT_EQ(result.width(), 448); |
| 4762 EXPECT_EQ(result.height(), 448); | 4758 EXPECT_EQ(result.height(), 448); |
| 4763 result = layer->CalculateTileSize(gfx::Size(500, 499)); | 4759 result = layer->CalculateTileSize(gfx::Size(500, 499)); |
| 4764 EXPECT_EQ(result.width(), 512); | 4760 EXPECT_EQ(result.width(), 512); |
| 4765 EXPECT_EQ(result.height(), 500 + 2); | 4761 EXPECT_EQ(result.height(), 500 + 2); |
| 4766 } | 4762 } |
| 4767 | 4763 |
| 4768 } // namespace | 4764 } // namespace |
| 4769 } // namespace cc | 4765 } // namespace cc |
| OLD | NEW |