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 <limits> | 5 #include <limits> |
6 #include <set> | 6 #include <set> |
7 | 7 |
8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
9 #include "cc/test/fake_display_list_raster_source.h" | 9 #include "cc/test/fake_display_list_raster_source.h" |
10 #include "cc/test/fake_output_surface.h" | 10 #include "cc/test/fake_output_surface.h" |
(...skipping 1778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1789 scoped_refptr<FakeDisplayListRasterSource> raster_source = | 1789 scoped_refptr<FakeDisplayListRasterSource> raster_source = |
1790 FakeDisplayListRasterSource::CreateEmpty(layer_size); | 1790 FakeDisplayListRasterSource::CreateEmpty(layer_size); |
1791 tiling_ = TestablePictureLayerTiling::Create(PENDING_TREE, contents_scale, | 1791 tiling_ = TestablePictureLayerTiling::Create(PENDING_TREE, contents_scale, |
1792 raster_source, &client_, | 1792 raster_source, &client_, |
1793 LayerTreeSettings()); | 1793 LayerTreeSettings()); |
1794 | 1794 |
1795 gfx::Rect content_rect(25554432, 25554432, 950, 860); | 1795 gfx::Rect content_rect(25554432, 25554432, 950, 860); |
1796 VerifyTilesExactlyCoverRect(contents_scale, content_rect); | 1796 VerifyTilesExactlyCoverRect(contents_scale, content_rect); |
1797 } | 1797 } |
1798 | 1798 |
1799 TEST_F(PictureLayerTilingIteratorTest, | |
1800 InvalidatedIdRespectsEnabledPartialRaster) { | |
1801 // Verifies that a resize with invalidation for newly exposed pixels will | |
1802 // deletes tiles that intersect that invalidation. | |
1803 gfx::Size tile_size(100, 100); | |
1804 gfx::Size original_layer_size(10, 10); | |
1805 client_.SetTileSize(tile_size); | |
1806 scoped_refptr<FakeDisplayListRasterSource> raster_source = | |
1807 FakeDisplayListRasterSource::CreateFilled(original_layer_size); | |
1808 LayerTreeSettings settings; | |
1809 settings.enable_partial_raster = true; | |
1810 tiling_ = TestablePictureLayerTiling::Create(ACTIVE_TREE, 1.f, raster_source, | |
1811 &client_, settings); | |
1812 tiling_->set_resolution(HIGH_RESOLUTION); | |
1813 SetLiveRectAndVerifyTiles(gfx::Rect(original_layer_size)); | |
1814 | |
1815 // Tiling only has one tile, since its total size is less than one. | |
1816 EXPECT_TRUE(tiling_->TileAt(0, 0)); | |
1817 | |
1818 Region invalidation = | |
1819 SubtractRegions(gfx::Rect(tile_size), gfx::Rect(original_layer_size)); | |
1820 | |
1821 EXPECT_TRUE(tiling_->TileAt(0, 0)); | |
1822 EXPECT_FALSE(tiling_->TileAt(0, 0)->invalidated_id()); | |
vmpstr
2015/10/06 18:35:49
can you make this EXPECT_EQ(0, ...);
ericrk
2015/10/07 17:59:08
Done.
| |
1823 tiling_->Invalidate(invalidation); | |
1824 EXPECT_TRUE(tiling_->TileAt(0, 0)->invalidated_id()); | |
vmpstr
2015/10/06 18:35:49
Can you save off the original tile id and EXPECT_E
ericrk
2015/10/07 17:59:08
Done.
| |
1825 } | |
1826 | |
1827 TEST_F(PictureLayerTilingIteratorTest, | |
1828 InvalidatedIdRespectsDisabledPartialRaster) { | |
1829 // Verifies that a resize with invalidation for newly exposed pixels will | |
1830 // deletes tiles that intersect that invalidation. | |
1831 gfx::Size tile_size(100, 100); | |
1832 gfx::Size original_layer_size(10, 10); | |
1833 InitializeActive(tile_size, 1.f, original_layer_size); | |
1834 SetLiveRectAndVerifyTiles(gfx::Rect(original_layer_size)); | |
1835 | |
1836 // Tiling only has one tile, since its total size is less than one. | |
1837 EXPECT_TRUE(tiling_->TileAt(0, 0)); | |
1838 | |
1839 Region invalidation = | |
1840 SubtractRegions(gfx::Rect(tile_size), gfx::Rect(original_layer_size)); | |
1841 | |
1842 EXPECT_TRUE(tiling_->TileAt(0, 0)); | |
1843 EXPECT_FALSE(tiling_->TileAt(0, 0)->invalidated_id()); | |
vmpstr
2015/10/06 18:35:49
Same here.
ericrk
2015/10/07 17:59:08
Done.
| |
1844 tiling_->Invalidate(invalidation); | |
1845 EXPECT_FALSE(tiling_->TileAt(0, 0)->invalidated_id()); | |
1846 } | |
1847 | |
1799 } // namespace | 1848 } // namespace |
1800 } // namespace cc | 1849 } // namespace cc |
OLD | NEW |