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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 return *info; | 104 return *info; |
105 InfoMap::AddResult result = infoMap.add(&key, ShapeOutsideInfo::createIn fo(key)); | 105 InfoMap::AddResult result = infoMap.add(&key, ShapeOutsideInfo::createIn fo(key)); |
106 return *result.storedValue->value; | 106 return *result.storedValue->value; |
107 } | 107 } |
108 static void removeInfo(const RenderBox& key) { infoMap().remove(&key); } | 108 static void removeInfo(const RenderBox& key) { infoMap().remove(&key); } |
109 static ShapeOutsideInfo* info(const RenderBox& key) { return infoMap().get(& key); } | 109 static ShapeOutsideInfo* info(const RenderBox& key) { return infoMap().get(& key); } |
110 | 110 |
111 void markShapeAsDirty() { m_shape.clear(); } | 111 void markShapeAsDirty() { m_shape.clear(); } |
112 bool isShapeDirty() { return !m_shape.get(); } | 112 bool isShapeDirty() { return !m_shape.get(); } |
113 LayoutSize shapeSize() const { return m_referenceBoxLogicalSize; } | 113 LayoutSize shapeSize() const { return m_referenceBoxLogicalSize; } |
114 bool isComputingShape() const { return m_computingShape; } | |
114 | 115 |
115 LayoutRect computedShapePhysicalBoundingBox() const; | 116 LayoutRect computedShapePhysicalBoundingBox() const; |
116 FloatPoint shapeToRendererPoint(FloatPoint) const; | 117 FloatPoint shapeToRendererPoint(FloatPoint) const; |
117 FloatSize shapeToRendererSize(FloatSize) const; | 118 FloatSize shapeToRendererSize(FloatSize) const; |
118 const Shape& computedShape() const; | 119 const Shape& computedShape() const; |
119 | 120 |
120 protected: | 121 protected: |
121 ShapeOutsideInfo(const RenderBox& renderer) | 122 ShapeOutsideInfo(const RenderBox& renderer) |
122 : m_renderer(renderer) | 123 : m_renderer(renderer) |
124 , m_computingShape(false) | |
123 { } | 125 { } |
124 | 126 |
125 private: | 127 private: |
126 PassOwnPtr<Shape> createShapeForImage(StyleImage*, float shapeImageThreshold , WritingMode, float margin) const; | 128 PassOwnPtr<Shape> createShapeForImage(StyleImage*, float shapeImageThreshold , WritingMode, float margin) const; |
127 | 129 |
128 LayoutUnit logicalTopOffset() const; | 130 LayoutUnit logicalTopOffset() const; |
129 LayoutUnit logicalLeftOffset() const; | 131 LayoutUnit logicalLeftOffset() const; |
130 | 132 |
131 typedef HashMap<const RenderBox*, OwnPtr<ShapeOutsideInfo> > InfoMap; | 133 typedef HashMap<const RenderBox*, OwnPtr<ShapeOutsideInfo> > InfoMap; |
132 static InfoMap& infoMap() | 134 static InfoMap& infoMap() |
133 { | 135 { |
134 DEFINE_STATIC_LOCAL(InfoMap, staticInfoMap, ()); | 136 DEFINE_STATIC_LOCAL(InfoMap, staticInfoMap, ()); |
135 return staticInfoMap; | 137 return staticInfoMap; |
136 } | 138 } |
137 | 139 |
138 const RenderBox& m_renderer; | 140 const RenderBox& m_renderer; |
139 mutable OwnPtr<Shape> m_shape; | 141 mutable OwnPtr<Shape> m_shape; |
140 LayoutSize m_referenceBoxLogicalSize; | 142 LayoutSize m_referenceBoxLogicalSize; |
141 ShapeOutsideDeltas m_shapeOutsideDeltas; | 143 ShapeOutsideDeltas m_shapeOutsideDeltas; |
144 mutable bool m_computingShape: 1; | |
Julien - ping for review
2014/10/08 18:13:27
Per our style guide, this should be m_isComputingS
| |
142 }; | 145 }; |
143 | 146 |
144 } | 147 } |
145 #endif | 148 #endif |
OLD | NEW |