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

Side by Side Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 1484163002: Raster display item lists via a visual rect RTree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head and flip for LayoutInline. Created 4 years, 6 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
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 void AssertNoTilesRequired(PictureLayerTiling* tiling) { 261 void AssertNoTilesRequired(PictureLayerTiling* tiling) {
262 std::vector<Tile*> tiles = tiling->AllTilesForTesting(); 262 std::vector<Tile*> tiles = tiling->AllTilesForTesting();
263 for (size_t i = 0; i < tiles.size(); ++i) 263 for (size_t i = 0; i < tiles.size(); ++i)
264 EXPECT_FALSE(tiles[i]->required_for_activation()) << "i: " << i; 264 EXPECT_FALSE(tiles[i]->required_for_activation()) << "i: " << i;
265 EXPECT_GT(tiles.size(), 0u); 265 EXPECT_GT(tiles.size(), 0u);
266 } 266 }
267 267
268 void SetInitialDeviceScaleFactor(float device_scale_factor) { 268 void SetInitialDeviceScaleFactor(float device_scale_factor) {
269 // Device scale factor is a per-tree property. However, tests can't directly 269 // Device scale factor is a per-tree property. However, tests can't directly
270 // set the pending tree's device scale factor before the pending tree is 270 // set the pending tree's device scale factor before the pending tree is
271 // created, and setting it after SetupPendingTreeis too late, since 271 // created, and setting it after SetupPendingTree is too late, since
272 // draw properties will already have been updated on the tree. To handle 272 // draw properties will already have been updated on the tree. To handle
273 // this, we initially set only the active tree's device scale factor, and we 273 // this, we initially set only the active tree's device scale factor, and we
274 // copy this over to the pending tree inside SetupPendingTree. 274 // copy this over to the pending tree inside SetupPendingTree.
275 host_impl()->active_tree()->SetDeviceScaleFactor(device_scale_factor); 275 host_impl()->active_tree()->SetDeviceScaleFactor(device_scale_factor);
276 } 276 }
277 277
278 void TestQuadsForSolidColor(bool test_for_solid); 278 void TestQuadsForSolidColor(bool test_for_solid);
279 }; 279 };
280 280
281 class NoLowResPictureLayerImplTest : public PictureLayerImplTest { 281 class NoLowResPictureLayerImplTest : public PictureLayerImplTest {
(...skipping 4480 matching lines...) Expand 10 before | Expand all | Expand 10 after
4762 // New low res tiling. 4762 // New low res tiling.
4763 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); 4763 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles());
4764 4764
4765 // This tiling will be high res now, it won't contain low res content since it 4765 // This tiling will be high res now, it won't contain low res content since it
4766 // was all destroyed. 4766 // was all destroyed.
4767 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); 4767 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles());
4768 } 4768 }
4769 4769
4770 } // namespace 4770 } // namespace
4771 } // namespace cc 4771 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698