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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.h

Issue 1854123002: Rebuild layout attributes on layout instead of on layout tree updates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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) Research In Motion Limited 2010-2012. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 29 matching lines...) Expand all
40 // The first layout phase only extracts the relevant information needed in Layou tBlockFlowLine 40 // The first layout phase only extracts the relevant information needed in Layou tBlockFlowLine
41 // to create the InlineBox tree based on text chunk boundaries & BiDi informatio n. 41 // to create the InlineBox tree based on text chunk boundaries & BiDi informatio n.
42 // The second layout phase is carried out by SVGTextLayoutEngine. 42 // The second layout phase is carried out by SVGTextLayoutEngine.
43 43
44 class SVGTextLayoutAttributesBuilder { 44 class SVGTextLayoutAttributesBuilder {
45 DISALLOW_NEW(); 45 DISALLOW_NEW();
46 WTF_MAKE_NONCOPYABLE(SVGTextLayoutAttributesBuilder); 46 WTF_MAKE_NONCOPYABLE(SVGTextLayoutAttributesBuilder);
47 public: 47 public:
48 SVGTextLayoutAttributesBuilder(); 48 SVGTextLayoutAttributesBuilder();
49 bool buildLayoutAttributesForForSubtree(LayoutSVGText&); 49 bool buildLayoutAttributesForForSubtree(LayoutSVGText&);
50 void buildLayoutAttributesForText(LayoutSVGInlineText*);
51 50
52 void rebuildMetricsForTextLayoutObject(LayoutSVGInlineText*); 51 void rebuildMetricsForTextLayoutObject(LayoutSVGText&, LayoutSVGInlineText&) ;
53 52
54 // Invoked whenever the underlying DOM tree changes, so that m_textPositions is rebuild. 53 // Invoked whenever the underlying DOM tree changes, so that m_textPositions is rebuild.
55 void clearTextPositioningElements() { m_textPositions.clear(); } 54 void clearTextPositioningElements() { m_textPositions.clear(); }
56 unsigned numberOfTextPositioningElements() const { return m_textPositions.si ze(); } 55 unsigned numberOfTextPositioningElements() const { return m_textPositions.si ze(); }
57 56
58 struct TextPosition { 57 struct TextPosition {
59 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); 58 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
60 public: 59 public:
61 TextPosition(SVGTextPositioningElement* newElement = nullptr, unsigned n ewStart = 0, unsigned newLength = 0) 60 TextPosition(SVGTextPositioningElement* newElement = nullptr, unsigned n ewStart = 0, unsigned newLength = 0)
62 : element(newElement) 61 : element(newElement)
(...skipping 18 matching lines...) Expand all
81 unsigned m_textLength; 80 unsigned m_textLength;
82 PersistentHeapVector<TextPosition> m_textPositions; 81 PersistentHeapVector<TextPosition> m_textPositions;
83 SVGCharacterDataMap m_characterDataMap; 82 SVGCharacterDataMap m_characterDataMap;
84 }; 83 };
85 84
86 } // namespace blink 85 } // namespace blink
87 86
88 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::SVGTextLayoutAttributesBuilder ::TextPosition); 87 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::SVGTextLayoutAttributesBuilder ::TextPosition);
89 88
90 #endif 89 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698