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

Side by Side Diff: cc/resources/tile_manager_unittest.cc

Issue 465853004: Moving RenderSurface creation outside of CalcDrawProps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated unit tests Created 6 years, 4 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/resources/eviction_tile_priority_queue.h" 5 #include "cc/resources/eviction_tile_priority_queue.h"
6 #include "cc/resources/raster_tile_priority_queue.h" 6 #include "cc/resources/raster_tile_priority_queue.h"
7 #include "cc/resources/tile.h" 7 #include "cc/resources/tile.h"
8 #include "cc/resources/tile_priority.h" 8 #include "cc/resources/tile_priority.h"
9 #include "cc/test/fake_impl_proxy.h" 9 #include "cc/test/fake_impl_proxy.h"
10 #include "cc/test/fake_layer_tree_host_impl.h" 10 #include "cc/test/fake_layer_tree_host_impl.h"
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 553
554 void SetupPendingTree(scoped_refptr<PicturePileImpl> pile) { 554 void SetupPendingTree(scoped_refptr<PicturePileImpl> pile) {
555 host_impl_.CreatePendingTree(); 555 host_impl_.CreatePendingTree();
556 LayerTreeImpl* pending_tree = host_impl_.pending_tree(); 556 LayerTreeImpl* pending_tree = host_impl_.pending_tree();
557 // Clear recycled tree. 557 // Clear recycled tree.
558 pending_tree->DetachLayerTree(); 558 pending_tree->DetachLayerTree();
559 559
560 scoped_ptr<FakePictureLayerImpl> pending_layer = 560 scoped_ptr<FakePictureLayerImpl> pending_layer =
561 FakePictureLayerImpl::CreateWithPile(pending_tree, id_, pile); 561 FakePictureLayerImpl::CreateWithPile(pending_tree, id_, pile);
562 pending_layer->SetDrawsContent(true); 562 pending_layer->SetDrawsContent(true);
563 pending_layer->CreateRenderSurface();
563 pending_tree->SetRootLayer(pending_layer.PassAs<LayerImpl>()); 564 pending_tree->SetRootLayer(pending_layer.PassAs<LayerImpl>());
564 565
565 pending_layer_ = static_cast<FakePictureLayerImpl*>( 566 pending_layer_ = static_cast<FakePictureLayerImpl*>(
566 host_impl_.pending_tree()->LayerById(id_)); 567 host_impl_.pending_tree()->LayerById(id_));
567 pending_layer_->DoPostCommitInitializationIfNeeded(); 568 pending_layer_->DoPostCommitInitializationIfNeeded();
568 } 569 }
569 570
570 void CreateHighLowResAndSetAllTilesVisible() { 571 void CreateHighLowResAndSetAllTilesVisible() {
571 // Active layer must get updated first so pending layer can share from it. 572 // Active layer must get updated first so pending layer can share from it.
572 active_layer_->CreateDefaultTilingsAndTiles(); 573 active_layer_->CreateDefaultTilingsAndTiles();
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 all_tiles.insert(queue.Top()); 1210 all_tiles.insert(queue.Top());
1210 ++tile_count; 1211 ++tile_count;
1211 queue.Pop(); 1212 queue.Pop();
1212 } 1213 }
1213 EXPECT_EQ(tile_count, all_tiles.size()); 1214 EXPECT_EQ(tile_count, all_tiles.size());
1214 EXPECT_EQ(17u, tile_count); 1215 EXPECT_EQ(17u, tile_count);
1215 } 1216 }
1216 1217
1217 } // namespace 1218 } // namespace
1218 } // namespace cc 1219 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698