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 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1312 DCHECK(it != layers_with_copy_output_request_.end()); | 1312 DCHECK(it != layers_with_copy_output_request_.end()); |
1313 layers_with_copy_output_request_.erase(it); | 1313 layers_with_copy_output_request_.erase(it); |
1314 | 1314 |
1315 // TODO(danakj): Remove this once crash is found crbug.com/309777 | 1315 // TODO(danakj): Remove this once crash is found crbug.com/309777 |
1316 for (size_t i = 0; i < layers_with_copy_output_request_.size(); ++i) { | 1316 for (size_t i = 0; i < layers_with_copy_output_request_.size(); ++i) { |
1317 CHECK(layers_with_copy_output_request_[i] != layer) | 1317 CHECK(layers_with_copy_output_request_[i] != layer) |
1318 << i << " of " << layers_with_copy_output_request_.size(); | 1318 << i << " of " << layers_with_copy_output_request_.size(); |
1319 } | 1319 } |
1320 } | 1320 } |
1321 | 1321 |
1322 void LayerTreeImpl::AddSurfaceLayer(LayerImpl* layer) { | |
1323 DCHECK(std::find(surface_layers_.begin(), surface_layers_.end(), layer) == | |
1324 surface_layers_.end()); | |
1325 surface_layers_.push_back(layer); | |
1326 } | |
1327 | |
1328 void LayerTreeImpl::RemoveSurfaceLayer(LayerImpl* layer) { | |
1329 std::vector<LayerImpl*>::iterator it = | |
1330 std::find(surface_layers_.begin(), surface_layers_.end(), layer); | |
1331 DCHECK(it != surface_layers_.end()); | |
1332 surface_layers_.erase(it); | |
1333 } | |
1334 | |
1335 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest() | 1322 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest() |
1336 const { | 1323 const { |
1337 // Only the active tree needs to know about layers with copy requests, as | 1324 // Only the active tree needs to know about layers with copy requests, as |
1338 // they are aborted if not serviced during draw. | 1325 // they are aborted if not serviced during draw. |
1339 DCHECK(IsActiveTree()); | 1326 DCHECK(IsActiveTree()); |
1340 | 1327 |
1341 return layers_with_copy_output_request_; | 1328 return layers_with_copy_output_request_; |
1342 } | 1329 } |
1343 | 1330 |
1344 template <typename LayerType> | 1331 template <typename LayerType> |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1944 const gfx::BoxF& box, | 1931 const gfx::BoxF& box, |
1945 gfx::BoxF* bounds) const { | 1932 gfx::BoxF* bounds) const { |
1946 *bounds = gfx::BoxF(); | 1933 *bounds = gfx::BoxF(); |
1947 return layer_tree_host_impl_->animation_host() | 1934 return layer_tree_host_impl_->animation_host() |
1948 ? layer_tree_host_impl_->animation_host() | 1935 ? layer_tree_host_impl_->animation_host() |
1949 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) | 1936 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) |
1950 : true; | 1937 : true; |
1951 } | 1938 } |
1952 | 1939 |
1953 } // namespace cc | 1940 } // namespace cc |
OLD | NEW |