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

Side by Side Diff: cc/trees/layer_tree_impl.cc

Issue 1491743006: List all child surfaces (including occluded) in CompositorFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
OLDNEW
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 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 DCHECK(it != layers_with_copy_output_request_.end()); 1298 DCHECK(it != layers_with_copy_output_request_.end());
1299 layers_with_copy_output_request_.erase(it); 1299 layers_with_copy_output_request_.erase(it);
1300 1300
1301 // TODO(danakj): Remove this once crash is found crbug.com/309777 1301 // TODO(danakj): Remove this once crash is found crbug.com/309777
1302 for (size_t i = 0; i < layers_with_copy_output_request_.size(); ++i) { 1302 for (size_t i = 0; i < layers_with_copy_output_request_.size(); ++i) {
1303 CHECK(layers_with_copy_output_request_[i] != layer) 1303 CHECK(layers_with_copy_output_request_[i] != layer)
1304 << i << " of " << layers_with_copy_output_request_.size(); 1304 << i << " of " << layers_with_copy_output_request_.size();
1305 } 1305 }
1306 } 1306 }
1307 1307
1308 void LayerTreeImpl::AddSurfaceLayer(LayerImpl* layer) {
1309 DCHECK(std::find(surface_layers_.begin(), surface_layers_.end(), layer) ==
1310 surface_layers_.end());
1311 surface_layers_.push_back(layer);
1312 }
1313
1314 void LayerTreeImpl::RemoveSurfaceLayer(LayerImpl* layer) {
1315 std::vector<LayerImpl*>::iterator it =
1316 std::find(surface_layers_.begin(), surface_layers_.end(), layer);
1317 DCHECK(it != surface_layers_.end());
1318 surface_layers_.erase(it);
1319 }
1320
1308 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest() 1321 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest()
1309 const { 1322 const {
1310 // Only the active tree needs to know about layers with copy requests, as 1323 // Only the active tree needs to know about layers with copy requests, as
1311 // they are aborted if not serviced during draw. 1324 // they are aborted if not serviced during draw.
1312 DCHECK(IsActiveTree()); 1325 DCHECK(IsActiveTree());
1313 1326
1314 return layers_with_copy_output_request_; 1327 return layers_with_copy_output_request_;
1315 } 1328 }
1316 1329
1317 template <typename LayerType> 1330 template <typename LayerType>
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
1910 const gfx::BoxF& box, 1923 const gfx::BoxF& box,
1911 gfx::BoxF* bounds) const { 1924 gfx::BoxF* bounds) const {
1912 *bounds = gfx::BoxF(); 1925 *bounds = gfx::BoxF();
1913 return layer_tree_host_impl_->animation_host() 1926 return layer_tree_host_impl_->animation_host()
1914 ? layer_tree_host_impl_->animation_host() 1927 ? layer_tree_host_impl_->animation_host()
1915 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) 1928 ->TransformAnimationBoundsForBox(layer->id(), box, bounds)
1916 : true; 1929 : true;
1917 } 1930 }
1918 1931
1919 } // namespace cc 1932 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698