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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 2035863003: cc: Add mask and replica layer ids to the effect tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_unittest_occlusion.cc ('k') | cc/trees/layer_tree_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index e39989515e1f56a5daf69755eee8a6368689320e..797eaf91676150ce28177d8cb7d3fb766ca8ca91 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -91,6 +91,7 @@ LayerTreeImpl::~LayerTreeImpl() {
// Need to explicitly clear the tree prior to destroying this so that
// the LayerTreeImpl pointer is still valid in the LayerImpl dtor.
DCHECK(!root_layer_);
+ DCHECK(layers_->empty());
}
void LayerTreeImpl::Shutdown() {
@@ -923,7 +924,7 @@ bool LayerTreeImpl::UpdateDrawProperties(bool update_lcd_text) {
// Masks are used to draw the contributing surface, so should have
// the same occlusion as the surface (nothing inside the surface
// occludes them).
- if (LayerImpl* mask = it->mask_layer()) {
+ if (LayerImpl* mask = it->render_surface()->MaskLayer()) {
Occlusion mask_occlusion =
inside_replica
? Occlusion()
@@ -932,9 +933,10 @@ bool LayerTreeImpl::UpdateDrawProperties(bool update_lcd_text) {
it->DrawTransform());
mask->draw_properties().occlusion_in_content_space = mask_occlusion;
}
- if (LayerImpl* replica = it->replica_layer()) {
- if (LayerImpl* mask = replica->mask_layer())
- mask->draw_properties().occlusion_in_content_space = Occlusion();
+ if (LayerImpl* replica_mask =
+ it->render_surface()->ReplicaMaskLayer()) {
+ replica_mask->draw_properties().occlusion_in_content_space =
+ Occlusion();
}
}
@@ -1034,7 +1036,7 @@ gfx::SizeF LayerTreeImpl::ScrollableSize() const {
LayerImpl* LayerTreeImpl::LayerById(int id) const {
LayerImplMap::const_iterator iter = layer_id_map_.find(id);
- return iter != layer_id_map_.end() ? iter->second : NULL;
+ return iter != layer_id_map_.end() ? iter->second : nullptr;
}
void LayerTreeImpl::AddLayerShouldPushProperties(LayerImpl* layer) {
@@ -2076,7 +2078,8 @@ void LayerTreeImpl::ScrollAnimationAbort(bool needs_completion) {
void LayerTreeImpl::ResetAllChangeTracking() {
layers_that_should_push_properties_.clear();
- for (auto* layer : *this)
+ // Iterate over all layers, including masks and replicas.
+ for (auto& layer : *layers_)
layer->ResetChangeTracking();
property_trees_.ResetAllChangeTracking();
}
« no previous file with comments | « cc/trees/layer_tree_host_unittest_occlusion.cc ('k') | cc/trees/layer_tree_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698