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

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

Issue 2051013002: cc : Push layer lists instead of layer tree at commit and activation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « cc/test/layer_tree_host_common_test.cc ('k') | cc/trees/damage_tracker_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 777
778 host_impl()->SetViewportSize(layer_bounds); 778 host_impl()->SetViewportSize(layer_bounds);
779 779
780 scoped_refptr<FakeRasterSource> pending_raster_source = 780 scoped_refptr<FakeRasterSource> pending_raster_source =
781 FakeRasterSource::CreateFilled(layer_bounds); 781 FakeRasterSource::CreateFilled(layer_bounds);
782 SetupPendingTree(pending_raster_source); 782 SetupPendingTree(pending_raster_source);
783 783
784 std::unique_ptr<FakePictureLayerImpl> pending_child = 784 std::unique_ptr<FakePictureLayerImpl> pending_child =
785 FakePictureLayerImpl::CreateWithRasterSource(host_impl()->pending_tree(), 785 FakePictureLayerImpl::CreateWithRasterSource(host_impl()->pending_tree(),
786 2, pending_raster_source); 786 2, pending_raster_source);
787 int child_id = pending_child->id();
787 pending_layer()->AddChild(std::move(pending_child)); 788 pending_layer()->AddChild(std::move(pending_child));
788 789
789 FakePictureLayerImpl* pending_child_layer = 790 FakePictureLayerImpl* pending_child_layer =
790 static_cast<FakePictureLayerImpl*>(pending_layer()->children()[0]); 791 static_cast<FakePictureLayerImpl*>(pending_layer()->children()[0]);
791 pending_child_layer->SetDrawsContent(true); 792 pending_child_layer->SetDrawsContent(true);
792 793
793 host_impl()->AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); 794 host_impl()->AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1));
794 bool update_lcd_text = false; 795 bool update_lcd_text = false;
795 host_impl()->pending_tree()->property_trees()->needs_rebuild = true; 796 host_impl()->pending_tree()->property_trees()->needs_rebuild = true;
796 host_impl()->pending_tree()->BuildLayerListAndPropertyTreesForTesting(); 797 host_impl()->pending_tree()->BuildLayerListAndPropertyTreesForTesting();
797 host_impl()->pending_tree()->UpdateDrawProperties(update_lcd_text); 798 host_impl()->pending_tree()->UpdateDrawProperties(update_lcd_text);
798 799
799 ActivateTree(); 800 ActivateTree();
800 SetupPendingTree(pending_raster_source); 801 SetupPendingTree(pending_raster_source);
801 802
802 FakePictureLayerImpl* active_child_layer = 803 FakePictureLayerImpl* active_child_layer = static_cast<FakePictureLayerImpl*>(
803 static_cast<FakePictureLayerImpl*>(active_layer()->children()[0]); 804 host_impl()->active_tree()->LayerById(child_id));
804 805
805 std::set<Tile*> all_tiles; 806 std::set<Tile*> all_tiles;
806 size_t tile_count = 0; 807 size_t tile_count = 0;
807 std::unique_ptr<RasterTilePriorityQueue> raster_queue( 808 std::unique_ptr<RasterTilePriorityQueue> raster_queue(
808 host_impl()->BuildRasterQueue(SAME_PRIORITY_FOR_BOTH_TREES, 809 host_impl()->BuildRasterQueue(SAME_PRIORITY_FOR_BOTH_TREES,
809 RasterTilePriorityQueue::Type::ALL)); 810 RasterTilePriorityQueue::Type::ALL));
810 while (!raster_queue->IsEmpty()) { 811 while (!raster_queue->IsEmpty()) {
811 ++tile_count; 812 ++tile_count;
812 EXPECT_TRUE(raster_queue->Top().tile()); 813 EXPECT_TRUE(raster_queue->Top().tile());
813 all_tiles.insert(raster_queue->Top().tile()); 814 all_tiles.insert(raster_queue->Top().tile());
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
1882 } 1883 }
1883 1884
1884 // Ensures that the tile manager does not attempt to reuse tiles when partial 1885 // Ensures that the tile manager does not attempt to reuse tiles when partial
1885 // raster is disabled. 1886 // raster is disabled.
1886 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { 1887 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) {
1887 RunPartialRasterCheck(TakeHostImpl(), false /* partial_raster_enabled */); 1888 RunPartialRasterCheck(TakeHostImpl(), false /* partial_raster_enabled */);
1888 } 1889 }
1889 1890
1890 } // namespace 1891 } // namespace
1891 } // namespace cc 1892 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_tree_host_common_test.cc ('k') | cc/trees/damage_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698