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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 106 } |
107 | 107 |
108 template<class RenderType> | 108 template<class RenderType> |
109 const Shape& ShapeInfo<RenderType>::computedShape() const | 109 const Shape& ShapeInfo<RenderType>::computedShape() const |
110 { | 110 { |
111 if (Shape* shape = m_shape.get()) | 111 if (Shape* shape = m_shape.get()) |
112 return *shape; | 112 return *shape; |
113 | 113 |
114 WritingMode writingMode = this->styleForWritingMode()->writingMode(); | 114 WritingMode writingMode = this->styleForWritingMode()->writingMode(); |
115 Length margin = m_renderer.style()->shapeMargin(); | 115 Length margin = m_renderer.style()->shapeMargin(); |
116 Length padding = m_renderer.style()->shapePadding(); | |
117 float shapeImageThreshold = m_renderer.style()->shapeImageThreshold(); | 116 float shapeImageThreshold = m_renderer.style()->shapeImageThreshold(); |
118 const ShapeValue* shapeValue = this->shapeValue(); | 117 const ShapeValue* shapeValue = this->shapeValue(); |
119 ASSERT(shapeValue); | 118 ASSERT(shapeValue); |
120 | 119 |
121 switch (shapeValue->type()) { | 120 switch (shapeValue->type()) { |
122 case ShapeValue::Shape: | 121 case ShapeValue::Shape: |
123 ASSERT(shapeValue->shape()); | 122 ASSERT(shapeValue->shape()); |
124 m_shape = Shape::createShape(shapeValue->shape(), m_referenceBoxLogicalS
ize, writingMode, margin, padding); | 123 m_shape = Shape::createShape(shapeValue->shape(), m_referenceBoxLogicalS
ize, writingMode, margin); |
125 break; | 124 break; |
126 case ShapeValue::Image: { | 125 case ShapeValue::Image: { |
127 Image* image; | 126 Image* image; |
128 LayoutRect imageRect; | 127 LayoutRect imageRect; |
129 getShapeImageAndRect(shapeValue, &m_renderer, m_referenceBoxLogicalSize,
image, imageRect); | 128 getShapeImageAndRect(shapeValue, &m_renderer, m_referenceBoxLogicalSize,
image, imageRect); |
130 const LayoutRect& marginRect = getShapeImageMarginRect(m_renderer, m_ref
erenceBoxLogicalSize); | 129 const LayoutRect& marginRect = getShapeImageMarginRect(m_renderer, m_ref
erenceBoxLogicalSize); |
131 m_shape = Shape::createRasterShape(image, shapeImageThreshold, imageRect
, marginRect, writingMode, margin, padding); | 130 m_shape = Shape::createRasterShape(image, shapeImageThreshold, imageRect
, marginRect, writingMode, margin); |
132 break; | 131 break; |
133 } | 132 } |
134 case ShapeValue::Box: { | 133 case ShapeValue::Box: { |
135 const RoundedRect& shapeRect = m_renderer.style()->getRoundedBorderFor(L
ayoutRect(LayoutPoint(), m_referenceBoxLogicalSize), m_renderer.view()); | 134 const RoundedRect& shapeRect = m_renderer.style()->getRoundedBorderFor(L
ayoutRect(LayoutPoint(), m_referenceBoxLogicalSize), m_renderer.view()); |
136 m_shape = Shape::createBoxShape(shapeRect, writingMode, margin, padding)
; | 135 m_shape = Shape::createLayoutBoxShape(shapeRect, writingMode, margin); |
137 break; | 136 break; |
138 } | 137 } |
139 case ShapeValue::Outside: | 138 case ShapeValue::Outside: |
140 // Outside should have already resolved to a different shape value. | 139 // Outside should have already resolved to a different shape value. |
141 ASSERT_NOT_REACHED(); | 140 ASSERT_NOT_REACHED(); |
142 } | 141 } |
143 | 142 |
144 ASSERT(m_shape); | 143 ASSERT(m_shape); |
145 return *m_shape; | 144 return *m_shape; |
146 } | 145 } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 case BoxMissing: break; | 244 case BoxMissing: break; |
246 } | 245 } |
247 | 246 |
248 ASSERT_NOT_REACHED(); | 247 ASSERT_NOT_REACHED(); |
249 return LayoutUnit(); | 248 return LayoutUnit(); |
250 } | 249 } |
251 | 250 |
252 template class ShapeInfo<RenderBlock>; | 251 template class ShapeInfo<RenderBlock>; |
253 template class ShapeInfo<RenderBox>; | 252 template class ShapeInfo<RenderBox>; |
254 } | 253 } |
OLD | NEW |