OLD | NEW |
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 "base/run_loop.h" | 5 #include "base/run_loop.h" |
6 #include "base/thread_task_runner_handle.h" | 6 #include "base/thread_task_runner_handle.h" |
7 #include "cc/playback/display_list_raster_source.h" | 7 #include "cc/playback/display_list_raster_source.h" |
8 #include "cc/playback/display_list_recording_source.h" | 8 #include "cc/playback/display_list_recording_source.h" |
9 #include "cc/raster/raster_buffer.h" | 9 #include "cc/raster/raster_buffer.h" |
10 #include "cc/resources/resource_pool.h" | 10 #include "cc/resources/resource_pool.h" |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 scoped_refptr<FakeDisplayListRasterSource> pending_raster_source = | 831 scoped_refptr<FakeDisplayListRasterSource> pending_raster_source = |
832 FakeDisplayListRasterSource::CreateFilled(layer_bounds); | 832 FakeDisplayListRasterSource::CreateFilled(layer_bounds); |
833 SetupPendingTree(pending_raster_source); | 833 SetupPendingTree(pending_raster_source); |
834 | 834 |
835 scoped_ptr<FakePictureLayerImpl> pending_child = | 835 scoped_ptr<FakePictureLayerImpl> pending_child = |
836 FakePictureLayerImpl::CreateWithRasterSource(host_impl_.pending_tree(), 2, | 836 FakePictureLayerImpl::CreateWithRasterSource(host_impl_.pending_tree(), 2, |
837 pending_raster_source); | 837 pending_raster_source); |
838 pending_layer_->AddChild(pending_child.Pass()); | 838 pending_layer_->AddChild(pending_child.Pass()); |
839 | 839 |
840 FakePictureLayerImpl* pending_child_layer = | 840 FakePictureLayerImpl* pending_child_layer = |
841 static_cast<FakePictureLayerImpl*>(pending_layer_->children()[0]); | 841 static_cast<FakePictureLayerImpl*>(pending_layer_->children()[0].get()); |
842 pending_child_layer->SetDrawsContent(true); | 842 pending_child_layer->SetDrawsContent(true); |
843 | 843 |
844 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); | 844 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); |
845 bool update_lcd_text = false; | 845 bool update_lcd_text = false; |
846 host_impl_.pending_tree()->property_trees()->needs_rebuild = true; | 846 host_impl_.pending_tree()->property_trees()->needs_rebuild = true; |
847 host_impl_.pending_tree()->BuildPropertyTreesForTesting(); | 847 host_impl_.pending_tree()->BuildPropertyTreesForTesting(); |
848 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); | 848 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); |
849 | 849 |
850 ActivateTree(); | 850 ActivateTree(); |
851 SetupPendingTree(pending_raster_source); | 851 SetupPendingTree(pending_raster_source); |
852 | 852 |
853 FakePictureLayerImpl* active_child_layer = | 853 FakePictureLayerImpl* active_child_layer = |
854 static_cast<FakePictureLayerImpl*>(active_layer_->children()[0]); | 854 static_cast<FakePictureLayerImpl*>(active_layer_->children()[0].get()); |
855 | 855 |
856 std::set<Tile*> all_tiles; | 856 std::set<Tile*> all_tiles; |
857 size_t tile_count = 0; | 857 size_t tile_count = 0; |
858 scoped_ptr<RasterTilePriorityQueue> raster_queue(host_impl_.BuildRasterQueue( | 858 scoped_ptr<RasterTilePriorityQueue> raster_queue(host_impl_.BuildRasterQueue( |
859 SAME_PRIORITY_FOR_BOTH_TREES, RasterTilePriorityQueue::Type::ALL)); | 859 SAME_PRIORITY_FOR_BOTH_TREES, RasterTilePriorityQueue::Type::ALL)); |
860 while (!raster_queue->IsEmpty()) { | 860 while (!raster_queue->IsEmpty()) { |
861 ++tile_count; | 861 ++tile_count; |
862 EXPECT_TRUE(raster_queue->Top().tile()); | 862 EXPECT_TRUE(raster_queue->Top().tile()); |
863 all_tiles.insert(raster_queue->Top().tile()); | 863 all_tiles.insert(raster_queue->Top().tile()); |
864 raster_queue->Pop(); | 864 raster_queue->Pop(); |
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1875 } | 1875 } |
1876 | 1876 |
1877 // Ensures that the tile manager does not attempt to reuse tiles when partial | 1877 // Ensures that the tile manager does not attempt to reuse tiles when partial |
1878 // raster is disabled. | 1878 // raster is disabled. |
1879 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { | 1879 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { |
1880 RunPartialRasterCheck(host_impl_.Pass(), false /* partial_raster_enabled */); | 1880 RunPartialRasterCheck(host_impl_.Pass(), false /* partial_raster_enabled */); |
1881 } | 1881 } |
1882 | 1882 |
1883 } // namespace | 1883 } // namespace |
1884 } // namespace cc | 1884 } // namespace cc |
OLD | NEW |