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

Side by Side Diff: third_party/WebKit/Source/core/paint/ObjectPainter.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/ObjectPainter.h" 5 #include "core/paint/ObjectPainter.h"
6 6
7 #include "core/layout/LayoutBlock.h" 7 #include "core/layout/LayoutBlock.h"
8 #include "core/layout/LayoutInline.h" 8 #include "core/layout/LayoutInline.h"
9 #include "core/layout/LayoutObject.h" 9 #include "core/layout/LayoutObject.h"
10 #include "core/layout/LayoutTheme.h" 10 #include "core/layout/LayoutTheme.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 SkPath::Iter iter(path, false); 129 SkPath::Iter iter(path, false);
130 SkPoint points[4]; 130 SkPoint points[4];
131 size_t count = 0; 131 size_t count = 0;
132 for (SkPath::Verb verb = iter.next(points, false); verb != SkPath::kDone_Verb; 132 for (SkPath::Verb verb = iter.next(points, false); verb != SkPath::kDone_Verb;
133 verb = iter.next(points, false)) { 133 verb = iter.next(points, false)) {
134 if (verb != SkPath::kLine_Verb) 134 if (verb != SkPath::kLine_Verb)
135 continue; 135 continue;
136 136
137 edges.grow(++count); 137 edges.grow(++count);
138 OutlineEdgeInfo& edge = edges.last(); 138 OutlineEdgeInfo& edge = edges.back();
139 edge.x1 = SkScalarTruncToInt(points[0].x()); 139 edge.x1 = SkScalarTruncToInt(points[0].x());
140 edge.y1 = SkScalarTruncToInt(points[0].y()); 140 edge.y1 = SkScalarTruncToInt(points[0].y());
141 edge.x2 = SkScalarTruncToInt(points[1].x()); 141 edge.x2 = SkScalarTruncToInt(points[1].x());
142 edge.y2 = SkScalarTruncToInt(points[1].y()); 142 edge.y2 = SkScalarTruncToInt(points[1].y());
143 if (edge.x1 == edge.x2) { 143 if (edge.x1 == edge.x2) {
144 if (edge.y1 < edge.y2) { 144 if (edge.y1 < edge.y2) {
145 edge.x1 -= width; 145 edge.x1 -= width;
146 edge.side = BSRight; 146 edge.side = BSRight;
147 } else { 147 } else {
148 std::swap(edge.y1, edge.y2); 148 std::swap(edge.y1, edge.y2);
(...skipping 18 matching lines...) Expand all
167 167
168 Color outlineColor = color; 168 Color outlineColor = color;
169 bool useTransparencyLayer = color.hasAlpha(); 169 bool useTransparencyLayer = color.hasAlpha();
170 if (useTransparencyLayer) { 170 if (useTransparencyLayer) {
171 graphicsContext.beginLayer(static_cast<float>(color.alpha()) / 255); 171 graphicsContext.beginLayer(static_cast<float>(color.alpha()) / 255);
172 outlineColor = 172 outlineColor =
173 Color(outlineColor.red(), outlineColor.green(), outlineColor.blue()); 173 Color(outlineColor.red(), outlineColor.green(), outlineColor.blue());
174 } 174 }
175 175
176 DCHECK(count >= 4 && edges.size() == count); 176 DCHECK(count >= 4 && edges.size() == count);
177 int firstAdjacentWidth = adjustJoint(width, edges.last(), edges.first()); 177 int firstAdjacentWidth = adjustJoint(width, edges.back(), edges.first());
178 178
179 // The width of the angled part of starting and ending joint of the current 179 // The width of the angled part of starting and ending joint of the current
180 // edge. 180 // edge.
181 int adjacentWidthStart = firstAdjacentWidth; 181 int adjacentWidthStart = firstAdjacentWidth;
182 int adjacentWidthEnd; 182 int adjacentWidthEnd;
183 for (size_t i = 0; i < count; ++i) { 183 for (size_t i = 0; i < count; ++i) {
184 OutlineEdgeInfo& edge = edges[i]; 184 OutlineEdgeInfo& edge = edges[i];
185 adjacentWidthEnd = i == count - 1 ? firstAdjacentWidth 185 adjacentWidthEnd = i == count - 1 ? firstAdjacentWidth
186 : adjustJoint(width, edge, edges[i + 1]); 186 : adjustJoint(width, edge, edges[i + 1]);
187 int adjacentWidth1 = adjacentWidthStart; 187 int adjacentWidth1 = adjacentWidthStart;
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 adjustedPaintOffset += toLayoutBox(m_layoutObject).location(); 716 adjustedPaintOffset += toLayoutBox(m_layoutObject).location();
717 DCHECK(m_layoutObject.previousPaintOffset() == adjustedPaintOffset) 717 DCHECK(m_layoutObject.previousPaintOffset() == adjustedPaintOffset)
718 << " Paint offset mismatch: " << m_layoutObject.debugName() 718 << " Paint offset mismatch: " << m_layoutObject.debugName()
719 << " from PaintPropertyTreeBuilder: " 719 << " from PaintPropertyTreeBuilder: "
720 << m_layoutObject.previousPaintOffset().toString() 720 << m_layoutObject.previousPaintOffset().toString()
721 << " from painter: " << adjustedPaintOffset.toString(); 721 << " from painter: " << adjustedPaintOffset.toString();
722 } 722 }
723 #endif 723 #endif
724 724
725 } // namespace blink 725 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/BoxBorderPainter.cpp ('k') | third_party/WebKit/Source/core/style/QuotesData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698