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

Unified Diff: cc/trees/element_id.h

Issue 2826703003: Update element_id class comment to reflect how element id works (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/element_id.h
diff --git a/cc/trees/element_id.h b/cc/trees/element_id.h
index 74de4c9995f9ea84733dcd2cf2520e3c17695c10..75d3601f690a3e744bfe6159870774ee5191cdac 100644
--- a/cc/trees/element_id.h
+++ b/cc/trees/element_id.h
@@ -24,16 +24,23 @@ class TracedValue;
namespace cc {
-// An "element" is really an animation target. It retains the name element to be
-// symmetric with ElementAnimations and blink::ElementAnimations, but is not
-// in fact tied to the notion of a blink element. It is also not associated with
-// the notion of a Layer. Ultimately, these ids will be used to look up the
-// property tree node associated with the given animation.
+// Element ids are chosen by cc's clients and can be used as a stable identifier
+// across updates.
//
-// These ids are chosen by cc's clients to permit the destruction and
-// restoration of cc entities (when visuals are hidden and shown) but maintain
-// stable identifiers. There will be a single layer for an ElementId, but
-// not every layer will have an id.
+// Historically, the layer tree stored all compositing data but this has been
+// refactored over time into auxilliary structures such as property trees.
+//
+// In composited scrolling, Layers directly reference scroll tree nodes
+// (Layer::scroll_tree_index) but scroll tree nodes are being refactored to
+// reference stable element ids instead of layers. Scroll property nodes have
+// unique element ids that blink creates from scrollable areas (though this is
+// opaque to the compositor). This refactoring of tracking the scrolling element
+// id instead of the scrolling layer id allows for more general compositing
+// where, for example, multiple layers scroll with a single scroll node.
+//
+// The animation system (see: ElementAnimations and blink::ElementAnimations) is
+// another auxilliary structure to the layer tree and uses element ids as a
+// stable identifier for animation targets.
ajuma 2017/04/18 18:53:57 It's worth also mentioning that we currently set E
struct CC_EXPORT ElementId {
ElementId(int primaryId, int secondaryId)
: primaryId(primaryId), secondaryId(secondaryId) {}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698