OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1300 DCHECK(it != layers_with_copy_output_request_.end()); | 1300 DCHECK(it != layers_with_copy_output_request_.end()); |
1301 layers_with_copy_output_request_.erase(it); | 1301 layers_with_copy_output_request_.erase(it); |
1302 | 1302 |
1303 // TODO(danakj): Remove this once crash is found crbug.com/309777 | 1303 // TODO(danakj): Remove this once crash is found crbug.com/309777 |
1304 for (size_t i = 0; i < layers_with_copy_output_request_.size(); ++i) { | 1304 for (size_t i = 0; i < layers_with_copy_output_request_.size(); ++i) { |
1305 CHECK(layers_with_copy_output_request_[i] != layer) | 1305 CHECK(layers_with_copy_output_request_[i] != layer) |
1306 << i << " of " << layers_with_copy_output_request_.size(); | 1306 << i << " of " << layers_with_copy_output_request_.size(); |
1307 } | 1307 } |
1308 } | 1308 } |
1309 | 1309 |
| 1310 void LayerTreeImpl::AddSurfaceLayer(LayerImpl* layer) { |
| 1311 DCHECK(std::find(surface_layers_.begin(), surface_layers_.end(), layer) == |
| 1312 surface_layers_.end()); |
| 1313 surface_layers_.push_back(layer); |
| 1314 } |
| 1315 |
| 1316 void LayerTreeImpl::RemoveSurfaceLayer(LayerImpl* layer) { |
| 1317 std::vector<LayerImpl*>::iterator it = |
| 1318 std::find(surface_layers_.begin(), surface_layers_.end(), layer); |
| 1319 DCHECK(it != surface_layers_.end()); |
| 1320 surface_layers_.erase(it); |
| 1321 } |
| 1322 |
1310 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest() | 1323 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest() |
1311 const { | 1324 const { |
1312 // Only the active tree needs to know about layers with copy requests, as | 1325 // Only the active tree needs to know about layers with copy requests, as |
1313 // they are aborted if not serviced during draw. | 1326 // they are aborted if not serviced during draw. |
1314 DCHECK(IsActiveTree()); | 1327 DCHECK(IsActiveTree()); |
1315 | 1328 |
1316 return layers_with_copy_output_request_; | 1329 return layers_with_copy_output_request_; |
1317 } | 1330 } |
1318 | 1331 |
1319 template <typename LayerType> | 1332 template <typename LayerType> |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1920 const gfx::BoxF& box, | 1933 const gfx::BoxF& box, |
1921 gfx::BoxF* bounds) const { | 1934 gfx::BoxF* bounds) const { |
1922 *bounds = gfx::BoxF(); | 1935 *bounds = gfx::BoxF(); |
1923 return layer_tree_host_impl_->animation_host() | 1936 return layer_tree_host_impl_->animation_host() |
1924 ? layer_tree_host_impl_->animation_host() | 1937 ? layer_tree_host_impl_->animation_host() |
1925 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) | 1938 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) |
1926 : true; | 1939 : true; |
1927 } | 1940 } |
1928 | 1941 |
1929 } // namespace cc | 1942 } // namespace cc |
OLD | NEW |