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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp

Issue 2610253004: Migrate WTF::Vector::append() to ::push_back() [part 9 of N] (Closed)
Patch Set: rebase Created 3 years, 11 months 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) 2006 Apple Computer, Inc. 2 * Copyright (C) 2006 Apple Computer, Inc.
3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> 3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org>
4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> 4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
6 * Copyright (C) 2008 Rob Buis <buis@kde.org> 6 * Copyright (C) 2008 Rob Buis <buis@kde.org>
7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved.
9 * Copyright (C) 2012 Google Inc. 9 * Copyright (C) 2012 Google Inc.
10 * 10 *
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 const LayoutObject* start) { 91 const LayoutObject* start) {
92 return findTextRoot(start); 92 return findTextRoot(start);
93 } 93 }
94 94
95 static inline void collectDescendantTextNodes( 95 static inline void collectDescendantTextNodes(
96 LayoutSVGText& textRoot, 96 LayoutSVGText& textRoot,
97 Vector<LayoutSVGInlineText*>& descendantTextNodes) { 97 Vector<LayoutSVGInlineText*>& descendantTextNodes) {
98 for (LayoutObject* descendant = textRoot.firstChild(); descendant; 98 for (LayoutObject* descendant = textRoot.firstChild(); descendant;
99 descendant = descendant->nextInPreOrder(&textRoot)) { 99 descendant = descendant->nextInPreOrder(&textRoot)) {
100 if (descendant->isSVGInlineText()) 100 if (descendant->isSVGInlineText())
101 descendantTextNodes.append(toLayoutSVGInlineText(descendant)); 101 descendantTextNodes.push_back(toLayoutSVGInlineText(descendant));
102 } 102 }
103 } 103 }
104 104
105 void LayoutSVGText::invalidatePositioningValues( 105 void LayoutSVGText::invalidatePositioningValues(
106 LayoutInvalidationReasonForTracing reason) { 106 LayoutInvalidationReasonForTracing reason) {
107 m_descendantTextNodes.clear(); 107 m_descendantTextNodes.clear();
108 setNeedsPositioningValuesUpdate(); 108 setNeedsPositioningValuesUpdate();
109 setNeedsLayoutAndFullPaintInvalidation(reason); 109 setNeedsLayoutAndFullPaintInvalidation(reason);
110 } 110 }
111 111
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 clippedPointInContents); 339 clippedPointInContents);
340 if (!closestBox) 340 if (!closestBox)
341 return createPositionWithAffinity(0); 341 return createPositionWithAffinity(0);
342 342
343 return closestBox->getLineLayoutItem().positionForPoint( 343 return closestBox->getLineLayoutItem().positionForPoint(
344 LayoutPoint(clippedPointInContents.x(), closestBox->y())); 344 LayoutPoint(clippedPointInContents.x(), closestBox->y()));
345 } 345 }
346 346
347 void LayoutSVGText::absoluteQuads(Vector<FloatQuad>& quads, 347 void LayoutSVGText::absoluteQuads(Vector<FloatQuad>& quads,
348 MapCoordinatesFlags mode) const { 348 MapCoordinatesFlags mode) const {
349 quads.append(localToAbsoluteQuad(strokeBoundingBox(), mode)); 349 quads.push_back(localToAbsoluteQuad(strokeBoundingBox(), mode));
350 } 350 }
351 351
352 void LayoutSVGText::paint(const PaintInfo& paintInfo, 352 void LayoutSVGText::paint(const PaintInfo& paintInfo,
353 const LayoutPoint&) const { 353 const LayoutPoint&) const {
354 SVGTextPainter(*this).paint(paintInfo); 354 SVGTextPainter(*this).paint(paintInfo);
355 } 355 }
356 356
357 FloatRect LayoutSVGText::objectBoundingBox() const { 357 FloatRect LayoutSVGText::objectBoundingBox() const {
358 if (const RootInlineBox* box = firstRootBox()) 358 if (const RootInlineBox* box = firstRootBox())
359 return FloatRect(box->frameRect()); 359 return FloatRect(box->frameRect());
(...skipping 20 matching lines...) Expand all
380 380
381 if (const ShadowList* textShadow = style()->textShadow()) 381 if (const ShadowList* textShadow = style()->textShadow())
382 textShadow->adjustRectForShadow(visualRect); 382 textShadow->adjustRectForShadow(visualRect);
383 383
384 return visualRect; 384 return visualRect;
385 } 385 }
386 386
387 void LayoutSVGText::addOutlineRects(Vector<LayoutRect>& rects, 387 void LayoutSVGText::addOutlineRects(Vector<LayoutRect>& rects,
388 const LayoutPoint&, 388 const LayoutPoint&,
389 IncludeBlockVisualOverflowOrNot) const { 389 IncludeBlockVisualOverflowOrNot) const {
390 rects.append(LayoutRect(objectBoundingBox())); 390 rects.push_back(LayoutRect(objectBoundingBox()));
391 } 391 }
392 392
393 bool LayoutSVGText::isObjectBoundingBoxValid() const { 393 bool LayoutSVGText::isObjectBoundingBoxValid() const {
394 // If we don't have any line boxes, then consider the bbox invalid. 394 // If we don't have any line boxes, then consider the bbox invalid.
395 return firstLineBox(); 395 return firstLineBox();
396 } 396 }
397 397
398 void LayoutSVGText::addChild(LayoutObject* child, LayoutObject* beforeChild) { 398 void LayoutSVGText::addChild(LayoutObject* child, LayoutObject* beforeChild) {
399 LayoutSVGBlock::addChild(child, beforeChild); 399 LayoutSVGBlock::addChild(child, beforeChild);
400 400
(...skipping 10 matching lines...) Expand all
411 411
412 void LayoutSVGText::invalidateTreeIfNeeded( 412 void LayoutSVGText::invalidateTreeIfNeeded(
413 const PaintInvalidationState& paintInvalidationState) { 413 const PaintInvalidationState& paintInvalidationState) {
414 // TODO(wangxianzhu): Verify if the inherited 414 // TODO(wangxianzhu): Verify if the inherited
415 // LayoutBoxModelObject::invalidateTreeIfNeeded() 415 // LayoutBoxModelObject::invalidateTreeIfNeeded()
416 // is applicable here. If yes, remove this overriding method. 416 // is applicable here. If yes, remove this overriding method.
417 LayoutObject::invalidateTreeIfNeeded(paintInvalidationState); 417 LayoutObject::invalidateTreeIfNeeded(paintInvalidationState);
418 } 418 }
419 419
420 } // namespace blink 420 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698