| 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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 // software draw. | 536 // software draw. |
| 537 bool resourceless_software_draw = false; | 537 bool resourceless_software_draw = false; |
| 538 gfx::Rect viewport = gfx::Rect(layer_bounds); | 538 gfx::Rect viewport = gfx::Rect(layer_bounds); |
| 539 gfx::Transform transform; | 539 gfx::Transform transform; |
| 540 host_impl_.SetExternalDrawConstraints(transform, | 540 host_impl_.SetExternalDrawConstraints(transform, |
| 541 viewport, | 541 viewport, |
| 542 viewport, | 542 viewport, |
| 543 viewport, | 543 viewport, |
| 544 transform, | 544 transform, |
| 545 resourceless_software_draw); | 545 resourceless_software_draw); |
| 546 active_layer_->draw_properties().visible_content_rect = viewport; | 546 active_layer_->draw_properties().visible_layer_rect = viewport; |
| 547 active_layer_->draw_properties().screen_space_transform = transform; | 547 active_layer_->draw_properties().screen_space_transform = transform; |
| 548 active_layer_->UpdateTiles(resourceless_software_draw); | 548 active_layer_->UpdateTiles(resourceless_software_draw); |
| 549 | 549 |
| 550 gfx::Rect visible_rect_for_tile_priority = | 550 gfx::Rect visible_rect_for_tile_priority = |
| 551 active_layer_->visible_rect_for_tile_priority(); | 551 active_layer_->visible_rect_for_tile_priority(); |
| 552 EXPECT_FALSE(visible_rect_for_tile_priority.IsEmpty()); | 552 EXPECT_FALSE(visible_rect_for_tile_priority.IsEmpty()); |
| 553 gfx::Transform screen_space_transform_for_tile_priority = | 553 gfx::Transform screen_space_transform_for_tile_priority = |
| 554 active_layer_->screen_space_transform(); | 554 active_layer_->screen_space_transform(); |
| 555 | 555 |
| 556 // Expand viewport and set it as invalid for prioritizing tiles. | 556 // Expand viewport and set it as invalid for prioritizing tiles. |
| 557 // Should update viewport and transform, but not update visible rect. | 557 // Should update viewport and transform, but not update visible rect. |
| 558 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200)); | 558 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200)); |
| 559 resourceless_software_draw = true; | 559 resourceless_software_draw = true; |
| 560 viewport = gfx::ScaleToEnclosingRect(viewport, 2); | 560 viewport = gfx::ScaleToEnclosingRect(viewport, 2); |
| 561 transform.Translate(1.f, 1.f); | 561 transform.Translate(1.f, 1.f); |
| 562 active_layer_->draw_properties().visible_content_rect = viewport; | 562 active_layer_->draw_properties().visible_layer_rect = viewport; |
| 563 active_layer_->draw_properties().screen_space_transform = transform; | 563 active_layer_->draw_properties().screen_space_transform = transform; |
| 564 host_impl_.SetExternalDrawConstraints(transform, | 564 host_impl_.SetExternalDrawConstraints(transform, |
| 565 viewport, | 565 viewport, |
| 566 viewport, | 566 viewport, |
| 567 viewport, | 567 viewport, |
| 568 transform, | 568 transform, |
| 569 resourceless_software_draw); | 569 resourceless_software_draw); |
| 570 active_layer_->UpdateTiles(resourceless_software_draw); | 570 active_layer_->UpdateTiles(resourceless_software_draw); |
| 571 | 571 |
| 572 // Transform for tile priority is updated. | 572 // Transform for tile priority is updated. |
| (...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1614 gfx::Size layer_bounds(1300, 1900); | 1614 gfx::Size layer_bounds(1300, 1900); |
| 1615 | 1615 |
| 1616 scoped_refptr<FakePicturePileImpl> pending_pile = | 1616 scoped_refptr<FakePicturePileImpl> pending_pile = |
| 1617 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); | 1617 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); |
| 1618 scoped_refptr<FakePicturePileImpl> active_pile = | 1618 scoped_refptr<FakePicturePileImpl> active_pile = |
| 1619 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); | 1619 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); |
| 1620 | 1620 |
| 1621 gfx::Rect layer_invalidation(150, 200, 30, 180); | 1621 gfx::Rect layer_invalidation(150, 200, 30, 180); |
| 1622 SetupTreesWithInvalidation(pending_pile, active_pile, layer_invalidation); | 1622 SetupTreesWithInvalidation(pending_pile, active_pile, layer_invalidation); |
| 1623 | 1623 |
| 1624 active_layer_->draw_properties().visible_content_rect = | 1624 active_layer_->draw_properties().visible_layer_rect = gfx::Rect(layer_bounds); |
| 1625 gfx::Rect(layer_bounds); | |
| 1626 | 1625 |
| 1627 AppendQuadsData data; | 1626 AppendQuadsData data; |
| 1628 active_layer_->WillDraw(DRAW_MODE_RESOURCELESS_SOFTWARE, nullptr); | 1627 active_layer_->WillDraw(DRAW_MODE_RESOURCELESS_SOFTWARE, nullptr); |
| 1629 active_layer_->AppendQuads(render_pass.get(), &data); | 1628 active_layer_->AppendQuads(render_pass.get(), &data); |
| 1630 active_layer_->DidDraw(nullptr); | 1629 active_layer_->DidDraw(nullptr); |
| 1631 | 1630 |
| 1632 ASSERT_EQ(1U, render_pass->quad_list.size()); | 1631 ASSERT_EQ(1U, render_pass->quad_list.size()); |
| 1633 EXPECT_EQ(DrawQuad::PICTURE_CONTENT, | 1632 EXPECT_EQ(DrawQuad::PICTURE_CONTENT, |
| 1634 render_pass->quad_list.front()->material); | 1633 render_pass->quad_list.front()->material); |
| 1635 } | 1634 } |
| 1636 | 1635 |
| 1637 TEST_F(PictureLayerImplTest, SolidColorLayerHasVisibleFullCoverage) { | 1636 TEST_F(PictureLayerImplTest, SolidColorLayerHasVisibleFullCoverage) { |
| 1638 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); | 1637 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); |
| 1639 | 1638 |
| 1640 gfx::Size tile_size(1000, 1000); | 1639 gfx::Size tile_size(1000, 1000); |
| 1641 gfx::Size layer_bounds(1500, 1500); | 1640 gfx::Size layer_bounds(1500, 1500); |
| 1642 gfx::Rect visible_rect(250, 250, 1000, 1000); | 1641 gfx::Rect visible_rect(250, 250, 1000, 1000); |
| 1643 | 1642 |
| 1644 scoped_ptr<FakePicturePile> empty_recording = | 1643 scoped_ptr<FakePicturePile> empty_recording = |
| 1645 FakePicturePile::CreateEmptyPile(tile_size, layer_bounds); | 1644 FakePicturePile::CreateEmptyPile(tile_size, layer_bounds); |
| 1646 empty_recording->SetIsSolidColor(true); | 1645 empty_recording->SetIsSolidColor(true); |
| 1647 | 1646 |
| 1648 scoped_refptr<FakePicturePileImpl> pending_pile = | 1647 scoped_refptr<FakePicturePileImpl> pending_pile = |
| 1649 FakePicturePileImpl::CreateFromPile(empty_recording.get(), nullptr); | 1648 FakePicturePileImpl::CreateFromPile(empty_recording.get(), nullptr); |
| 1650 scoped_refptr<FakePicturePileImpl> active_pile = | 1649 scoped_refptr<FakePicturePileImpl> active_pile = |
| 1651 FakePicturePileImpl::CreateFromPile(empty_recording.get(), nullptr); | 1650 FakePicturePileImpl::CreateFromPile(empty_recording.get(), nullptr); |
| 1652 | 1651 |
| 1653 SetupTrees(pending_pile, active_pile); | 1652 SetupTrees(pending_pile, active_pile); |
| 1654 | 1653 |
| 1655 active_layer_->draw_properties().visible_content_rect = visible_rect; | 1654 active_layer_->draw_properties().visible_layer_rect = visible_rect; |
| 1656 | 1655 |
| 1657 AppendQuadsData data; | 1656 AppendQuadsData data; |
| 1658 active_layer_->WillDraw(DRAW_MODE_SOFTWARE, nullptr); | 1657 active_layer_->WillDraw(DRAW_MODE_SOFTWARE, nullptr); |
| 1659 active_layer_->AppendQuads(render_pass.get(), &data); | 1658 active_layer_->AppendQuads(render_pass.get(), &data); |
| 1660 active_layer_->DidDraw(nullptr); | 1659 active_layer_->DidDraw(nullptr); |
| 1661 | 1660 |
| 1662 Region remaining = visible_rect; | 1661 Region remaining = visible_rect; |
| 1663 for (const auto& quad : render_pass->quad_list) { | 1662 for (const auto& quad : render_pass->quad_list) { |
| 1664 EXPECT_TRUE(visible_rect.Contains(quad->rect)); | 1663 EXPECT_TRUE(visible_rect.Contains(quad->rect)); |
| 1665 EXPECT_TRUE(remaining.Contains(quad->rect)); | 1664 EXPECT_TRUE(remaining.Contains(quad->rect)); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1737 EXPECT_GT(num_offscreen, 0); | 1736 EXPECT_GT(num_offscreen, 0); |
| 1738 } | 1737 } |
| 1739 | 1738 |
| 1740 TEST_F(NoLowResPictureLayerImplTest, | 1739 TEST_F(NoLowResPictureLayerImplTest, |
| 1741 TileOutsideOfViewportForTilePriorityNotRequired) { | 1740 TileOutsideOfViewportForTilePriorityNotRequired) { |
| 1742 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); | 1741 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); |
| 1743 | 1742 |
| 1744 gfx::Size tile_size(100, 100); | 1743 gfx::Size tile_size(100, 100); |
| 1745 gfx::Size layer_bounds(400, 400); | 1744 gfx::Size layer_bounds(400, 400); |
| 1746 gfx::Rect external_viewport_for_tile_priority(400, 200); | 1745 gfx::Rect external_viewport_for_tile_priority(400, 200); |
| 1747 gfx::Rect visible_content_rect(200, 400); | 1746 gfx::Rect visible_layer_rect(200, 400); |
| 1748 | 1747 |
| 1749 scoped_refptr<FakePicturePileImpl> active_pile = | 1748 scoped_refptr<FakePicturePileImpl> active_pile = |
| 1750 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); | 1749 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); |
| 1751 scoped_refptr<FakePicturePileImpl> pending_pile = | 1750 scoped_refptr<FakePicturePileImpl> pending_pile = |
| 1752 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); | 1751 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); |
| 1753 SetupTreesWithFixedTileSize(pending_pile, active_pile, tile_size, Region()); | 1752 SetupTreesWithFixedTileSize(pending_pile, active_pile, tile_size, Region()); |
| 1754 | 1753 |
| 1755 ASSERT_EQ(1u, pending_layer_->num_tilings()); | 1754 ASSERT_EQ(1u, pending_layer_->num_tilings()); |
| 1756 ASSERT_EQ(1.f, pending_layer_->HighResTiling()->contents_scale()); | 1755 ASSERT_EQ(1.f, pending_layer_->HighResTiling()->contents_scale()); |
| 1757 | 1756 |
| 1758 // Set external viewport for tile priority. | 1757 // Set external viewport for tile priority. |
| 1759 gfx::Rect viewport = gfx::Rect(layer_bounds); | 1758 gfx::Rect viewport = gfx::Rect(layer_bounds); |
| 1760 gfx::Transform transform; | 1759 gfx::Transform transform; |
| 1761 gfx::Transform transform_for_tile_priority; | 1760 gfx::Transform transform_for_tile_priority; |
| 1762 bool resourceless_software_draw = false; | 1761 bool resourceless_software_draw = false; |
| 1763 host_impl_.SetExternalDrawConstraints(transform, | 1762 host_impl_.SetExternalDrawConstraints(transform, |
| 1764 viewport, | 1763 viewport, |
| 1765 viewport, | 1764 viewport, |
| 1766 external_viewport_for_tile_priority, | 1765 external_viewport_for_tile_priority, |
| 1767 transform_for_tile_priority, | 1766 transform_for_tile_priority, |
| 1768 resourceless_software_draw); | 1767 resourceless_software_draw); |
| 1769 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); | 1768 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); |
| 1770 bool update_lcd_text = false; | 1769 bool update_lcd_text = false; |
| 1771 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); | 1770 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); |
| 1772 | 1771 |
| 1773 // Set visible content rect that is different from | 1772 // Set visible content rect that is different from |
| 1774 // external_viewport_for_tile_priority. | 1773 // external_viewport_for_tile_priority. |
| 1775 pending_layer_->draw_properties().visible_content_rect = visible_content_rect; | 1774 pending_layer_->draw_properties().visible_layer_rect = visible_layer_rect; |
| 1776 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200)); | 1775 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200)); |
| 1777 pending_layer_->UpdateTiles(resourceless_software_draw); | 1776 pending_layer_->UpdateTiles(resourceless_software_draw); |
| 1778 | 1777 |
| 1779 // Intersect the two rects. Any tile outside should not be required for | 1778 // Intersect the two rects. Any tile outside should not be required for |
| 1780 // activation. | 1779 // activation. |
| 1781 gfx::Rect viewport_for_tile_priority = | 1780 gfx::Rect viewport_for_tile_priority = |
| 1782 pending_layer_->viewport_rect_for_tile_priority_in_content_space(); | 1781 pending_layer_->viewport_rect_for_tile_priority_in_content_space(); |
| 1783 viewport_for_tile_priority.Intersect(pending_layer_->visible_content_rect()); | 1782 viewport_for_tile_priority.Intersect(pending_layer_->visible_layer_rect()); |
| 1784 | 1783 |
| 1785 EXPECT_TRUE(pending_layer_->HighResTiling()->AllTilesForTesting().empty()); | 1784 EXPECT_TRUE(pending_layer_->HighResTiling()->AllTilesForTesting().empty()); |
| 1786 | 1785 |
| 1787 int num_inside = 0; | 1786 int num_inside = 0; |
| 1788 int num_outside = 0; | 1787 int num_outside = 0; |
| 1789 for (PictureLayerTiling::CoverageIterator iter(active_layer_->HighResTiling(), | 1788 for (PictureLayerTiling::CoverageIterator iter(active_layer_->HighResTiling(), |
| 1790 1.f, gfx::Rect(layer_bounds)); | 1789 1.f, gfx::Rect(layer_bounds)); |
| 1791 iter; ++iter) { | 1790 iter; ++iter) { |
| 1792 if (!*iter) | 1791 if (!*iter) |
| 1793 continue; | 1792 continue; |
| 1794 Tile* tile = *iter; | 1793 Tile* tile = *iter; |
| 1795 if (viewport_for_tile_priority.Intersects(iter.geometry_rect())) { | 1794 if (viewport_for_tile_priority.Intersects(iter.geometry_rect())) { |
| 1796 num_inside++; | 1795 num_inside++; |
| 1797 // Mark everything in viewport for tile priority as ready to draw. | 1796 // Mark everything in viewport for tile priority as ready to draw. |
| 1798 TileDrawInfo& draw_info = tile->draw_info(); | 1797 TileDrawInfo& draw_info = tile->draw_info(); |
| 1799 draw_info.SetSolidColorForTesting(SK_ColorRED); | 1798 draw_info.SetSolidColorForTesting(SK_ColorRED); |
| 1800 } else { | 1799 } else { |
| 1801 num_outside++; | 1800 num_outside++; |
| 1802 EXPECT_FALSE(tile->required_for_activation()); | 1801 EXPECT_FALSE(tile->required_for_activation()); |
| 1803 } | 1802 } |
| 1804 } | 1803 } |
| 1805 | 1804 |
| 1806 EXPECT_GT(num_inside, 0); | 1805 EXPECT_GT(num_inside, 0); |
| 1807 EXPECT_GT(num_outside, 0); | 1806 EXPECT_GT(num_outside, 0); |
| 1808 | 1807 |
| 1809 // Activate and draw active layer. | 1808 // Activate and draw active layer. |
| 1810 host_impl_.ActivateSyncTree(); | 1809 host_impl_.ActivateSyncTree(); |
| 1811 host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text); | 1810 host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text); |
| 1812 active_layer_->draw_properties().visible_content_rect = visible_content_rect; | 1811 active_layer_->draw_properties().visible_layer_rect = visible_layer_rect; |
| 1813 | 1812 |
| 1814 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); | 1813 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); |
| 1815 AppendQuadsData data; | 1814 AppendQuadsData data; |
| 1816 active_layer_->WillDraw(DRAW_MODE_SOFTWARE, nullptr); | 1815 active_layer_->WillDraw(DRAW_MODE_SOFTWARE, nullptr); |
| 1817 active_layer_->AppendQuads(render_pass.get(), &data); | 1816 active_layer_->AppendQuads(render_pass.get(), &data); |
| 1818 active_layer_->DidDraw(nullptr); | 1817 active_layer_->DidDraw(nullptr); |
| 1819 | 1818 |
| 1820 // All tiles in activation rect is ready to draw. | 1819 // All tiles in activation rect is ready to draw. |
| 1821 EXPECT_EQ(0u, data.num_missing_tiles); | 1820 EXPECT_EQ(0u, data.num_missing_tiles); |
| 1822 EXPECT_EQ(0u, data.num_incomplete_tiles); | 1821 EXPECT_EQ(0u, data.num_incomplete_tiles); |
| (...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2908 required_queue->Pop(); | 2907 required_queue->Pop(); |
| 2909 } | 2908 } |
| 2910 | 2909 |
| 2911 // All of the high res tiles should be required for activation, since there is | 2910 // All of the high res tiles should be required for activation, since there is |
| 2912 // no active twin. | 2911 // no active twin. |
| 2913 EXPECT_EQ(high_res_now_tiles, required_for_activation_count); | 2912 EXPECT_EQ(high_res_now_tiles, required_for_activation_count); |
| 2914 | 2913 |
| 2915 // No NOW tiles. | 2914 // No NOW tiles. |
| 2916 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200)); | 2915 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200)); |
| 2917 | 2916 |
| 2918 pending_layer_->draw_properties().visible_content_rect = | 2917 pending_layer_->draw_properties().visible_layer_rect = |
| 2919 gfx::Rect(1100, 1100, 500, 500); | 2918 gfx::Rect(1100, 1100, 500, 500); |
| 2920 bool resourceless_software_draw = false; | 2919 bool resourceless_software_draw = false; |
| 2921 pending_layer_->UpdateTiles(resourceless_software_draw); | 2920 pending_layer_->UpdateTiles(resourceless_software_draw); |
| 2922 | 2921 |
| 2923 unique_tiles.clear(); | 2922 unique_tiles.clear(); |
| 2924 high_res_tile_count = 0u; | 2923 high_res_tile_count = 0u; |
| 2925 queue.reset(new TilingSetRasterQueueAll( | 2924 queue.reset(new TilingSetRasterQueueAll( |
| 2926 pending_layer_->picture_layer_tiling_set(), false)); | 2925 pending_layer_->picture_layer_tiling_set(), false)); |
| 2927 while (!queue->IsEmpty()) { | 2926 while (!queue->IsEmpty()) { |
| 2928 PrioritizedTile prioritized_tile = queue->Top(); | 2927 PrioritizedTile prioritized_tile = queue->Top(); |
| 2929 TilePriority priority = prioritized_tile.priority(); | 2928 TilePriority priority = prioritized_tile.priority(); |
| 2930 | 2929 |
| 2931 EXPECT_TRUE(prioritized_tile.tile()); | 2930 EXPECT_TRUE(prioritized_tile.tile()); |
| 2932 | 2931 |
| 2933 // Non-high res tiles only get visible tiles. | 2932 // Non-high res tiles only get visible tiles. |
| 2934 EXPECT_EQ(HIGH_RESOLUTION, priority.resolution); | 2933 EXPECT_EQ(HIGH_RESOLUTION, priority.resolution); |
| 2935 EXPECT_NE(TilePriority::NOW, priority.priority_bin); | 2934 EXPECT_NE(TilePriority::NOW, priority.priority_bin); |
| 2936 | 2935 |
| 2937 high_res_tile_count += priority.resolution == HIGH_RESOLUTION; | 2936 high_res_tile_count += priority.resolution == HIGH_RESOLUTION; |
| 2938 | 2937 |
| 2939 unique_tiles.insert(prioritized_tile.tile()); | 2938 unique_tiles.insert(prioritized_tile.tile()); |
| 2940 queue->Pop(); | 2939 queue->Pop(); |
| 2941 } | 2940 } |
| 2942 | 2941 |
| 2943 EXPECT_EQ(16, high_res_tile_count); | 2942 EXPECT_EQ(16, high_res_tile_count); |
| 2944 EXPECT_EQ(high_res_tile_count, static_cast<int>(unique_tiles.size())); | 2943 EXPECT_EQ(high_res_tile_count, static_cast<int>(unique_tiles.size())); |
| 2945 | 2944 |
| 2946 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200)); | 2945 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200)); |
| 2947 | 2946 |
| 2948 pending_layer_->draw_properties().visible_content_rect = | 2947 pending_layer_->draw_properties().visible_layer_rect = |
| 2949 gfx::Rect(0, 0, 500, 500); | 2948 gfx::Rect(0, 0, 500, 500); |
| 2950 pending_layer_->UpdateTiles(resourceless_software_draw); | 2949 pending_layer_->UpdateTiles(resourceless_software_draw); |
| 2951 | 2950 |
| 2952 std::vector<Tile*> high_res_tiles = | 2951 std::vector<Tile*> high_res_tiles = |
| 2953 pending_layer_->HighResTiling()->AllTilesForTesting(); | 2952 pending_layer_->HighResTiling()->AllTilesForTesting(); |
| 2954 for (std::vector<Tile*>::iterator tile_it = high_res_tiles.begin(); | 2953 for (std::vector<Tile*>::iterator tile_it = high_res_tiles.begin(); |
| 2955 tile_it != high_res_tiles.end(); | 2954 tile_it != high_res_tiles.end(); |
| 2956 ++tile_it) { | 2955 ++tile_it) { |
| 2957 Tile* tile = *tile_it; | 2956 Tile* tile = *tile_it; |
| 2958 TileDrawInfo& draw_info = tile->draw_info(); | 2957 TileDrawInfo& draw_info = tile->draw_info(); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3058 } | 3057 } |
| 3059 | 3058 |
| 3060 std::set<Tile*> all_tiles_set(all_tiles.begin(), all_tiles.end()); | 3059 std::set<Tile*> all_tiles_set(all_tiles.begin(), all_tiles.end()); |
| 3061 | 3060 |
| 3062 bool mark_required = false; | 3061 bool mark_required = false; |
| 3063 size_t number_of_marked_tiles = 0u; | 3062 size_t number_of_marked_tiles = 0u; |
| 3064 size_t number_of_unmarked_tiles = 0u; | 3063 size_t number_of_unmarked_tiles = 0u; |
| 3065 for (size_t i = 0; i < pending_layer_->num_tilings(); ++i) { | 3064 for (size_t i = 0; i < pending_layer_->num_tilings(); ++i) { |
| 3066 PictureLayerTiling* tiling = pending_layer_->tilings()->tiling_at(i); | 3065 PictureLayerTiling* tiling = pending_layer_->tilings()->tiling_at(i); |
| 3067 for (PictureLayerTiling::CoverageIterator iter( | 3066 for (PictureLayerTiling::CoverageIterator iter( |
| 3068 tiling, 1.f, pending_layer_->visible_content_rect()); | 3067 tiling, 1.f, pending_layer_->visible_layer_rect()); |
| 3069 iter; ++iter) { | 3068 iter; ++iter) { |
| 3070 if (mark_required) { | 3069 if (mark_required) { |
| 3071 number_of_marked_tiles++; | 3070 number_of_marked_tiles++; |
| 3072 iter->set_required_for_activation(true); | 3071 iter->set_required_for_activation(true); |
| 3073 } else { | 3072 } else { |
| 3074 number_of_unmarked_tiles++; | 3073 number_of_unmarked_tiles++; |
| 3075 } | 3074 } |
| 3076 mark_required = !mark_required; | 3075 mark_required = !mark_required; |
| 3077 } | 3076 } |
| 3078 } | 3077 } |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3201 gfx::Rect occluded; | 3200 gfx::Rect occluded; |
| 3202 impl.AppendQuadsWithOcclusion(active_layer_, occluded); | 3201 impl.AppendQuadsWithOcclusion(active_layer_, occluded); |
| 3203 | 3202 |
| 3204 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), | 3203 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), |
| 3205 gfx::Rect(layer_bounds)); | 3204 gfx::Rect(layer_bounds)); |
| 3206 EXPECT_EQ(100u, impl.quad_list().size()); | 3205 EXPECT_EQ(100u, impl.quad_list().size()); |
| 3207 } | 3206 } |
| 3208 | 3207 |
| 3209 { | 3208 { |
| 3210 SCOPED_TRACE("Full occlusion"); | 3209 SCOPED_TRACE("Full occlusion"); |
| 3211 gfx::Rect occluded(active_layer_->visible_content_rect()); | 3210 gfx::Rect occluded(active_layer_->visible_layer_rect()); |
| 3212 impl.AppendQuadsWithOcclusion(active_layer_, occluded); | 3211 impl.AppendQuadsWithOcclusion(active_layer_, occluded); |
| 3213 | 3212 |
| 3214 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect()); | 3213 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect()); |
| 3215 EXPECT_EQ(impl.quad_list().size(), 0u); | 3214 EXPECT_EQ(impl.quad_list().size(), 0u); |
| 3216 } | 3215 } |
| 3217 | 3216 |
| 3218 { | 3217 { |
| 3219 SCOPED_TRACE("Partial occlusion"); | 3218 SCOPED_TRACE("Partial occlusion"); |
| 3220 gfx::Rect occluded(150, 0, 200, 1000); | 3219 gfx::Rect occluded(150, 0, 200, 1000); |
| 3221 impl.AppendQuadsWithOcclusion(active_layer_, occluded); | 3220 impl.AppendQuadsWithOcclusion(active_layer_, occluded); |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3560 // software draw. | 3559 // software draw. |
| 3561 bool resourceless_software_draw = false; | 3560 bool resourceless_software_draw = false; |
| 3562 gfx::Rect viewport = gfx::Rect(layer_bounds); | 3561 gfx::Rect viewport = gfx::Rect(layer_bounds); |
| 3563 gfx::Transform transform; | 3562 gfx::Transform transform; |
| 3564 host_impl_.SetExternalDrawConstraints(transform, | 3563 host_impl_.SetExternalDrawConstraints(transform, |
| 3565 viewport, | 3564 viewport, |
| 3566 viewport, | 3565 viewport, |
| 3567 viewport, | 3566 viewport, |
| 3568 transform, | 3567 transform, |
| 3569 resourceless_software_draw); | 3568 resourceless_software_draw); |
| 3570 active_layer_->draw_properties().visible_content_rect = viewport; | 3569 active_layer_->draw_properties().visible_layer_rect = viewport; |
| 3571 active_layer_->draw_properties().screen_space_transform = transform; | 3570 active_layer_->draw_properties().screen_space_transform = transform; |
| 3572 active_layer_->UpdateTiles(resourceless_software_draw); | 3571 active_layer_->UpdateTiles(resourceless_software_draw); |
| 3573 | 3572 |
| 3574 gfx::Rect visible_rect_for_tile_priority = | 3573 gfx::Rect visible_rect_for_tile_priority = |
| 3575 active_layer_->visible_rect_for_tile_priority(); | 3574 active_layer_->visible_rect_for_tile_priority(); |
| 3576 EXPECT_FALSE(visible_rect_for_tile_priority.IsEmpty()); | 3575 EXPECT_FALSE(visible_rect_for_tile_priority.IsEmpty()); |
| 3577 gfx::Transform screen_space_transform_for_tile_priority = | 3576 gfx::Transform screen_space_transform_for_tile_priority = |
| 3578 active_layer_->screen_space_transform(); | 3577 active_layer_->screen_space_transform(); |
| 3579 | 3578 |
| 3580 // Expand viewport and set it as invalid for prioritizing tiles. | 3579 // Expand viewport and set it as invalid for prioritizing tiles. |
| 3581 // Should update viewport and transform, but not update visible rect. | 3580 // Should update viewport and transform, but not update visible rect. |
| 3582 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200)); | 3581 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200)); |
| 3583 resourceless_software_draw = true; | 3582 resourceless_software_draw = true; |
| 3584 viewport = gfx::ScaleToEnclosingRect(viewport, 2); | 3583 viewport = gfx::ScaleToEnclosingRect(viewport, 2); |
| 3585 transform.Translate(1.f, 1.f); | 3584 transform.Translate(1.f, 1.f); |
| 3586 active_layer_->draw_properties().visible_content_rect = viewport; | 3585 active_layer_->draw_properties().visible_layer_rect = viewport; |
| 3587 active_layer_->draw_properties().screen_space_transform = transform; | 3586 active_layer_->draw_properties().screen_space_transform = transform; |
| 3588 host_impl_.SetExternalDrawConstraints(transform, | 3587 host_impl_.SetExternalDrawConstraints(transform, |
| 3589 viewport, | 3588 viewport, |
| 3590 viewport, | 3589 viewport, |
| 3591 viewport, | 3590 viewport, |
| 3592 transform, | 3591 transform, |
| 3593 resourceless_software_draw); | 3592 resourceless_software_draw); |
| 3594 active_layer_->UpdateTiles(resourceless_software_draw); | 3593 active_layer_->UpdateTiles(resourceless_software_draw); |
| 3595 | 3594 |
| 3596 // Transform for tile priority is updated. | 3595 // Transform for tile priority is updated. |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3791 | 3790 |
| 3792 gfx::Transform scaled_draw_transform = active_layer_->draw_transform(); | 3791 gfx::Transform scaled_draw_transform = active_layer_->draw_transform(); |
| 3793 scaled_draw_transform.Scale(SK_MScalar1 / max_contents_scale, | 3792 scaled_draw_transform.Scale(SK_MScalar1 / max_contents_scale, |
| 3794 SK_MScalar1 / max_contents_scale); | 3793 SK_MScalar1 / max_contents_scale); |
| 3795 | 3794 |
| 3796 AppendQuadsData data; | 3795 AppendQuadsData data; |
| 3797 active_layer_->AppendQuads(render_pass.get(), &data); | 3796 active_layer_->AppendQuads(render_pass.get(), &data); |
| 3798 | 3797 |
| 3799 // SharedQuadState should have be of size 1, as we are doing AppenQuad once. | 3798 // SharedQuadState should have be of size 1, as we are doing AppenQuad once. |
| 3800 EXPECT_EQ(1u, render_pass->shared_quad_state_list.size()); | 3799 EXPECT_EQ(1u, render_pass->shared_quad_state_list.size()); |
| 3801 // The content_to_target_transform should be scaled by the | 3800 // The quad_to_target_transform should be scaled by the |
| 3802 // MaximumTilingContentsScale on the layer. | 3801 // MaximumTilingContentsScale on the layer. |
| 3803 EXPECT_EQ(scaled_draw_transform.ToString(), | 3802 EXPECT_EQ(scaled_draw_transform.ToString(), |
| 3804 render_pass->shared_quad_state_list.front() | 3803 render_pass->shared_quad_state_list.front() |
| 3805 ->content_to_target_transform.ToString()); | 3804 ->quad_to_target_transform.ToString()); |
| 3806 // The content_bounds should be scaled by the | 3805 // The content_bounds should be scaled by the |
| 3807 // MaximumTilingContentsScale on the layer. | 3806 // MaximumTilingContentsScale on the layer. |
| 3808 EXPECT_EQ( | 3807 EXPECT_EQ(gfx::Size(2500u, 5000u).ToString(), |
| 3809 gfx::Size(2500u, 5000u).ToString(), | 3808 render_pass->shared_quad_state_list.front() |
| 3810 render_pass->shared_quad_state_list.front()->content_bounds.ToString()); | 3809 ->quad_layer_bounds.ToString()); |
| 3811 // The visible_content_rect should be scaled by the | 3810 // The visible_layer_rect should be scaled by the |
| 3812 // MaximumTilingContentsScale on the layer. | 3811 // MaximumTilingContentsScale on the layer. |
| 3813 EXPECT_EQ(gfx::Rect(0u, 0u, 2500u, 5000u).ToString(), | 3812 EXPECT_EQ(gfx::Rect(0u, 0u, 2500u, 5000u).ToString(), |
| 3814 render_pass->shared_quad_state_list.front() | 3813 render_pass->shared_quad_state_list.front() |
| 3815 ->visible_content_rect.ToString()); | 3814 ->visible_quad_layer_rect.ToString()); |
| 3816 } | 3815 } |
| 3817 | 3816 |
| 3818 class PictureLayerImplTestWithDelegatingRenderer : public PictureLayerImplTest { | 3817 class PictureLayerImplTestWithDelegatingRenderer : public PictureLayerImplTest { |
| 3819 public: | 3818 public: |
| 3820 PictureLayerImplTestWithDelegatingRenderer() : PictureLayerImplTest() {} | 3819 PictureLayerImplTestWithDelegatingRenderer() : PictureLayerImplTest() {} |
| 3821 | 3820 |
| 3822 void InitializeRenderer() override { | 3821 void InitializeRenderer() override { |
| 3823 host_impl_.InitializeRenderer(FakeOutputSurface::CreateDelegating3d()); | 3822 host_impl_.InitializeRenderer(FakeOutputSurface::CreateDelegating3d()); |
| 3824 } | 3823 } |
| 3825 }; | 3824 }; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3949 while (!queue->IsEmpty()) { | 3948 while (!queue->IsEmpty()) { |
| 3950 PrioritizedTile prioritized_tile = queue->Top(); | 3949 PrioritizedTile prioritized_tile = queue->Top(); |
| 3951 Tile* tile = prioritized_tile.tile(); | 3950 Tile* tile = prioritized_tile.tile(); |
| 3952 | 3951 |
| 3953 // Occluded tiles should not be iterated over. | 3952 // Occluded tiles should not be iterated over. |
| 3954 EXPECT_FALSE(prioritized_tile.is_occluded()); | 3953 EXPECT_FALSE(prioritized_tile.is_occluded()); |
| 3955 | 3954 |
| 3956 // Some tiles may not be visible (i.e. outside the viewport). The rest are | 3955 // Some tiles may not be visible (i.e. outside the viewport). The rest are |
| 3957 // visible and at least partially unoccluded, verified by the above expect. | 3956 // visible and at least partially unoccluded, verified by the above expect. |
| 3958 bool tile_is_visible = | 3957 bool tile_is_visible = |
| 3959 tile->content_rect().Intersects(pending_layer_->visible_content_rect()); | 3958 tile->content_rect().Intersects(pending_layer_->visible_layer_rect()); |
| 3960 if (tile_is_visible) | 3959 if (tile_is_visible) |
| 3961 unoccluded_tile_count++; | 3960 unoccluded_tile_count++; |
| 3962 queue->Pop(); | 3961 queue->Pop(); |
| 3963 } | 3962 } |
| 3964 EXPECT_EQ(unoccluded_tile_count, 25); | 3963 EXPECT_EQ(unoccluded_tile_count, 25); |
| 3965 | 3964 |
| 3966 // Partial occlusion. | 3965 // Partial occlusion. |
| 3967 pending_layer_->AddChild(LayerImpl::Create(host_impl_.pending_tree(), 1)); | 3966 pending_layer_->AddChild(LayerImpl::Create(host_impl_.pending_tree(), 1)); |
| 3968 LayerImpl* layer1 = pending_layer_->children()[0]; | 3967 LayerImpl* layer1 = pending_layer_->children()[0]; |
| 3969 layer1->SetBounds(layer_bounds); | 3968 layer1->SetBounds(layer_bounds); |
| 3970 layer1->SetDrawsContent(true); | 3969 layer1->SetDrawsContent(true); |
| 3971 layer1->SetContentsOpaque(true); | 3970 layer1->SetContentsOpaque(true); |
| 3972 layer1->SetPosition(occluding_layer_position); | 3971 layer1->SetPosition(occluding_layer_position); |
| 3973 | 3972 |
| 3974 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200)); | 3973 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200)); |
| 3975 bool update_lcd_text = false; | 3974 bool update_lcd_text = false; |
| 3976 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); | 3975 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); |
| 3977 | 3976 |
| 3978 unoccluded_tile_count = 0; | 3977 unoccluded_tile_count = 0; |
| 3979 queue.reset(new TilingSetRasterQueueAll( | 3978 queue.reset(new TilingSetRasterQueueAll( |
| 3980 pending_layer_->picture_layer_tiling_set(), false)); | 3979 pending_layer_->picture_layer_tiling_set(), false)); |
| 3981 while (!queue->IsEmpty()) { | 3980 while (!queue->IsEmpty()) { |
| 3982 PrioritizedTile prioritized_tile = queue->Top(); | 3981 PrioritizedTile prioritized_tile = queue->Top(); |
| 3983 Tile* tile = prioritized_tile.tile(); | 3982 Tile* tile = prioritized_tile.tile(); |
| 3984 | 3983 |
| 3985 EXPECT_FALSE(prioritized_tile.is_occluded()); | 3984 EXPECT_FALSE(prioritized_tile.is_occluded()); |
| 3986 | 3985 |
| 3987 bool tile_is_visible = | 3986 bool tile_is_visible = |
| 3988 tile->content_rect().Intersects(pending_layer_->visible_content_rect()); | 3987 tile->content_rect().Intersects(pending_layer_->visible_layer_rect()); |
| 3989 if (tile_is_visible) | 3988 if (tile_is_visible) |
| 3990 unoccluded_tile_count++; | 3989 unoccluded_tile_count++; |
| 3991 queue->Pop(); | 3990 queue->Pop(); |
| 3992 } | 3991 } |
| 3993 EXPECT_EQ(20, unoccluded_tile_count); | 3992 EXPECT_EQ(20, unoccluded_tile_count); |
| 3994 | 3993 |
| 3995 // Full occlusion. | 3994 // Full occlusion. |
| 3996 layer1->SetPosition(gfx::Point(0, 0)); | 3995 layer1->SetPosition(gfx::Point(0, 0)); |
| 3997 | 3996 |
| 3998 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200)); | 3997 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200)); |
| 3999 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); | 3998 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); |
| 4000 | 3999 |
| 4001 unoccluded_tile_count = 0; | 4000 unoccluded_tile_count = 0; |
| 4002 queue.reset(new TilingSetRasterQueueAll( | 4001 queue.reset(new TilingSetRasterQueueAll( |
| 4003 pending_layer_->picture_layer_tiling_set(), false)); | 4002 pending_layer_->picture_layer_tiling_set(), false)); |
| 4004 while (!queue->IsEmpty()) { | 4003 while (!queue->IsEmpty()) { |
| 4005 PrioritizedTile prioritized_tile = queue->Top(); | 4004 PrioritizedTile prioritized_tile = queue->Top(); |
| 4006 Tile* tile = prioritized_tile.tile(); | 4005 Tile* tile = prioritized_tile.tile(); |
| 4007 | 4006 |
| 4008 EXPECT_FALSE(prioritized_tile.is_occluded()); | 4007 EXPECT_FALSE(prioritized_tile.is_occluded()); |
| 4009 | 4008 |
| 4010 bool tile_is_visible = | 4009 bool tile_is_visible = |
| 4011 tile->content_rect().Intersects(pending_layer_->visible_content_rect()); | 4010 tile->content_rect().Intersects(pending_layer_->visible_layer_rect()); |
| 4012 if (tile_is_visible) | 4011 if (tile_is_visible) |
| 4013 unoccluded_tile_count++; | 4012 unoccluded_tile_count++; |
| 4014 queue->Pop(); | 4013 queue->Pop(); |
| 4015 } | 4014 } |
| 4016 EXPECT_EQ(unoccluded_tile_count, 0); | 4015 EXPECT_EQ(unoccluded_tile_count, 0); |
| 4017 } | 4016 } |
| 4018 | 4017 |
| 4019 TEST_F(OcclusionTrackingPictureLayerImplTest, | 4018 TEST_F(OcclusionTrackingPictureLayerImplTest, |
| 4020 OccludedTilesNotMarkedAsRequired) { | 4019 OccludedTilesNotMarkedAsRequired) { |
| 4021 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); | 4020 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4599 | 4598 |
| 4600 SetupTrees(pending_pile, active_pile); | 4599 SetupTrees(pending_pile, active_pile); |
| 4601 | 4600 |
| 4602 Region invalidation; | 4601 Region invalidation; |
| 4603 gfx::Rect viewport = gfx::Rect(0, 0, 100, 100); | 4602 gfx::Rect viewport = gfx::Rect(0, 0, 100, 100); |
| 4604 gfx::Transform transform; | 4603 gfx::Transform transform; |
| 4605 | 4604 |
| 4606 host_impl_.SetRequiresHighResToDraw(); | 4605 host_impl_.SetRequiresHighResToDraw(); |
| 4607 | 4606 |
| 4608 // Update tiles. | 4607 // Update tiles. |
| 4609 pending_layer_->draw_properties().visible_content_rect = viewport; | 4608 pending_layer_->draw_properties().visible_layer_rect = viewport; |
| 4610 pending_layer_->draw_properties().screen_space_transform = transform; | 4609 pending_layer_->draw_properties().screen_space_transform = transform; |
| 4611 SetupDrawPropertiesAndUpdateTiles(pending_layer_, 1.f, 1.f, 1.f, 1.f, 0.f, | 4610 SetupDrawPropertiesAndUpdateTiles(pending_layer_, 1.f, 1.f, 1.f, 1.f, 0.f, |
| 4612 false); | 4611 false); |
| 4613 pending_layer_->HighResTiling()->UpdateAllRequiredStateForTesting(); | 4612 pending_layer_->HighResTiling()->UpdateAllRequiredStateForTesting(); |
| 4614 | 4613 |
| 4615 // Ensure we can't activate. | 4614 // Ensure we can't activate. |
| 4616 EXPECT_FALSE(host_impl_.tile_manager()->IsReadyToActivate()); | 4615 EXPECT_FALSE(host_impl_.tile_manager()->IsReadyToActivate()); |
| 4617 | 4616 |
| 4618 // Now in the same frame, move the viewport (this can happen during | 4617 // Now in the same frame, move the viewport (this can happen during |
| 4619 // animation). | 4618 // animation). |
| 4620 viewport = gfx::Rect(0, 2000, 100, 100); | 4619 viewport = gfx::Rect(0, 2000, 100, 100); |
| 4621 | 4620 |
| 4622 // Update tiles. | 4621 // Update tiles. |
| 4623 pending_layer_->draw_properties().visible_content_rect = viewport; | 4622 pending_layer_->draw_properties().visible_layer_rect = viewport; |
| 4624 pending_layer_->draw_properties().screen_space_transform = transform; | 4623 pending_layer_->draw_properties().screen_space_transform = transform; |
| 4625 SetupDrawPropertiesAndUpdateTiles(pending_layer_, 1.f, 1.f, 1.f, 1.f, 0.f, | 4624 SetupDrawPropertiesAndUpdateTiles(pending_layer_, 1.f, 1.f, 1.f, 1.f, 0.f, |
| 4626 false); | 4625 false); |
| 4627 pending_layer_->HighResTiling()->UpdateAllRequiredStateForTesting(); | 4626 pending_layer_->HighResTiling()->UpdateAllRequiredStateForTesting(); |
| 4628 | 4627 |
| 4629 // Make sure all viewport tiles (viewport from the tiling) are ready to draw. | 4628 // Make sure all viewport tiles (viewport from the tiling) are ready to draw. |
| 4630 std::vector<Tile*> tiles; | 4629 std::vector<Tile*> tiles; |
| 4631 for (PictureLayerTiling::CoverageIterator iter( | 4630 for (PictureLayerTiling::CoverageIterator iter( |
| 4632 pending_layer_->HighResTiling(), | 4631 pending_layer_->HighResTiling(), |
| 4633 1.f, | 4632 1.f, |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4952 result = layer->CalculateTileSize(gfx::Size(447, 400)); | 4951 result = layer->CalculateTileSize(gfx::Size(447, 400)); |
| 4953 EXPECT_EQ(result.width(), 448); | 4952 EXPECT_EQ(result.width(), 448); |
| 4954 EXPECT_EQ(result.height(), 448); | 4953 EXPECT_EQ(result.height(), 448); |
| 4955 result = layer->CalculateTileSize(gfx::Size(500, 499)); | 4954 result = layer->CalculateTileSize(gfx::Size(500, 499)); |
| 4956 EXPECT_EQ(result.width(), 512); | 4955 EXPECT_EQ(result.width(), 512); |
| 4957 EXPECT_EQ(result.height(), 500 + 2); | 4956 EXPECT_EQ(result.height(), 500 + 2); |
| 4958 } | 4957 } |
| 4959 | 4958 |
| 4960 } // namespace | 4959 } // namespace |
| 4961 } // namespace cc | 4960 } // namespace cc |
| OLD | NEW |