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

Side by Side Diff: cc/layers/picture_layer_impl_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 | « no previous file | cc/layers/render_surface_impl_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 "cc/layers/picture_layer_impl.h" 5 #include "cc/layers/picture_layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 EXPECT_EQ(active_layer()->num_tilings(), 2u); 1126 EXPECT_EQ(active_layer()->num_tilings(), 2u);
1127 EXPECT_EQ(pending_layer()->num_tilings(), 1u); 1127 EXPECT_EQ(pending_layer()->num_tilings(), 1u);
1128 1128
1129 // Mask layers dont create low res since they always fit on one tile. 1129 // Mask layers dont create low res since they always fit on one tile.
1130 std::unique_ptr<FakePictureLayerImpl> mask = 1130 std::unique_ptr<FakePictureLayerImpl> mask =
1131 FakePictureLayerImpl::CreateMaskWithRasterSource( 1131 FakePictureLayerImpl::CreateMaskWithRasterSource(
1132 host_impl()->pending_tree(), 3, pending_raster_source); 1132 host_impl()->pending_tree(), 3, pending_raster_source);
1133 mask->SetBounds(layer_bounds); 1133 mask->SetBounds(layer_bounds);
1134 mask->SetDrawsContent(true); 1134 mask->SetDrawsContent(true);
1135 pending_layer()->test_properties()->SetMaskLayer(std::move(mask)); 1135 pending_layer()->test_properties()->SetMaskLayer(std::move(mask));
1136 pending_layer()->SetHasRenderSurface(true); 1136 pending_layer()->test_properties()->force_render_surface = true;
1137 RebuildPropertyTreesOnPendingTree(); 1137 RebuildPropertyTreesOnPendingTree();
1138 host_impl()->pending_tree()->UpdateDrawProperties(false); 1138 host_impl()->pending_tree()->UpdateDrawProperties(false);
1139 1139
1140 FakePictureLayerImpl* mask_raw = static_cast<FakePictureLayerImpl*>( 1140 FakePictureLayerImpl* mask_raw = static_cast<FakePictureLayerImpl*>(
1141 pending_layer()->test_properties()->mask_layer); 1141 pending_layer()->test_properties()->mask_layer);
1142 // We did an UpdateDrawProperties above, which will set a contents scale on 1142 // We did an UpdateDrawProperties above, which will set a contents scale on
1143 // the mask layer, so allow us to reset the contents scale. 1143 // the mask layer, so allow us to reset the contents scale.
1144 mask_raw->ReleaseTileResources(); 1144 mask_raw->ReleaseTileResources();
1145 mask_raw->RecreateTileResources(); 1145 mask_raw->RecreateTileResources();
1146 1146
(...skipping 3776 matching lines...) Expand 10 before | Expand all | Expand 10 after
4923 EXPECT_FLOAT_EQ(expected_contents_scale, 4923 EXPECT_FLOAT_EQ(expected_contents_scale,
4924 pending_layer_ptr->picture_layer_tiling_set() 4924 pending_layer_ptr->picture_layer_tiling_set()
4925 ->FindTilingWithResolution(HIGH_RESOLUTION) 4925 ->FindTilingWithResolution(HIGH_RESOLUTION)
4926 ->contents_scale()) 4926 ->contents_scale())
4927 << "ideal_contents_scale: " << ideal_contents_scale; 4927 << "ideal_contents_scale: " << ideal_contents_scale;
4928 } 4928 }
4929 } 4929 }
4930 4930
4931 } // namespace 4931 } // namespace
4932 } // namespace cc 4932 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/render_surface_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698