| Index: third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
|
| diff --git a/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h b/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
|
| index 6048057f8bf45ca6b03a8d8d4e3967d9cb5f3968..4644645b391a293a7f9563849f71d2f52c89e5d5 100644
|
| --- a/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
|
| +++ b/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
|
| @@ -5,8 +5,10 @@
|
| #ifndef ObjectPaintProperties_h
|
| #define ObjectPaintProperties_h
|
|
|
| +#include "platform/geometry/LayoutPoint.h"
|
| #include "platform/graphics/paint/ClipPaintPropertyNode.h"
|
| #include "platform/graphics/paint/EffectPaintPropertyNode.h"
|
| +#include "platform/graphics/paint/PaintChunkProperties.h"
|
| #include "platform/graphics/paint/TransformPaintPropertyNode.h"
|
| #include "wtf/PassOwnPtr.h"
|
| #include "wtf/PassRefPtr.h"
|
| @@ -14,34 +16,34 @@
|
|
|
| namespace blink {
|
|
|
| -// The minimal set of paint properties created by a |LayoutObject|. These
|
| -// properties encode a hierachy of transforms, clips, effects, etc, both between
|
| -// LayoutObjects (each property has a parent) and among the properties of a
|
| -// single LayoutObject (e.g., transform and perspective with the correct parent
|
| -// relationship to represent ordering).
|
| -//
|
| -// This differs from |PaintChunkProperties| because it can store multiple
|
| -// properties of the same type (e.g., transform and perspective which are both
|
| -// transforms).
|
| +// This class stores property tree related information associated with a LayoutObject.
|
| +// Currently there are two groups of information:
|
| +// 1. The set of property nodes created locally by this LayoutObject.
|
| +// 2. [Optional] A suite of property nodes (PaintChunkProperties) and paint offset
|
| +// that can be used to paint the border box of this LayoutObject.
|
| class ObjectPaintProperties {
|
| WTF_MAKE_NONCOPYABLE(ObjectPaintProperties);
|
| USING_FAST_MALLOC(ObjectPaintProperties);
|
| public:
|
| + struct LocalBorderBoxProperties;
|
| +
|
| static PassOwnPtr<ObjectPaintProperties> create(
|
| PassRefPtr<TransformPaintPropertyNode> paintOffsetTranslation,
|
| PassRefPtr<TransformPaintPropertyNode> transform,
|
| PassRefPtr<EffectPaintPropertyNode> effect,
|
| PassRefPtr<ClipPaintPropertyNode> overflowClip,
|
| PassRefPtr<TransformPaintPropertyNode> perspective,
|
| - PassRefPtr<TransformPaintPropertyNode> scrollTranslation)
|
| + PassRefPtr<TransformPaintPropertyNode> scrollTranslation,
|
| + PassOwnPtr<LocalBorderBoxProperties> localBorderBoxProperties)
|
| {
|
| - return adoptPtr(new ObjectPaintProperties(paintOffsetTranslation, transform, effect, overflowClip, perspective, scrollTranslation));
|
| + return adoptPtr(new ObjectPaintProperties(paintOffsetTranslation, transform, effect, overflowClip, perspective, scrollTranslation, localBorderBoxProperties));
|
| }
|
|
|
| // The hierarchy of transform subtree created by a LayoutObject.
|
| // [ paintOffsetTranslation ] Normally paint offset is accumulated without creating a node
|
| // | until we see, for example, transform or position:fixed.
|
| // +---[ transform ] The space created by CSS transform.
|
| + // | This is the local border box space, see: LocalBorderBoxProperties below.
|
| // +---[ perspective ] The space created by CSS perspective.
|
| // +---[ scrollTranslation ] The space created by overflow clip.
|
| TransformPaintPropertyNode* paintOffsetTranslation() const { return m_paintOffsetTranslation.get(); }
|
| @@ -57,6 +59,19 @@ public:
|
|
|
| ClipPaintPropertyNode* overflowClip() const { return m_overflowClip.get(); }
|
|
|
| + // This is a complete set of property nodes that should be used as a starting point to paint
|
| + // this layout object. It is needed becauase some property inherits from the containing block,
|
| + // not painting parent, thus can't be derived in O(1) during paint walk.
|
| + // Note: If this layout object has transform or stacking-context effects, those are already
|
| + // baked into in the context here. However for properties that affects only children,
|
| + // for example, perspective and overflow clip, those should be applied by the painter
|
| + // at the right painting step.
|
| + struct LocalBorderBoxProperties {
|
| + LayoutPoint paintOffset;
|
| + PaintChunkProperties properties;
|
| + };
|
| + LocalBorderBoxProperties* localBorderBoxProperties() const { return m_localBorderBoxProperties.get(); }
|
| +
|
| private:
|
| ObjectPaintProperties(
|
| PassRefPtr<TransformPaintPropertyNode> paintOffsetTranslation,
|
| @@ -64,13 +79,15 @@ private:
|
| PassRefPtr<EffectPaintPropertyNode> effect,
|
| PassRefPtr<ClipPaintPropertyNode> overflowClip,
|
| PassRefPtr<TransformPaintPropertyNode> perspective,
|
| - PassRefPtr<TransformPaintPropertyNode> scrollTranslation)
|
| + PassRefPtr<TransformPaintPropertyNode> scrollTranslation,
|
| + PassOwnPtr<LocalBorderBoxProperties> localBorderBoxProperties)
|
| : m_paintOffsetTranslation(paintOffsetTranslation)
|
| , m_transform(transform)
|
| , m_effect(effect)
|
| , m_overflowClip(overflowClip)
|
| , m_perspective(perspective)
|
| - , m_scrollTranslation(scrollTranslation) { }
|
| + , m_scrollTranslation(scrollTranslation)
|
| + , m_localBorderBoxProperties(localBorderBoxProperties) { }
|
|
|
| RefPtr<TransformPaintPropertyNode> m_paintOffsetTranslation;
|
| RefPtr<TransformPaintPropertyNode> m_transform;
|
| @@ -78,6 +95,8 @@ private:
|
| RefPtr<ClipPaintPropertyNode> m_overflowClip;
|
| RefPtr<TransformPaintPropertyNode> m_perspective;
|
| RefPtr<TransformPaintPropertyNode> m_scrollTranslation;
|
| +
|
| + OwnPtr<LocalBorderBoxProperties> m_localBorderBoxProperties;
|
| };
|
|
|
| } // namespace blink
|
|
|