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

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

Issue 2659883003: cc: Remove direct calls to LayerImpl::SetHasRenderSurface from tests (Closed)
Patch Set: Created 3 years, 10 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_test_common.cc ('k') | cc/trees/layer_tree_host_common_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 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after
1786 scoped_refptr<FakeRasterSource> pending_raster_source = 1786 scoped_refptr<FakeRasterSource> pending_raster_source =
1787 FakeRasterSource::CreateFilled(kTileSize); 1787 FakeRasterSource::CreateFilled(kTileSize);
1788 host_impl()->CreatePendingTree(); 1788 host_impl()->CreatePendingTree();
1789 LayerTreeImpl* pending_tree = host_impl()->pending_tree(); 1789 LayerTreeImpl* pending_tree = host_impl()->pending_tree();
1790 1790
1791 // Steal from the recycled tree. 1791 // Steal from the recycled tree.
1792 std::unique_ptr<FakePictureLayerImpl> pending_layer = 1792 std::unique_ptr<FakePictureLayerImpl> pending_layer =
1793 FakePictureLayerImpl::CreateWithRasterSource(pending_tree, kLayerId, 1793 FakePictureLayerImpl::CreateWithRasterSource(pending_tree, kLayerId,
1794 pending_raster_source); 1794 pending_raster_source);
1795 pending_layer->SetDrawsContent(true); 1795 pending_layer->SetDrawsContent(true);
1796 pending_layer->SetHasRenderSurface(true);
1797 1796
1798 // The bounds() just mirror the raster source size. 1797 // The bounds() just mirror the raster source size.
1799 pending_layer->SetBounds(pending_layer->raster_source()->GetSize()); 1798 pending_layer->SetBounds(pending_layer->raster_source()->GetSize());
1800 pending_tree->SetRootLayerForTesting(std::move(pending_layer)); 1799 pending_tree->SetRootLayerForTesting(std::move(pending_layer));
1801 1800
1802 // Add tilings/tiles for the layer. 1801 // Add tilings/tiles for the layer.
1803 host_impl()->pending_tree()->BuildLayerListAndPropertyTreesForTesting(); 1802 host_impl()->pending_tree()->BuildLayerListAndPropertyTreesForTesting();
1804 host_impl()->pending_tree()->UpdateDrawProperties( 1803 host_impl()->pending_tree()->UpdateDrawProperties(
1805 false /* update_lcd_text */); 1804 false /* update_lcd_text */);
1806 1805
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1882 scoped_refptr<FakeRasterSource> pending_raster_source = 1881 scoped_refptr<FakeRasterSource> pending_raster_source =
1883 FakeRasterSource::CreateFilled(kTileSize); 1882 FakeRasterSource::CreateFilled(kTileSize);
1884 host_impl->CreatePendingTree(); 1883 host_impl->CreatePendingTree();
1885 LayerTreeImpl* pending_tree = host_impl->pending_tree(); 1884 LayerTreeImpl* pending_tree = host_impl->pending_tree();
1886 1885
1887 // Steal from the recycled tree. 1886 // Steal from the recycled tree.
1888 std::unique_ptr<FakePictureLayerImpl> pending_layer = 1887 std::unique_ptr<FakePictureLayerImpl> pending_layer =
1889 FakePictureLayerImpl::CreateWithRasterSource(pending_tree, kLayerId, 1888 FakePictureLayerImpl::CreateWithRasterSource(pending_tree, kLayerId,
1890 pending_raster_source); 1889 pending_raster_source);
1891 pending_layer->SetDrawsContent(true); 1890 pending_layer->SetDrawsContent(true);
1892 pending_layer->SetHasRenderSurface(true);
1893 1891
1894 // The bounds() just mirror the raster source size. 1892 // The bounds() just mirror the raster source size.
1895 pending_layer->SetBounds(pending_layer->raster_source()->GetSize()); 1893 pending_layer->SetBounds(pending_layer->raster_source()->GetSize());
1896 pending_tree->SetRootLayerForTesting(std::move(pending_layer)); 1894 pending_tree->SetRootLayerForTesting(std::move(pending_layer));
1897 1895
1898 // Add tilings/tiles for the layer. 1896 // Add tilings/tiles for the layer.
1899 host_impl->pending_tree()->BuildLayerListAndPropertyTreesForTesting(); 1897 host_impl->pending_tree()->BuildLayerListAndPropertyTreesForTesting();
1900 host_impl->pending_tree()->UpdateDrawProperties(false /* update_lcd_text */); 1898 host_impl->pending_tree()->UpdateDrawProperties(false /* update_lcd_text */);
1901 1899
1902 // Build the raster queue and invalidate the top tile. 1900 // Build the raster queue and invalidate the top tile.
(...skipping 19 matching lines...) Expand all
1922 } 1920 }
1923 1921
1924 // Ensures that the tile manager does not attempt to reuse tiles when partial 1922 // Ensures that the tile manager does not attempt to reuse tiles when partial
1925 // raster is disabled. 1923 // raster is disabled.
1926 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { 1924 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) {
1927 RunPartialRasterCheck(TakeHostImpl(), false /* partial_raster_enabled */); 1925 RunPartialRasterCheck(TakeHostImpl(), false /* partial_raster_enabled */);
1928 } 1926 }
1929 1927
1930 } // namespace 1928 } // namespace
1931 } // namespace cc 1929 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_test_common.cc ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698