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

Unified Diff: cc/layers/render_surface_impl.cc

Issue 2360003002: cc: Compute SurfacePropertyChanged without depending on owning layer (Closed)
Patch Set: Address review comment Created 4 years, 3 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/layers/render_surface_impl.h ('k') | cc/layers/render_surface_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/render_surface_impl.cc
diff --git a/cc/layers/render_surface_impl.cc b/cc/layers/render_surface_impl.cc
index 97bc179a3472c5e6643d21c29777653ad010a312..dfd6de5fd588cd7a6bb5d6a6240af6a278522696 100644
--- a/cc/layers/render_surface_impl.cc
+++ b/cc/layers/render_surface_impl.cc
@@ -24,6 +24,7 @@
#include "cc/trees/effect_node.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/occlusion.h"
+#include "cc/trees/transform_node.h"
#include "third_party/skia/include/core/SkImageFilter.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/transform.h"
@@ -33,6 +34,7 @@ namespace cc {
RenderSurfaceImpl::RenderSurfaceImpl(LayerImpl* owning_layer)
: owning_layer_(owning_layer),
surface_property_changed_(false),
+ ancestor_property_changed_(false),
contributes_to_drawn_surface_(false),
nearest_occlusion_immune_ancestor_(nullptr),
target_render_surface_layer_index_history_(0),
@@ -333,15 +335,33 @@ bool RenderSurfaceImpl::SurfacePropertyChanged() const {
// change. As of now, these are the only two properties that can be affected
// by descendant layers.
//
- // - all other property changes come from the owning layer (or some ancestor
- // layer that propagates its change to the owning layer).
+ // - all other property changes come from the surface's property tree nodes
+ // (or some ancestor node that propagates its change to one of these nodes).
//
DCHECK(owning_layer_);
- return surface_property_changed_ || owning_layer_->LayerPropertyChanged();
+ return surface_property_changed_ || AncestorPropertyChanged();
}
bool RenderSurfaceImpl::SurfacePropertyChangedOnlyFromDescendant() const {
- return surface_property_changed_ && !owning_layer_->LayerPropertyChanged();
+ return surface_property_changed_ && !AncestorPropertyChanged();
+}
+
+bool RenderSurfaceImpl::AncestorPropertyChanged() const {
+ const PropertyTrees* property_trees =
+ owning_layer_->layer_tree_impl()->property_trees();
+ return ancestor_property_changed_ || property_trees->full_tree_damaged ||
+ property_trees->transform_tree.Node(TransformTreeIndex())
+ ->transform_changed ||
+ property_trees->effect_tree.Node(EffectTreeIndex())->effect_changed;
+}
+
+void RenderSurfaceImpl::NoteAncestorPropertyChanged() {
+ ancestor_property_changed_ = true;
+}
+
+void RenderSurfaceImpl::ResetPropertyChangedFlags() {
+ surface_property_changed_ = false;
+ ancestor_property_changed_ = false;
}
void RenderSurfaceImpl::ClearLayerLists() {
« no previous file with comments | « cc/layers/render_surface_impl.h ('k') | cc/layers/render_surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698