| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 result->intervalAt(y).unite(marginIntervalGenerator.intervalAt(y)); | 96 result->intervalAt(y).unite(marginIntervalGenerator.intervalAt(y)); |
| 97 | 97 |
| 98 for (int marginY = y + 1; marginY < marginY1; ++marginY) { | 98 for (int marginY = y + 1; marginY < marginY1; ++marginY) { |
| 99 if (marginY < bounds().maxY() && intervalAt(marginY).contains(interv
alAtY)) | 99 if (marginY < bounds().maxY() && intervalAt(marginY).contains(interv
alAtY)) |
| 100 break; | 100 break; |
| 101 result->intervalAt(marginY).unite(marginIntervalGenerator.intervalAt
(marginY)); | 101 result->intervalAt(marginY).unite(marginIntervalGenerator.intervalAt
(marginY)); |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 | 104 |
| 105 result->initializeBounds(); | 105 result->initializeBounds(); |
| 106 return result.release(); | 106 return result; |
| 107 } | 107 } |
| 108 | 108 |
| 109 void RasterShapeIntervals::initializeBounds() | 109 void RasterShapeIntervals::initializeBounds() |
| 110 { | 110 { |
| 111 m_bounds = IntRect(); | 111 m_bounds = IntRect(); |
| 112 for (int y = minY(); y < maxY(); ++y) { | 112 for (int y = minY(); y < maxY(); ++y) { |
| 113 const IntShapeInterval& intervalAtY = intervalAt(y); | 113 const IntShapeInterval& intervalAtY = intervalAt(y); |
| 114 if (intervalAtY.isEmpty()) | 114 if (intervalAtY.isEmpty()) |
| 115 continue; | 115 continue; |
| 116 m_bounds.unite(IntRect(intervalAtY.x1(), y, intervalAtY.width(), 1)); | 116 m_bounds.unite(IntRect(intervalAtY.x1(), y, intervalAtY.width(), 1)); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 excludedInterval.unite(intervals.intervalAt(y)); | 172 excludedInterval.unite(intervals.intervalAt(y)); |
| 173 } | 173 } |
| 174 | 174 |
| 175 // Note: |marginIntervals()| returns end-point exclusive | 175 // Note: |marginIntervals()| returns end-point exclusive |
| 176 // intervals. |excludedInterval.x2()| contains the left-most pixel | 176 // intervals. |excludedInterval.x2()| contains the left-most pixel |
| 177 // offset to the right of the calculated union. | 177 // offset to the right of the calculated union. |
| 178 return LineSegment(excludedInterval.x1(), excludedInterval.x2()); | 178 return LineSegment(excludedInterval.x1(), excludedInterval.x2()); |
| 179 } | 179 } |
| 180 | 180 |
| 181 } // namespace blink | 181 } // namespace blink |
| OLD | NEW |