| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ObjectPaintProperties_h | 5 #ifndef ObjectPaintProperties_h |
| 6 #define ObjectPaintProperties_h | 6 #define ObjectPaintProperties_h |
| 7 | 7 |
| 8 #include "platform/geometry/LayoutPoint.h" | 8 #include "platform/geometry/LayoutPoint.h" |
| 9 #include "platform/graphics/paint/ClipPaintPropertyNode.h" | 9 #include "platform/graphics/paint/ClipPaintPropertyNode.h" |
| 10 #include "platform/graphics/paint/EffectPaintPropertyNode.h" | 10 #include "platform/graphics/paint/EffectPaintPropertyNode.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 { | 31 { |
| 32 return adoptPtr(new ObjectPaintProperties()); | 32 return adoptPtr(new ObjectPaintProperties()); |
| 33 } | 33 } |
| 34 | 34 |
| 35 // The hierarchy of transform subtree created by a LayoutObject. | 35 // The hierarchy of transform subtree created by a LayoutObject. |
| 36 // [ paintOffsetTranslation ] Normally paint offset is accumulated
without creating a node | 36 // [ paintOffsetTranslation ] Normally paint offset is accumulated
without creating a node |
| 37 // | until we see, for example, transform
or position:fixed. | 37 // | until we see, for example, transform
or position:fixed. |
| 38 // +---[ transform ] The space created by CSS transform. | 38 // +---[ transform ] The space created by CSS transform. |
| 39 // | This is the local border box space,
see: LocalBorderBoxProperties below. | 39 // | This is the local border box space,
see: LocalBorderBoxProperties below. |
| 40 // +---[ perspective ] The space created by CSS perspective
. | 40 // +---[ perspective ] The space created by CSS perspective
. |
| 41 // | +---[ svgLocalTransform ] The transform for an SVG element. | 41 // | +---[ svgLocalToBorderBoxTransform ] Additional transform for chi
ldren of the outermost root SVG. |
| 42 // | OR (SVG does not support scrolling.) | 42 // | OR (SVG does not support scrolling.) |
| 43 // | +---[ scrollTranslation ] The space created by overflow clip. | 43 // | +---[ scrollTranslation ] The space created by overflow clip. |
| 44 // +---[ scrollbarPaintOffset ] TODO(trchen): Remove this once we ba
ke the paint offset into frameRect. | 44 // +---[ scrollbarPaintOffset ] TODO(trchen): Remove this once we ba
ke the paint offset into frameRect. |
| 45 // This is equivalent to the local bord
er box space above, | 45 // This is equivalent to the local bord
er box space above, |
| 46 // with pixel snapped paint offset bake
d in. It is really redundant, | 46 // with pixel snapped paint offset bake
d in. It is really redundant, |
| 47 // but it is a pain to teach scrollbars
to paint with an offset. | 47 // but it is a pain to teach scrollbars
to paint with an offset. |
| 48 TransformPaintPropertyNode* paintOffsetTranslation() const { return m_paintO
ffsetTranslation.get(); } | 48 TransformPaintPropertyNode* paintOffsetTranslation() const { return m_paintO
ffsetTranslation.get(); } |
| 49 TransformPaintPropertyNode* transform() const { return m_transform.get(); } | 49 TransformPaintPropertyNode* transform() const { return m_transform.get(); } |
| 50 TransformPaintPropertyNode* perspective() const { return m_perspective.get()
; } | 50 TransformPaintPropertyNode* perspective() const { return m_perspective.get()
; } |
| 51 TransformPaintPropertyNode* svgLocalTransform() const { return m_svgLocalTra
nsform.get(); } | 51 TransformPaintPropertyNode* svgLocalToBorderBoxTransform() const { return m_
svgLocalToBorderBoxTransform.get(); } |
| 52 TransformPaintPropertyNode* scrollTranslation() const { return m_scrollTrans
lation.get(); } | 52 TransformPaintPropertyNode* scrollTranslation() const { return m_scrollTrans
lation.get(); } |
| 53 TransformPaintPropertyNode* scrollbarPaintOffset() const { return m_scrollba
rPaintOffset.get(); } | 53 TransformPaintPropertyNode* scrollbarPaintOffset() const { return m_scrollba
rPaintOffset.get(); } |
| 54 | 54 |
| 55 EffectPaintPropertyNode* effect() const { return m_effect.get(); } | 55 EffectPaintPropertyNode* effect() const { return m_effect.get(); } |
| 56 | 56 |
| 57 ClipPaintPropertyNode* cssClip() const { return m_cssClip.get(); } | 57 ClipPaintPropertyNode* cssClip() const { return m_cssClip.get(); } |
| 58 ClipPaintPropertyNode* cssClipFixedPosition() const { return m_cssClipFixedP
osition.get(); } | 58 ClipPaintPropertyNode* cssClipFixedPosition() const { return m_cssClipFixedP
osition.get(); } |
| 59 ClipPaintPropertyNode* overflowClip() const { return m_overflowClip.get(); } | 59 ClipPaintPropertyNode* overflowClip() const { return m_overflowClip.get(); } |
| 60 | 60 |
| 61 // This is a complete set of property nodes that should be used as a startin
g point to paint | 61 // This is a complete set of property nodes that should be used as a startin
g point to paint |
| (...skipping 16 matching lines...) Expand all Loading... |
| 78 | 78 |
| 79 friend class PaintPropertyTreeBuilder; | 79 friend class PaintPropertyTreeBuilder; |
| 80 // These setters should only be used by PaintPropertyTreeBuilder. | 80 // These setters should only be used by PaintPropertyTreeBuilder. |
| 81 void setPaintOffsetTranslation(PassRefPtr<TransformPaintPropertyNode> paintO
ffset) { m_paintOffsetTranslation = paintOffset; } | 81 void setPaintOffsetTranslation(PassRefPtr<TransformPaintPropertyNode> paintO
ffset) { m_paintOffsetTranslation = paintOffset; } |
| 82 void setTransform(PassRefPtr<TransformPaintPropertyNode> transform) { m_tran
sform = transform; } | 82 void setTransform(PassRefPtr<TransformPaintPropertyNode> transform) { m_tran
sform = transform; } |
| 83 void setEffect(PassRefPtr<EffectPaintPropertyNode> effect) { m_effect = effe
ct; } | 83 void setEffect(PassRefPtr<EffectPaintPropertyNode> effect) { m_effect = effe
ct; } |
| 84 void setCssClip(PassRefPtr<ClipPaintPropertyNode> clip) { m_cssClip = clip;
} | 84 void setCssClip(PassRefPtr<ClipPaintPropertyNode> clip) { m_cssClip = clip;
} |
| 85 void setCssClipFixedPosition(PassRefPtr<ClipPaintPropertyNode> clip) { m_css
ClipFixedPosition = clip; } | 85 void setCssClipFixedPosition(PassRefPtr<ClipPaintPropertyNode> clip) { m_css
ClipFixedPosition = clip; } |
| 86 void setOverflowClip(PassRefPtr<ClipPaintPropertyNode> clip) { m_overflowCli
p = clip; } | 86 void setOverflowClip(PassRefPtr<ClipPaintPropertyNode> clip) { m_overflowCli
p = clip; } |
| 87 void setPerspective(PassRefPtr<TransformPaintPropertyNode> perspective) { m_
perspective = perspective; } | 87 void setPerspective(PassRefPtr<TransformPaintPropertyNode> perspective) { m_
perspective = perspective; } |
| 88 void setSvgLocalTransform(PassRefPtr<TransformPaintPropertyNode> transform) | 88 void setSvgLocalToBorderBoxTransform(PassRefPtr<TransformPaintPropertyNode>
transform) |
| 89 { | 89 { |
| 90 DCHECK(!scrollTranslation()) << "SVG elements cannot scroll so there sho
uld never be both a scroll translation and an SVG local transform."; | 90 DCHECK(!scrollTranslation()) << "SVG elements cannot scroll so there sho
uld never be both a scroll translation and an SVG local to border box transform.
"; |
| 91 m_svgLocalTransform = transform; | 91 m_svgLocalToBorderBoxTransform = transform; |
| 92 } | 92 } |
| 93 void setScrollTranslation(PassRefPtr<TransformPaintPropertyNode> translation
) | 93 void setScrollTranslation(PassRefPtr<TransformPaintPropertyNode> translation
) |
| 94 { | 94 { |
| 95 DCHECK(!svgLocalTransform()) << "SVG elements cannot scroll so there sho
uld never be both a scroll translation and an SVG local transform."; | 95 DCHECK(!svgLocalToBorderBoxTransform()) << "SVG elements cannot scroll s
o there should never be both a scroll translation and an SVG local to border box
transform."; |
| 96 m_scrollTranslation = translation; | 96 m_scrollTranslation = translation; |
| 97 } | 97 } |
| 98 void setScrollbarPaintOffset(PassRefPtr<TransformPaintPropertyNode> paintOff
set) { m_scrollbarPaintOffset = paintOffset; } | 98 void setScrollbarPaintOffset(PassRefPtr<TransformPaintPropertyNode> paintOff
set) { m_scrollbarPaintOffset = paintOffset; } |
| 99 void setLocalBorderBoxProperties(PassOwnPtr<LocalBorderBoxProperties> proper
ties) { m_localBorderBoxProperties = std::move(properties); } | 99 void setLocalBorderBoxProperties(PassOwnPtr<LocalBorderBoxProperties> proper
ties) { m_localBorderBoxProperties = std::move(properties); } |
| 100 | 100 |
| 101 RefPtr<TransformPaintPropertyNode> m_paintOffsetTranslation; | 101 RefPtr<TransformPaintPropertyNode> m_paintOffsetTranslation; |
| 102 RefPtr<TransformPaintPropertyNode> m_transform; | 102 RefPtr<TransformPaintPropertyNode> m_transform; |
| 103 RefPtr<EffectPaintPropertyNode> m_effect; | 103 RefPtr<EffectPaintPropertyNode> m_effect; |
| 104 RefPtr<ClipPaintPropertyNode> m_cssClip; | 104 RefPtr<ClipPaintPropertyNode> m_cssClip; |
| 105 RefPtr<ClipPaintPropertyNode> m_cssClipFixedPosition; | 105 RefPtr<ClipPaintPropertyNode> m_cssClipFixedPosition; |
| 106 RefPtr<ClipPaintPropertyNode> m_overflowClip; | 106 RefPtr<ClipPaintPropertyNode> m_overflowClip; |
| 107 RefPtr<TransformPaintPropertyNode> m_perspective; | 107 RefPtr<TransformPaintPropertyNode> m_perspective; |
| 108 RefPtr<TransformPaintPropertyNode> m_svgLocalTransform; | 108 // TODO(pdr): Only LayoutSVGRoot needs this and it should be moved there. |
| 109 RefPtr<TransformPaintPropertyNode> m_svgLocalToBorderBoxTransform; |
| 109 RefPtr<TransformPaintPropertyNode> m_scrollTranslation; | 110 RefPtr<TransformPaintPropertyNode> m_scrollTranslation; |
| 110 RefPtr<TransformPaintPropertyNode> m_scrollbarPaintOffset; | 111 RefPtr<TransformPaintPropertyNode> m_scrollbarPaintOffset; |
| 111 | 112 |
| 112 OwnPtr<LocalBorderBoxProperties> m_localBorderBoxProperties; | 113 OwnPtr<LocalBorderBoxProperties> m_localBorderBoxProperties; |
| 113 }; | 114 }; |
| 114 | 115 |
| 115 } // namespace blink | 116 } // namespace blink |
| 116 | 117 |
| 117 #endif // ObjectPaintProperties_h | 118 #endif // ObjectPaintProperties_h |
| OLD | NEW |