| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 WritingMode writingMode = m_renderer->style()->writingMode(); | 66 WritingMode writingMode = m_renderer->style()->writingMode(); |
| 67 Length margin = m_renderer->style()->shapeMargin(); | 67 Length margin = m_renderer->style()->shapeMargin(); |
| 68 Length padding = m_renderer->style()->shapePadding(); | 68 Length padding = m_renderer->style()->shapePadding(); |
| 69 float shapeImageThreshold = m_renderer->style()->shapeImageThreshold(); | 69 float shapeImageThreshold = m_renderer->style()->shapeImageThreshold(); |
| 70 const ShapeValue* shapeValue = this->shapeValue(); | 70 const ShapeValue* shapeValue = this->shapeValue(); |
| 71 ASSERT(shapeValue); | 71 ASSERT(shapeValue); |
| 72 | 72 |
| 73 switch (shapeValue->type()) { | 73 switch (shapeValue->type()) { |
| 74 case ShapeValue::Shape: | 74 case ShapeValue::Shape: |
| 75 ASSERT(shapeValue->shape()); | 75 ASSERT(shapeValue->shape()); |
| 76 m_shape = Shape::createShape(shapeValue->shape(), m_shapeLogicalSize, wr
itingMode, margin, padding); | 76 m_shape = Shape::createShape(shapeValue->shape(), m_referenceBoxLogicalS
ize, writingMode, margin, padding); |
| 77 break; | 77 break; |
| 78 case ShapeValue::Image: { | 78 case ShapeValue::Image: { |
| 79 ASSERT(shapeValue->image()); | 79 ASSERT(shapeValue->image()); |
| 80 const StyleImage& styleImage = *(shapeValue->image()); | 80 const StyleImage& styleImage = *(shapeValue->image()); |
| 81 m_shape = Shape::createRasterShape(styleImage, shapeImageThreshold, getS
hapeImageRect(styleImage, m_renderer), m_shapeLogicalSize, writingMode, margin,
padding); | 81 m_shape = Shape::createRasterShape(styleImage, shapeImageThreshold, getS
hapeImageRect(styleImage, m_renderer), m_referenceBoxLogicalSize, writingMode, m
argin, padding); |
| 82 break; | 82 break; |
| 83 } | 83 } |
| 84 case ShapeValue::Box: { | 84 case ShapeValue::Box: { |
| 85 const RoundedRect& shapeRect = m_renderer->style()->getRoundedBorderFor(
LayoutRect(LayoutPoint(), m_shapeLogicalSize), m_renderer->view()); | 85 const RoundedRect& shapeRect = m_renderer->style()->getRoundedBorderFor(
LayoutRect(LayoutPoint(), m_referenceBoxLogicalSize), m_renderer->view()); |
| 86 m_shape = Shape::createLayoutBoxShape(shapeRect, writingMode, margin, pa
dding); | 86 m_shape = Shape::createLayoutBoxShape(shapeRect, writingMode, margin, pa
dding); |
| 87 break; | 87 break; |
| 88 } | 88 } |
| 89 case ShapeValue::Outside: | 89 case ShapeValue::Outside: |
| 90 // Outside should have already resolved to a different shape value. | 90 // Outside should have already resolved to a different shape value. |
| 91 ASSERT_NOT_REACHED(); | 91 ASSERT_NOT_REACHED(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 ASSERT(m_shape); | 94 ASSERT(m_shape); |
| 95 return m_shape.get(); | 95 return m_shape.get(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 107 segments[i].logicalLeft += logicalLeftOffset(); | 107 segments[i].logicalLeft += logicalLeftOffset(); |
| 108 segments[i].logicalRight += logicalLeftOffset(); | 108 segments[i].logicalRight += logicalLeftOffset(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 return segments; | 111 return segments; |
| 112 } | 112 } |
| 113 | 113 |
| 114 template class ShapeInfo<RenderBlock>; | 114 template class ShapeInfo<RenderBlock>; |
| 115 template class ShapeInfo<RenderBox>; | 115 template class ShapeInfo<RenderBox>; |
| 116 } | 116 } |
| OLD | NEW |