| 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 12 matching lines...) Expand all Loading... |
| 23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR |
| 25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | 25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF |
| 26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 27 * SUCH DAMAGE. | 27 * SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #include "config.h" | 30 #include "config.h" |
| 31 #include "core/rendering/exclusions/ExclusionShapeInfo.h" | 31 #include "core/rendering/exclusions/ExclusionShapeInfo.h" |
| 32 | 32 |
| 33 #include "core/rendering/RenderRegion.h" |
| 33 #include "core/rendering/exclusions/ExclusionShape.h" | 34 #include "core/rendering/exclusions/ExclusionShape.h" |
| 34 #include "core/rendering/RenderRegion.h" | |
| 35 #include "core/rendering/style/RenderStyle.h" | 35 #include "core/rendering/style/RenderStyle.h" |
| 36 | 36 |
| 37 namespace WebCore { | 37 namespace WebCore { |
| 38 template<class RenderType, ExclusionShapeValue* (RenderStyle::*shapeGetter)() co
nst, void (ExclusionShape::*intervalGetter)(LayoutUnit, LayoutUnit, SegmentList&
) const> | 38 template<class RenderType, ExclusionShapeValue* (RenderStyle::*shapeGetter)() co
nst, void (ExclusionShape::*intervalGetter)(LayoutUnit, LayoutUnit, SegmentList&
) const> |
| 39 const ExclusionShape* ExclusionShapeInfo<RenderType, shapeGetter, intervalGetter
>::computedShape() const | 39 const ExclusionShape* ExclusionShapeInfo<RenderType, shapeGetter, intervalGetter
>::computedShape() const |
| 40 { | 40 { |
| 41 if (ExclusionShape* exclusionShape = m_shape.get()) | 41 if (ExclusionShape* exclusionShape = m_shape.get()) |
| 42 return exclusionShape; | 42 return exclusionShape; |
| 43 | 43 |
| 44 ExclusionShapeValue* shapeValue = (m_renderer->style()->*shapeGetter)(); | 44 ExclusionShapeValue* shapeValue = (m_renderer->style()->*shapeGetter)(); |
| 45 BasicShape* shape = (shapeValue && shapeValue->type() == ExclusionShapeValue
::SHAPE) ? shapeValue->shape() : 0; | 45 BasicShape* shape = (shapeValue && shapeValue->type() == ExclusionShapeValue
::Shape) ? shapeValue->shape() : 0; |
| 46 | 46 |
| 47 ASSERT(shape); | 47 ASSERT(shape); |
| 48 | 48 |
| 49 m_shape = ExclusionShape::createExclusionShape(shape, LayoutSize(m_shapeLogi
calWidth, m_shapeLogicalHeight), m_renderer->style()->writingMode(), m_renderer-
>style()->shapeMargin(), m_renderer->style()->shapePadding()); | 49 m_shape = ExclusionShape::createExclusionShape(shape, LayoutSize(m_shapeLogi
calWidth, m_shapeLogicalHeight), m_renderer->style()->writingMode(), m_renderer-
>style()->shapeMargin(), m_renderer->style()->shapePadding()); |
| 50 ASSERT(m_shape); | 50 ASSERT(m_shape); |
| 51 return m_shape.get(); | 51 return m_shape.get(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 template<class RenderType, ExclusionShapeValue* (RenderStyle::*shapeGetter)() co
nst, void (ExclusionShape::*intervalGetter)(LayoutUnit, LayoutUnit, SegmentList&
) const> | 54 template<class RenderType, ExclusionShapeValue* (RenderStyle::*shapeGetter)() co
nst, void (ExclusionShape::*intervalGetter)(LayoutUnit, LayoutUnit, SegmentList&
) const> |
| 55 LayoutUnit ExclusionShapeInfo<RenderType, shapeGetter, intervalGetter>::logicalT
opOffset() const | 55 LayoutUnit ExclusionShapeInfo<RenderType, shapeGetter, intervalGetter>::logicalT
opOffset() const |
| (...skipping 21 matching lines...) Expand all Loading... |
| 77 m_segments[i].logicalLeft += logicalLeftOffset; | 77 m_segments[i].logicalLeft += logicalLeftOffset; |
| 78 m_segments[i].logicalRight += logicalLeftOffset; | 78 m_segments[i].logicalRight += logicalLeftOffset; |
| 79 } | 79 } |
| 80 | 80 |
| 81 return m_segments.size(); | 81 return m_segments.size(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 template class ExclusionShapeInfo<RenderBlock, &RenderStyle::resolvedShapeInside
, &ExclusionShape::getIncludedIntervals>; | 84 template class ExclusionShapeInfo<RenderBlock, &RenderStyle::resolvedShapeInside
, &ExclusionShape::getIncludedIntervals>; |
| 85 template class ExclusionShapeInfo<RenderBox, &RenderStyle::shapeOutside, &Exclus
ionShape::getExcludedIntervals>; | 85 template class ExclusionShapeInfo<RenderBox, &RenderStyle::shapeOutside, &Exclus
ionShape::getExcludedIntervals>; |
| 86 } | 86 } |
| OLD | NEW |