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 "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 2115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2126 FakeRasterSource::CreateFilled(layer_bounds); | 2126 FakeRasterSource::CreateFilled(layer_bounds); |
2127 | 2127 |
2128 host_impl()->CreatePendingTree(); | 2128 host_impl()->CreatePendingTree(); |
2129 LayerTreeImpl* pending_tree = host_impl()->pending_tree(); | 2129 LayerTreeImpl* pending_tree = host_impl()->pending_tree(); |
2130 | 2130 |
2131 std::unique_ptr<FakePictureLayerImpl> pending_layer = | 2131 std::unique_ptr<FakePictureLayerImpl> pending_layer = |
2132 FakePictureLayerImpl::CreateWithRasterSource(pending_tree, layer_id(), | 2132 FakePictureLayerImpl::CreateWithRasterSource(pending_tree, layer_id(), |
2133 pending_raster_source); | 2133 pending_raster_source); |
2134 pending_layer->SetDrawsContent(true); | 2134 pending_layer->SetDrawsContent(true); |
2135 pending_tree->SetRootLayerForTesting(std::move(pending_layer)); | 2135 pending_tree->SetRootLayerForTesting(std::move(pending_layer)); |
2136 pending_tree->BuildLayerListForTesting(); | 2136 pending_tree->BuildLayerListAndPropertyTreesForTesting(); |
2137 | 2137 |
2138 FakePictureLayerImpl* raw_pending_layer = static_cast<FakePictureLayerImpl*>( | 2138 FakePictureLayerImpl* raw_pending_layer = static_cast<FakePictureLayerImpl*>( |
2139 host_impl()->pending_tree()->LayerById(layer_id())); | 2139 host_impl()->pending_tree()->LayerById(layer_id())); |
2140 | 2140 |
2141 // Set some state on the pending layer, make sure it is not clobbered | 2141 // Set some state on the pending layer, make sure it is not clobbered |
2142 // by a sync from the active layer. This could happen because if the | 2142 // by a sync from the active layer. This could happen because if the |
2143 // pending layer has not been post-commit initialized it will attempt | 2143 // pending layer has not been post-commit initialized it will attempt |
2144 // to sync from the active layer. | 2144 // to sync from the active layer. |
2145 float raster_page_scale = 10.f * raw_pending_layer->raster_page_scale(); | 2145 float raster_page_scale = 10.f * raw_pending_layer->raster_page_scale(); |
2146 raw_pending_layer->set_raster_page_scale(raster_page_scale); | 2146 raw_pending_layer->set_raster_page_scale(raster_page_scale); |
(...skipping 2848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4995 EXPECT_FLOAT_EQ(expected_contents_scale, | 4995 EXPECT_FLOAT_EQ(expected_contents_scale, |
4996 pending_layer_ptr->picture_layer_tiling_set() | 4996 pending_layer_ptr->picture_layer_tiling_set() |
4997 ->FindTilingWithResolution(HIGH_RESOLUTION) | 4997 ->FindTilingWithResolution(HIGH_RESOLUTION) |
4998 ->contents_scale_key()) | 4998 ->contents_scale_key()) |
4999 << "ideal_contents_scale: " << ideal_contents_scale; | 4999 << "ideal_contents_scale: " << ideal_contents_scale; |
5000 } | 5000 } |
5001 } | 5001 } |
5002 | 5002 |
5003 } // namespace | 5003 } // namespace |
5004 } // namespace cc | 5004 } // namespace cc |
OLD | NEW |