OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 InfoMap::AddResult result = infoMap.add(&key, ShapeOutsideInfo::createIn fo(key)); | 82 InfoMap::AddResult result = infoMap.add(&key, ShapeOutsideInfo::createIn fo(key)); |
83 return *result.storedValue->value; | 83 return *result.storedValue->value; |
84 } | 84 } |
85 static void removeInfo(const RenderBox& key) { infoMap().remove(&key); } | 85 static void removeInfo(const RenderBox& key) { infoMap().remove(&key); } |
86 static ShapeOutsideInfo* info(const RenderBox& key) { return infoMap().get(& key); } | 86 static ShapeOutsideInfo* info(const RenderBox& key) { return infoMap().get(& key); } |
87 | 87 |
88 void markShapeAsDirty() { m_shape.clear(); } | 88 void markShapeAsDirty() { m_shape.clear(); } |
89 bool isShapeDirty() { return !m_shape.get(); } | 89 bool isShapeDirty() { return !m_shape.get(); } |
90 LayoutSize shapeSize() const { return m_referenceBoxLogicalSize; } | 90 LayoutSize shapeSize() const { return m_referenceBoxLogicalSize; } |
91 | 91 |
92 private: | 92 LayoutRect computedShapePhysicalBoundingBox() const; |
93 ShapeOutsideInfo(const RenderBox& renderer) | 93 FloatPoint shapeToRendererPoint(FloatPoint) const; |
94 FloatSize shapeToRendererSize(FloatSize) const; | |
95 | |
96 const Shape& computedShape() const; | |
97 | |
98 protected: | |
99 explicit ShapeOutsideInfo(const RenderBox& renderer) | |
94 : m_renderer(renderer) | 100 : m_renderer(renderer) |
95 , m_lineOverlapsShape(false) | 101 , m_lineOverlapsShape(false) |
96 { } | 102 { } |
97 | 103 |
98 const Shape& computedShape() const; | 104 private: |
99 | |
100 LayoutUnit logicalTopOffset() const; | 105 LayoutUnit logicalTopOffset() const; |
101 LayoutUnit logicalLeftOffset() const; | 106 LayoutUnit logicalLeftOffset() const; |
102 | 107 |
103 typedef HashMap<const RenderBox*, OwnPtr<ShapeOutsideInfo> > InfoMap; | 108 typedef HashMap<const RenderBox*, OwnPtr<ShapeOutsideInfo> > InfoMap; |
104 static InfoMap& infoMap() | 109 static InfoMap& infoMap() |
105 { | 110 { |
106 DEFINE_STATIC_LOCAL(InfoMap, staticInfoMap, ()); | 111 DEFINE_STATIC_LOCAL(InfoMap, staticInfoMap, ()); |
107 return staticInfoMap; | 112 return staticInfoMap; |
108 } | 113 } |
109 | 114 |
110 LayoutUnit m_referenceBoxLineTop; | 115 LayoutUnit m_referenceBoxLineTop; |
111 LayoutUnit m_lineHeight; | 116 LayoutUnit m_lineHeight; |
112 | 117 |
113 const RenderBox& m_renderer; | 118 const RenderBox& m_renderer; |
119 | |
Bear Travis
2014/04/17 20:26:45
Added line break. There's another one below. It's
Habib Virji
2014/04/23 16:28:33
Done.
| |
114 mutable OwnPtr<Shape> m_shape; | 120 mutable OwnPtr<Shape> m_shape; |
115 LayoutSize m_referenceBoxLogicalSize; | 121 LayoutSize m_referenceBoxLogicalSize; |
122 | |
116 LayoutUnit m_leftMarginBoxDelta; | 123 LayoutUnit m_leftMarginBoxDelta; |
117 LayoutUnit m_rightMarginBoxDelta; | 124 LayoutUnit m_rightMarginBoxDelta; |
118 LayoutUnit m_borderBoxLineTop; | 125 LayoutUnit m_borderBoxLineTop; |
119 bool m_lineOverlapsShape; | 126 bool m_lineOverlapsShape; |
120 }; | 127 }; |
121 | 128 |
122 } | 129 } |
123 #endif | 130 #endif |
OLD | NEW |