Chromium Code Reviews| Index: Source/platform/text/TextRun.h |
| diff --git a/Source/platform/text/TextRun.h b/Source/platform/text/TextRun.h |
| index d5f6be43cf44bf269d5c09084f216684d87fb4bd..92d22f3f49b317cdbb884b8234d19504ede153a8 100644 |
| --- a/Source/platform/text/TextRun.h |
| +++ b/Source/platform/text/TextRun.h |
| @@ -42,6 +42,13 @@ class SimpleFontData; |
| struct GlyphData; |
| struct WidthIterator; |
| +enum ETextJustify { |
| + JustifyAuto = 0, |
| + JustifyNone = 1, |
| + JustifyInterWord = 2, |
| + JustifyDistribute = 3 |
| +}; |
| + |
| class PLATFORM_EXPORT TextRun { |
| WTF_MAKE_FAST_ALLOCATED; |
| public: |
| @@ -68,6 +75,7 @@ public: |
| , m_characterScanForCodePath(characterScanForCodePath) |
| , m_disableSpacing(false) |
| , m_tabSize(0) |
| + , m_textJustify(JustifyAuto) |
| { |
| m_data.characters8 = c; |
| } |
| @@ -86,6 +94,7 @@ public: |
| , m_characterScanForCodePath(characterScanForCodePath) |
| , m_disableSpacing(false) |
| , m_tabSize(0) |
| + , m_textJustify(JustifyAuto) |
| { |
| m_data.characters16 = c; |
| } |
| @@ -103,6 +112,7 @@ public: |
| , m_characterScanForCodePath(characterScanForCodePath) |
| , m_disableSpacing(false) |
| , m_tabSize(0) |
| + , m_textJustify(JustifyAuto) |
| { |
| if (!m_charactersLength) { |
| m_is8Bit = true; |
| @@ -129,6 +139,7 @@ public: |
| , m_characterScanForCodePath(characterScanForCodePath) |
| , m_disableSpacing(false) |
| , m_tabSize(0) |
| + , m_textJustify(JustifyAuto) |
| { |
| if (!m_charactersLength) { |
| m_is8Bit = true; |
| @@ -196,6 +207,9 @@ public: |
| void setDirectionalOverride(bool override) { m_directionalOverride = override; } |
| void setCharacterScanForCodePath(bool scan) { m_characterScanForCodePath = scan; } |
| + void setTextJustify(ETextJustify textJustify) { m_textJustify = textJustify; } |
| + ETextJustify textJustify() const { return m_textJustify; } |
| + |
| class RenderingContext : public RefCounted<RenderingContext> { |
| public: |
| virtual ~RenderingContext() { } |
| @@ -232,6 +246,7 @@ private: |
| unsigned m_disableSpacing : 1; |
| unsigned m_tabSize; |
| RefPtr<RenderingContext> m_renderingContext; |
| + ETextJustify m_textJustify; |
|
leviw_travelin_and_unemployed
2014/08/11 17:34:46
You'll want to pack this into the bits above (ther
dw.im
2014/08/12 02:47:09
Done.
|
| }; |
| inline void TextRun::setTabSize(bool allow, unsigned size) |