Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: third_party/WebKit/Source/platform/geometry/Region.cpp

Issue 2502413004: WTF/std normalization: replace WTF::Vector::last with ::back (Closed)
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 240
241 void Region::Shape::appendSpan(int y) { 241 void Region::Shape::appendSpan(int y) {
242 m_spans.append(Span(y, m_segments.size())); 242 m_spans.append(Span(y, m_segments.size()));
243 } 243 }
244 244
245 bool Region::Shape::canCoalesce(SegmentIterator begin, SegmentIterator end) { 245 bool Region::Shape::canCoalesce(SegmentIterator begin, SegmentIterator end) {
246 if (m_spans.isEmpty()) 246 if (m_spans.isEmpty())
247 return false; 247 return false;
248 248
249 SegmentIterator lastSpanBegin = 249 SegmentIterator lastSpanBegin =
250 m_segments.data() + m_spans.last().segmentIndex; 250 m_segments.data() + m_spans.back().segmentIndex;
251 SegmentIterator lastSpanEnd = m_segments.data() + m_segments.size(); 251 SegmentIterator lastSpanEnd = m_segments.data() + m_segments.size();
252 252
253 // Check if both spans have an equal number of segments. 253 // Check if both spans have an equal number of segments.
254 if (lastSpanEnd - lastSpanBegin != end - begin) 254 if (lastSpanEnd - lastSpanBegin != end - begin)
255 return false; 255 return false;
256 256
257 // Check if both spans are equal. 257 // Check if both spans are equal.
258 if (!std::equal(begin, end, lastSpanBegin)) 258 if (!std::equal(begin, end, lastSpanBegin))
259 return false; 259 return false;
260 260
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698