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

Side by Side Diff: cc/tiles/picture_layer_tiling_unittest.cc

Issue 1841083004: cc: Indicate that we've updated a tiling if we invalidated it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/tiles/picture_layer_tiling.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <limits> 7 #include <limits>
8 #include <set> 8 #include <set>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 1766 matching lines...) Expand 10 before | Expand all | Expand 10 after
1777 1777
1778 EXPECT_TRUE(active_tiling->TileAt(0, 0)); 1778 EXPECT_TRUE(active_tiling->TileAt(0, 0));
1779 EXPECT_FALSE(recycle_tiling->TileAt(0, 0)); 1779 EXPECT_FALSE(recycle_tiling->TileAt(0, 0));
1780 1780
1781 // Reset the active tiling. The recycle tiles should be released too. 1781 // Reset the active tiling. The recycle tiles should be released too.
1782 active_tiling->Reset(); 1782 active_tiling->Reset();
1783 EXPECT_FALSE(active_tiling->TileAt(0, 0)); 1783 EXPECT_FALSE(active_tiling->TileAt(0, 0));
1784 EXPECT_FALSE(recycle_tiling->TileAt(0, 0)); 1784 EXPECT_FALSE(recycle_tiling->TileAt(0, 0));
1785 } 1785 }
1786 1786
1787 TEST(PictureLayerTilingTest, InvalidateAfterComputeTilePriorityRects) {
enne (OOO) 2016/04/04 18:43:51 WTB a comment for the scenario that this is testin
vmpstr 2016/04/04 19:45:29 Done.
1788 FakePictureLayerTilingClient pending_client;
1789 pending_client.SetTileSize(gfx::Size(100, 100));
1790
1791 scoped_refptr<FakeRasterSource> raster_source =
1792 FakeRasterSource::CreateFilled(gfx::Size(100, 100));
1793 scoped_ptr<TestablePictureLayerTiling> pending_tiling =
1794 TestablePictureLayerTiling::Create(PENDING_TREE, 1.0f, raster_source,
1795 &pending_client, LayerTreeSettings());
1796 pending_tiling->set_resolution(HIGH_RESOLUTION);
1797
1798 double time = 1.;
1799 gfx::Rect viewport(0, 0, 100, 100);
1800 EXPECT_TRUE(pending_tiling->ComputeTilePriorityRects(viewport, 1.0f, time,
1801 Occlusion()));
1802 pending_tiling->Invalidate(viewport);
1803 EXPECT_TRUE(pending_tiling->ComputeTilePriorityRects(viewport, 1.0f, time,
1804 Occlusion()));
1805 }
1806
1787 TEST_F(PictureLayerTilingIteratorTest, ResizeTilesAndUpdateToCurrent) { 1807 TEST_F(PictureLayerTilingIteratorTest, ResizeTilesAndUpdateToCurrent) {
1788 // The tiling has four rows and three columns. 1808 // The tiling has four rows and three columns.
1789 Initialize(gfx::Size(150, 100), 1.f, gfx::Size(250, 150)); 1809 Initialize(gfx::Size(150, 100), 1.f, gfx::Size(250, 150));
1790 tiling_->CreateAllTilesForTesting(); 1810 tiling_->CreateAllTilesForTesting();
1791 EXPECT_EQ(150, tiling_->TilingDataForTesting().max_texture_size().width()); 1811 EXPECT_EQ(150, tiling_->TilingDataForTesting().max_texture_size().width());
1792 EXPECT_EQ(100, tiling_->TilingDataForTesting().max_texture_size().height()); 1812 EXPECT_EQ(100, tiling_->TilingDataForTesting().max_texture_size().height());
1793 EXPECT_EQ(4u, tiling_->AllTilesForTesting().size()); 1813 EXPECT_EQ(4u, tiling_->AllTilesForTesting().size());
1794 1814
1795 client_.SetTileSize(gfx::Size(250, 200)); 1815 client_.SetTileSize(gfx::Size(250, 200));
1796 1816
(...skipping 24 matching lines...) Expand all
1821 tiling_ = TestablePictureLayerTiling::Create(PENDING_TREE, contents_scale, 1841 tiling_ = TestablePictureLayerTiling::Create(PENDING_TREE, contents_scale,
1822 raster_source, &client_, 1842 raster_source, &client_,
1823 LayerTreeSettings()); 1843 LayerTreeSettings());
1824 1844
1825 gfx::Rect content_rect(25554432, 25554432, 950, 860); 1845 gfx::Rect content_rect(25554432, 25554432, 950, 860);
1826 VerifyTilesExactlyCoverRect(contents_scale, content_rect); 1846 VerifyTilesExactlyCoverRect(contents_scale, content_rect);
1827 } 1847 }
1828 1848
1829 } // namespace 1849 } // namespace
1830 } // namespace cc 1850 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiles/picture_layer_tiling.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698