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

Side by Side Diff: Source/core/rendering/svg/RenderSVGText.cpp

Issue 463883003: Rename repaint to paintInvalidation in core/rendering/svg. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 ASSERT(start); 89 ASSERT(start);
90 while (start && !start->isSVGText()) 90 while (start && !start->isSVGText())
91 start = start->parent(); 91 start = start->parent();
92 if (!start || !start->isSVGText()) 92 if (!start || !start->isSVGText())
93 return 0; 93 return 0;
94 return toRenderSVGText(start); 94 return toRenderSVGText(start);
95 } 95 }
96 96
97 void RenderSVGText::mapRectToPaintInvalidationBacking(const RenderLayerModelObje ct* paintInvalidationContainer, LayoutRect& rect, bool fixed, const PaintInvalid ationState* paintInvalidationState) const 97 void RenderSVGText::mapRectToPaintInvalidationBacking(const RenderLayerModelObje ct* paintInvalidationContainer, LayoutRect& rect, bool fixed, const PaintInvalid ationState* paintInvalidationState) const
98 { 98 {
99 FloatRect repaintRect = rect; 99 FloatRect paintInvalidationRect = rect;
100 computeFloatRectForPaintInvalidation(paintInvalidationContainer, repaintRect , fixed, paintInvalidationState); 100 computeFloatRectForPaintInvalidation(paintInvalidationContainer, paintInvali dationRect, fixed, paintInvalidationState);
101 rect = enclosingLayoutRect(repaintRect); 101 rect = enclosingLayoutRect(paintInvalidationRect);
102 } 102 }
103 103
104 static inline void collectLayoutAttributes(RenderObject* text, Vector<SVGTextLay outAttributes*>& attributes) 104 static inline void collectLayoutAttributes(RenderObject* text, Vector<SVGTextLay outAttributes*>& attributes)
105 { 105 {
106 for (RenderObject* descendant = text; descendant; descendant = descendant->n extInPreOrder(text)) { 106 for (RenderObject* descendant = text; descendant; descendant = descendant->n extInPreOrder(text)) {
107 if (descendant->isSVGInlineText()) 107 if (descendant->isSVGInlineText())
108 attributes.append(toRenderSVGInlineText(descendant)->layoutAttribute s()); 108 attributes.append(toRenderSVGInlineText(descendant)->layoutAttribute s());
109 } 109 }
110 } 110 }
111 111
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 // FIXME: We need to find a way to only layout the child boxes, if needed. 386 // FIXME: We need to find a way to only layout the child boxes, if needed.
387 FloatRect oldBoundaries = objectBoundingBox(); 387 FloatRect oldBoundaries = objectBoundingBox();
388 ASSERT(childrenInline()); 388 ASSERT(childrenInline());
389 389
390 rebuildFloatsFromIntruding(); 390 rebuildFloatsFromIntruding();
391 391
392 LayoutUnit beforeEdge = borderBefore() + paddingBefore(); 392 LayoutUnit beforeEdge = borderBefore() + paddingBefore();
393 LayoutUnit afterEdge = borderAfter() + paddingAfter() + scrollbarLogicalHeig ht(); 393 LayoutUnit afterEdge = borderAfter() + paddingAfter() + scrollbarLogicalHeig ht();
394 setLogicalHeight(beforeEdge); 394 setLogicalHeight(beforeEdge);
395 395
396 LayoutUnit repaintLogicalTop = 0; 396 LayoutUnit paintInvalidationLogicalTop = 0;
397 LayoutUnit repaintLogicalBottom = 0; 397 LayoutUnit paintInvalidationLogicalBottom = 0;
398 layoutInlineChildren(true, repaintLogicalTop, repaintLogicalBottom, afterEdg e); 398 layoutInlineChildren(true, paintInvalidationLogicalTop, paintInvalidationLog icalBottom, afterEdge);
399 399
400 if (m_needsReordering) 400 if (m_needsReordering)
401 m_needsReordering = false; 401 m_needsReordering = false;
402 402
403 if (!updateCachedBoundariesInParents) 403 if (!updateCachedBoundariesInParents)
404 updateCachedBoundariesInParents = oldBoundaries != objectBoundingBox(); 404 updateCachedBoundariesInParents = oldBoundaries != objectBoundingBox();
405 405
406 // Invalidate all resources of this client if our layout changed. 406 // Invalidate all resources of this client if our layout changed.
407 if (everHadLayout() && selfNeedsLayout()) 407 if (everHadLayout() && selfNeedsLayout())
408 SVGResourcesCache::clientLayoutChanged(this); 408 SVGResourcesCache::clientLayoutChanged(this);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 496
497 ASSERT(node()); 497 ASSERT(node());
498 ASSERT(node()->isSVGElement()); 498 ASSERT(node()->isSVGElement());
499 SVGLengthContext lengthContext(toSVGElement(node())); 499 SVGLengthContext lengthContext(toSVGElement(node()));
500 strokeBoundaries.inflate(svgStyle.strokeWidth()->value(lengthContext)); 500 strokeBoundaries.inflate(svgStyle.strokeWidth()->value(lengthContext));
501 return strokeBoundaries; 501 return strokeBoundaries;
502 } 502 }
503 503
504 FloatRect RenderSVGText::paintInvalidationRectInLocalCoordinates() const 504 FloatRect RenderSVGText::paintInvalidationRectInLocalCoordinates() const
505 { 505 {
506 FloatRect repaintRect = strokeBoundingBox(); 506 FloatRect paintInvalidationRect = strokeBoundingBox();
507 SVGRenderSupport::intersectRepaintRectWithResources(this, repaintRect); 507 SVGRenderSupport::intersectPaintInvalidationRectWithResources(this, paintInv alidationRect);
508 508
509 if (const ShadowList* textShadow = style()->textShadow()) 509 if (const ShadowList* textShadow = style()->textShadow())
510 textShadow->adjustRectForShadow(repaintRect); 510 textShadow->adjustRectForShadow(paintInvalidationRect);
511 511
512 return repaintRect; 512 return paintInvalidationRect;
513 } 513 }
514 514
515 void RenderSVGText::addChild(RenderObject* child, RenderObject* beforeChild) 515 void RenderSVGText::addChild(RenderObject* child, RenderObject* beforeChild)
516 { 516 {
517 RenderSVGBlock::addChild(child, beforeChild); 517 RenderSVGBlock::addChild(child, beforeChild);
518 518
519 SVGResourcesCache::clientWasAddedToTree(child, child->style()); 519 SVGResourcesCache::clientWasAddedToTree(child, child->style());
520 subtreeChildWasAdded(child); 520 subtreeChildWasAdded(child);
521 } 521 }
522 522
523 void RenderSVGText::removeChild(RenderObject* child) 523 void RenderSVGText::removeChild(RenderObject* child)
524 { 524 {
525 SVGResourcesCache::clientWillBeRemovedFromTree(child); 525 SVGResourcesCache::clientWillBeRemovedFromTree(child);
526 526
527 Vector<SVGTextLayoutAttributes*, 2> affectedAttributes; 527 Vector<SVGTextLayoutAttributes*, 2> affectedAttributes;
528 FontCachePurgePreventer fontCachePurgePreventer; 528 FontCachePurgePreventer fontCachePurgePreventer;
529 subtreeChildWillBeRemoved(child, affectedAttributes); 529 subtreeChildWillBeRemoved(child, affectedAttributes);
530 RenderSVGBlock::removeChild(child); 530 RenderSVGBlock::removeChild(child);
531 subtreeChildWasRemoved(affectedAttributes); 531 subtreeChildWasRemoved(affectedAttributes);
532 } 532 }
533 533
534 } 534 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGShape.cpp ('k') | Source/core/rendering/svg/SVGRenderSupport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698