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

Unified Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h

Issue 2144733008: [SPv2] Move PaintPropertyTreeBuilder state for containing blocks into a struct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: all members are initialized here anyhow Created 4 years, 5 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 | third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h
index 118763fc8dd13dd5435b6930927c4b941c62e3c0..16f07086d7c79ffe1a76b6eefae797928862a7c9 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h
@@ -20,27 +20,23 @@ class LayoutObject;
// It's responsible for bookkeeping tree state in other order, for example, the most recent
// position container seen.
struct PaintPropertyTreeBuilderContext {
- PaintPropertyTreeBuilderContext()
- : currentTransform(nullptr)
- , currentClip(nullptr)
- , transformForAbsolutePosition(nullptr)
- , containerForAbsolutePosition(nullptr)
- , clipForAbsolutePosition(nullptr)
- , transformForFixedPosition(nullptr)
- , clipForFixedPosition(nullptr)
- , currentEffect(nullptr) { }
+ // State that propagates on the containing block chain (and so is adjusted
+ // when an absolute or fixed position object is encountered).
+ struct ContainingBlockContext {
+ // The combination of a transform and paint offset describes a linear space.
+ // When a layout object recur to its children, the main context is expected to refer
+ // the object's border box, then the callee will derive its own border box by translating
+ // the space with its own layout location.
+ TransformPaintPropertyNode* transform = nullptr;
+ LayoutPoint paintOffset;
+ // The clip node describes the accumulated raster clip for the current subtree.
+ // Note that the computed raster region in canvas space for a clip node is independent from
+ // the transform and paint offset above. Also the actual raster region may be affected
+ // by layerization and occlusion tracking.
+ ClipPaintPropertyNode* clip = nullptr;
+ };
- // The combination of a transform and paint offset describes a linear space.
- // When a layout object recur to its children, the main context is expected to refer
- // the object's border box, then the callee will derive its own border box by translating
- // the space with its own layout location.
- TransformPaintPropertyNode* currentTransform;
- LayoutPoint paintOffset;
- // The clip node describes the accumulated raster clip for the current subtree.
- // Note that the computed raster region in canvas space for a clip node is independent from
- // the transform and paint offset above. Also the actual raster region may be affected
- // by layerization and occlusion tracking.
- ClipPaintPropertyNode* currentClip;
+ ContainingBlockContext current;
// Separate context for out-of-flow positioned and fixed positioned elements are needed
// because they don't use DOM parent as their containing block.
@@ -49,19 +45,15 @@ struct PaintPropertyTreeBuilderContext {
// positioned descendants.
// Overflow clips are also inherited by containing block tree instead of DOM tree, thus they
// are included in the additional context too.
- TransformPaintPropertyNode* transformForAbsolutePosition;
- LayoutPoint paintOffsetForAbsolutePosition;
- const LayoutObject* containerForAbsolutePosition;
- ClipPaintPropertyNode* clipForAbsolutePosition;
+ ContainingBlockContext absolutePosition;
+ const LayoutObject* containerForAbsolutePosition = nullptr;
- TransformPaintPropertyNode* transformForFixedPosition;
- LayoutPoint paintOffsetForFixedPosition;
- ClipPaintPropertyNode* clipForFixedPosition;
+ ContainingBlockContext fixedPosition;
// The effect hierarchy is applied by the stacking context tree. It is guaranteed that every
// DOM descendant is also a stacking context descendant. Therefore, we don't need extra
// bookkeeping for effect nodes and can generate the effect tree from a DOM-order traversal.
- EffectPaintPropertyNode* currentEffect;
+ EffectPaintPropertyNode* currentEffect = nullptr;
};
// Creates paint property tree nodes for special things in the layout tree.
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698