OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2013 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 y = endY - 1; | 135 y = endY - 1; |
136 } | 136 } |
137 } | 137 } |
138 | 138 |
139 const RasterShapeIntervals& RasterShape::marginIntervals() const | 139 const RasterShapeIntervals& RasterShape::marginIntervals() const |
140 { | 140 { |
141 ASSERT(shapeMargin() >= 0); | 141 ASSERT(shapeMargin() >= 0); |
142 if (!shapeMargin()) | 142 if (!shapeMargin()) |
143 return *m_intervals; | 143 return *m_intervals; |
144 | 144 |
145 int shapeMarginInt = clampToPositiveInteger(ceil(shapeMargin())); | 145 int shapeMarginInt = clampTo<int>(ceil(shapeMargin()), 0); |
146 int maxShapeMarginInt = std::max(m_marginRectSize.width(), m_marginRectSize.
height()) * sqrtf(2); | 146 int maxShapeMarginInt = std::max(m_marginRectSize.width(), m_marginRectSize.
height()) * sqrtf(2); |
147 if (!m_marginIntervals) | 147 if (!m_marginIntervals) |
148 m_marginIntervals = m_intervals->computeShapeMarginIntervals(std::min(sh
apeMarginInt, maxShapeMarginInt)); | 148 m_marginIntervals = m_intervals->computeShapeMarginIntervals(std::min(sh
apeMarginInt, maxShapeMarginInt)); |
149 | 149 |
150 return *m_marginIntervals; | 150 return *m_marginIntervals; |
151 } | 151 } |
152 | 152 |
153 LineSegment RasterShape::getExcludedInterval(LayoutUnit logicalTop, LayoutUnit l
ogicalHeight) const | 153 LineSegment RasterShape::getExcludedInterval(LayoutUnit logicalTop, LayoutUnit l
ogicalHeight) const |
154 { | 154 { |
155 const RasterShapeIntervals& intervals = marginIntervals(); | 155 const RasterShapeIntervals& intervals = marginIntervals(); |
(...skipping 17 matching lines...) Expand all Loading... |
173 excludedInterval.unite(intervals.intervalAt(y)); | 173 excludedInterval.unite(intervals.intervalAt(y)); |
174 } | 174 } |
175 | 175 |
176 // Note: |marginIntervals()| returns end-point exclusive | 176 // Note: |marginIntervals()| returns end-point exclusive |
177 // intervals. |excludedInterval.x2()| contains the left-most pixel | 177 // intervals. |excludedInterval.x2()| contains the left-most pixel |
178 // offset to the right of the calculated union. | 178 // offset to the right of the calculated union. |
179 return LineSegment(excludedInterval.x1(), excludedInterval.x2()); | 179 return LineSegment(excludedInterval.x1(), excludedInterval.x2()); |
180 } | 180 } |
181 | 181 |
182 } // namespace blink | 182 } // namespace blink |
OLD | NEW |