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 <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 1742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1753 | 1753 |
1754 // Steal from the recycled tree. | 1754 // Steal from the recycled tree. |
1755 std::unique_ptr<FakePictureLayerImpl> pending_layer = | 1755 std::unique_ptr<FakePictureLayerImpl> pending_layer = |
1756 FakePictureLayerImpl::CreateWithRasterSource(pending_tree, kLayerId, | 1756 FakePictureLayerImpl::CreateWithRasterSource(pending_tree, kLayerId, |
1757 pending_raster_source); | 1757 pending_raster_source); |
1758 pending_layer->SetDrawsContent(true); | 1758 pending_layer->SetDrawsContent(true); |
1759 pending_layer->SetHasRenderSurface(true); | 1759 pending_layer->SetHasRenderSurface(true); |
1760 | 1760 |
1761 // The bounds() just mirror the raster source size. | 1761 // The bounds() just mirror the raster source size. |
1762 pending_layer->SetBounds(pending_layer->raster_source()->GetSize()); | 1762 pending_layer->SetBounds(pending_layer->raster_source()->GetSize()); |
1763 pending_tree->SetRootLayer(std::move(pending_layer)); | 1763 pending_tree->SetRootLayerForTesting(std::move(pending_layer)); |
1764 | 1764 |
1765 // Add tilings/tiles for the layer. | 1765 // Add tilings/tiles for the layer. |
1766 host_impl()->pending_tree()->BuildLayerListAndPropertyTreesForTesting(); | 1766 host_impl()->pending_tree()->BuildLayerListAndPropertyTreesForTesting(); |
1767 host_impl()->pending_tree()->UpdateDrawProperties( | 1767 host_impl()->pending_tree()->UpdateDrawProperties( |
1768 false /* update_lcd_text */); | 1768 false /* update_lcd_text */); |
1769 | 1769 |
1770 // Build the raster queue and invalidate the top tile. | 1770 // Build the raster queue and invalidate the top tile. |
1771 std::unique_ptr<RasterTilePriorityQueue> queue(host_impl()->BuildRasterQueue( | 1771 std::unique_ptr<RasterTilePriorityQueue> queue(host_impl()->BuildRasterQueue( |
1772 SAME_PRIORITY_FOR_BOTH_TREES, RasterTilePriorityQueue::Type::ALL)); | 1772 SAME_PRIORITY_FOR_BOTH_TREES, RasterTilePriorityQueue::Type::ALL)); |
1773 EXPECT_FALSE(queue->IsEmpty()); | 1773 EXPECT_FALSE(queue->IsEmpty()); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1850 | 1850 |
1851 // Steal from the recycled tree. | 1851 // Steal from the recycled tree. |
1852 std::unique_ptr<FakePictureLayerImpl> pending_layer = | 1852 std::unique_ptr<FakePictureLayerImpl> pending_layer = |
1853 FakePictureLayerImpl::CreateWithRasterSource(pending_tree, kLayerId, | 1853 FakePictureLayerImpl::CreateWithRasterSource(pending_tree, kLayerId, |
1854 pending_raster_source); | 1854 pending_raster_source); |
1855 pending_layer->SetDrawsContent(true); | 1855 pending_layer->SetDrawsContent(true); |
1856 pending_layer->SetHasRenderSurface(true); | 1856 pending_layer->SetHasRenderSurface(true); |
1857 | 1857 |
1858 // The bounds() just mirror the raster source size. | 1858 // The bounds() just mirror the raster source size. |
1859 pending_layer->SetBounds(pending_layer->raster_source()->GetSize()); | 1859 pending_layer->SetBounds(pending_layer->raster_source()->GetSize()); |
1860 pending_tree->SetRootLayer(std::move(pending_layer)); | 1860 pending_tree->SetRootLayerForTesting(std::move(pending_layer)); |
1861 | 1861 |
1862 // Add tilings/tiles for the layer. | 1862 // Add tilings/tiles for the layer. |
1863 host_impl->pending_tree()->BuildLayerListAndPropertyTreesForTesting(); | 1863 host_impl->pending_tree()->BuildLayerListAndPropertyTreesForTesting(); |
1864 host_impl->pending_tree()->UpdateDrawProperties(false /* update_lcd_text */); | 1864 host_impl->pending_tree()->UpdateDrawProperties(false /* update_lcd_text */); |
1865 | 1865 |
1866 // Build the raster queue and invalidate the top tile. | 1866 // Build the raster queue and invalidate the top tile. |
1867 std::unique_ptr<RasterTilePriorityQueue> queue(host_impl->BuildRasterQueue( | 1867 std::unique_ptr<RasterTilePriorityQueue> queue(host_impl->BuildRasterQueue( |
1868 SAME_PRIORITY_FOR_BOTH_TREES, RasterTilePriorityQueue::Type::ALL)); | 1868 SAME_PRIORITY_FOR_BOTH_TREES, RasterTilePriorityQueue::Type::ALL)); |
1869 EXPECT_FALSE(queue->IsEmpty()); | 1869 EXPECT_FALSE(queue->IsEmpty()); |
1870 queue->Top().tile()->SetInvalidated(gfx::Rect(), kInvalidatedId); | 1870 queue->Top().tile()->SetInvalidated(gfx::Rect(), kInvalidatedId); |
(...skipping 15 matching lines...) Expand all Loading... |
1886 } | 1886 } |
1887 | 1887 |
1888 // Ensures that the tile manager does not attempt to reuse tiles when partial | 1888 // Ensures that the tile manager does not attempt to reuse tiles when partial |
1889 // raster is disabled. | 1889 // raster is disabled. |
1890 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { | 1890 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { |
1891 RunPartialRasterCheck(TakeHostImpl(), false /* partial_raster_enabled */); | 1891 RunPartialRasterCheck(TakeHostImpl(), false /* partial_raster_enabled */); |
1892 } | 1892 } |
1893 | 1893 |
1894 } // namespace | 1894 } // namespace |
1895 } // namespace cc | 1895 } // namespace cc |
OLD | NEW |