| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010, 2011 Apple Inc. 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 ASSERT(it >= m_spans.data()); | 308 ASSERT(it >= m_spans.data()); |
| 309 ASSERT(it < m_spans.data() + m_spans.size()); | 309 ASSERT(it < m_spans.data() + m_spans.size()); |
| 310 | 310 |
| 311 // Check if this span has any segments. | 311 // Check if this span has any segments. |
| 312 if (it->segmentIndex == m_segments.size()) | 312 if (it->segmentIndex == m_segments.size()) |
| 313 return 0; | 313 return 0; |
| 314 | 314 |
| 315 ASSERT(it + 1 < m_spans.data() + m_spans.size()); | 315 ASSERT(it + 1 < m_spans.data() + m_spans.size()); |
| 316 size_t segmentIndex = (it + 1)->segmentIndex; | 316 size_t segmentIndex = (it + 1)->segmentIndex; |
| 317 | 317 |
| 318 ASSERT_WITH_SECURITY_IMPLICATION(segmentIndex <= m_segments.size()); | 318 SECURITY_DCHECK(segmentIndex <= m_segments.size()); |
| 319 return m_segments.data() + segmentIndex; | 319 return m_segments.data() + segmentIndex; |
| 320 } | 320 } |
| 321 | 321 |
| 322 #ifndef NDEBUG | 322 #ifndef NDEBUG |
| 323 void Region::Shape::dump() const { | 323 void Region::Shape::dump() const { |
| 324 for (Shape::SpanIterator span = spansBegin(), end = spansEnd(); span != end; | 324 for (Shape::SpanIterator span = spansBegin(), end = spansEnd(); span != end; |
| 325 ++span) { | 325 ++span) { |
| 326 printf("%6d: (", span->y); | 326 printf("%6d: (", span->y); |
| 327 | 327 |
| 328 for (Shape::SegmentIterator segment = segmentsBegin(span), | 328 for (Shape::SegmentIterator segment = segmentsBegin(span), |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 m_shape.swap(subtractedShape); | 618 m_shape.swap(subtractedShape); |
| 619 m_bounds = m_shape.bounds(); | 619 m_bounds = m_shape.bounds(); |
| 620 } | 620 } |
| 621 | 621 |
| 622 void Region::translate(const IntSize& offset) { | 622 void Region::translate(const IntSize& offset) { |
| 623 m_bounds.move(offset); | 623 m_bounds.move(offset); |
| 624 m_shape.translate(offset); | 624 m_shape.translate(offset); |
| 625 } | 625 } |
| 626 | 626 |
| 627 } // namespace blink | 627 } // namespace blink |
| OLD | NEW |