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 16f07086d7c79ffe1a76b6eefae797928862a7c9..a1d60a1e2f09a74a8cf6b9e4d306470424921efe 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h |
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h |
@@ -15,6 +15,7 @@ namespace blink { |
class FrameView; |
class LayoutObject; |
+class ObjectPaintProperties; |
// The context for PaintPropertyTreeBuilder. |
// It's responsible for bookkeeping tree state in other order, for example, the most recent |
@@ -67,16 +68,48 @@ public: |
void buildTreeNodes(const LayoutObject&, PaintPropertyTreeBuilderContext&); |
private: |
+ // Common logic to update a paint property. It tries to reuse the existing paint property node of |
+ // the object if the value is not changed. Returns the existing or newly created paint property node, |
+ // or nullptr if no paint property node is needed. |
+ // It requires a ComputeProperty function which computes the paint property node value if needed and |
+ // returns true, or returns false if no paint property node value is needed. |
+ template < |
+ typename PropertyNode, |
+ PropertyNode* (ObjectPaintProperties::*Getter)() const, |
+ void (ObjectPaintProperties::*Setter)(PassRefPtr<PropertyNode>), |
+ bool (*ComputeProperty)(const LayoutObject&, PaintPropertyTreeBuilderContext&, typename PropertyNode::Value&)> |
+ static PropertyNode* updateObjectPaintProperty(const LayoutObject&, PaintPropertyTreeBuilderContext&, PropertyNode*& contextProperty); |
+ |
+ static bool computePaintOffsetTranslation(const LayoutObject&, PaintPropertyTreeBuilderContext&, TransformPaintPropertyNode::Value&); |
static void updatePaintOffsetTranslation(const LayoutObject&, PaintPropertyTreeBuilderContext&); |
+ |
+ static bool computeTransform(const LayoutObject&, PaintPropertyTreeBuilderContext&, TransformPaintPropertyNode::Value&); |
static void updateTransform(const LayoutObject&, PaintPropertyTreeBuilderContext&); |
+ |
+ static bool computeEffect(const LayoutObject&, PaintPropertyTreeBuilderContext&, EffectPaintPropertyNode::Value&); |
static void updateEffect(const LayoutObject&, PaintPropertyTreeBuilderContext&); |
+ |
+ static bool computeCssClip(const LayoutObject&, PaintPropertyTreeBuilderContext&, ClipPaintPropertyNode::Value&); |
static void updateCssClip(const LayoutObject&, PaintPropertyTreeBuilderContext&); |
+ |
static void updateLocalBorderBoxContext(const LayoutObject&, const PaintPropertyTreeBuilderContext&); |
+ |
+ static bool computeScrollbarPaintOffset(const LayoutObject&, const PaintPropertyTreeBuilderContext&, TransformPaintPropertyNode::Value&); |
static void updateScrollbarPaintOffset(const LayoutObject&, const PaintPropertyTreeBuilderContext&); |
+ |
+ static bool computeOverflowClip(const LayoutObject&, PaintPropertyTreeBuilderContext&, ClipPaintPropertyNode::Value&); |
static void updateOverflowClip(const LayoutObject&, PaintPropertyTreeBuilderContext&); |
+ |
+ static bool computePerspective(const LayoutObject&, PaintPropertyTreeBuilderContext&, TransformPaintPropertyNode::Value&); |
static void updatePerspective(const LayoutObject&, PaintPropertyTreeBuilderContext&); |
+ |
+ static bool computeSvgLocalToBorderBoxTransform(const LayoutObject&, PaintPropertyTreeBuilderContext&, TransformPaintPropertyNode::Value&); |
static void updateSvgLocalToBorderBoxTransform(const LayoutObject&, PaintPropertyTreeBuilderContext&); |
+ |
+ static bool computeScrollTranslation(const LayoutObject&, PaintPropertyTreeBuilderContext&, TransformPaintPropertyNode::Value&); |
static void updateScrollTranslation(const LayoutObject&, PaintPropertyTreeBuilderContext&); |
+ |
+ static bool computeOutOfFlowContext(const LayoutObject&, PaintPropertyTreeBuilderContext&, ClipPaintPropertyNode::Value&); |
static void updateOutOfFlowContext(const LayoutObject&, PaintPropertyTreeBuilderContext&); |
}; |