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

Unified Diff: Source/core/layout/svg/SVGTextChunk.h

Issue 1162653002: Drop SVGTextChunk::m_boxes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Pass reference. Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/layout/svg/SVGTextChunk.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/svg/SVGTextChunk.h
diff --git a/Source/core/layout/svg/SVGTextChunk.h b/Source/core/layout/svg/SVGTextChunk.h
index 2c6d7f1e3a7ad10d02d65f3af52a31dd810f8051..f34e96e413a41809efb32e77f419174bceb5762a 100644
--- a/Source/core/layout/svg/SVGTextChunk.h
+++ b/Source/core/layout/svg/SVGTextChunk.h
@@ -20,13 +20,9 @@
#ifndef SVGTextChunk_h
#define SVGTextChunk_h
-#include "wtf/Vector.h"
-
namespace blink {
-class SVGInlineTextBox;
-
-// A SVGTextChunk describes a range of SVGTextFragments, see the SVG spec definition of a "text chunk".
+// A SVGTextChunk contains properties for a range of SVGTextFragments, see the SVG spec definition of a "text chunk".
class SVGTextChunk {
public:
enum ChunkStyle {
@@ -39,26 +35,23 @@ public:
LengthAdjustSpacingAndGlyphs = 1 << 6
};
- SVGTextChunk(unsigned chunkStyle, float desiredTextLength);
+ SVGTextChunk(unsigned chunkStyle, float desiredTextLength)
+ : m_chunkStyle(chunkStyle)
+ , m_desiredTextLength(desiredTextLength)
+ {
+ }
- void calculateLength(float& length, unsigned& characters) const;
float calculateTextAnchorShift(float length) const;
bool isVerticalText() const { return m_chunkStyle & VerticalText; }
float desiredTextLength() const { return m_desiredTextLength; }
- Vector<SVGInlineTextBox*>& boxes() { return m_boxes; }
- const Vector<SVGInlineTextBox*>& boxes() const { return m_boxes; }
-
bool hasDesiredTextLength() const { return m_desiredTextLength > 0 && ((m_chunkStyle & LengthAdjustSpacing) || (m_chunkStyle & LengthAdjustSpacingAndGlyphs)); }
bool hasTextAnchor() const { return m_chunkStyle & RightToLeftText ? !(m_chunkStyle & EndAnchor) : (m_chunkStyle & MiddleAnchor) || (m_chunkStyle & EndAnchor); }
bool hasLengthAdjustSpacing() const { return m_chunkStyle & LengthAdjustSpacing; }
bool hasLengthAdjustSpacingAndGlyphs() const { return m_chunkStyle & LengthAdjustSpacingAndGlyphs; }
private:
- // Contains all SVGInlineTextBoxes this chunk spans.
- Vector<SVGInlineTextBox*> m_boxes;
-
unsigned m_chunkStyle;
float m_desiredTextLength;
};
« no previous file with comments | « no previous file | Source/core/layout/svg/SVGTextChunk.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698