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

Unified Diff: cc/trees/element_id.h

Issue 2826703003: Update element_id class comment to reflect how element id works (Closed)
Patch Set: Address reviewer comments and incorporate discussion with Enne 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..8518cf8ce13393c93c8d01faf224f27620d5269c 100644
--- a/cc/trees/element_id.h
+++ b/cc/trees/element_id.h
@@ -24,16 +24,25 @@ 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 scroll nodes keeping a
+// scrolling element id instead of a scrolling layer id allows for more general
+// compositing where, for example, multiple layers scroll with one 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. A Layer's element id can change over
+// the Layer's lifetime because non-default ElementIds are only set during an
+// animation's lifetime.
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