Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 | 42 |
| 43 static SVGTextMetrics measureCharacterRange(LineLayoutSVGInlineText, unsigne d position, unsigned length, TextDirection); | 43 static SVGTextMetrics measureCharacterRange(LineLayoutSVGInlineText, unsigne d position, unsigned length, TextDirection); |
| 44 static TextRun constructTextRun(LineLayoutSVGInlineText, unsigned position, unsigned length, TextDirection); | 44 static TextRun constructTextRun(LineLayoutSVGInlineText, unsigned position, unsigned length, TextDirection); |
| 45 | 45 |
| 46 bool isEmpty() const { return !m_width && !m_height && m_length <= 1; } | 46 bool isEmpty() const { return !m_width && !m_height && m_length <= 1; } |
| 47 | 47 |
| 48 float width() const { return m_width; } | 48 float width() const { return m_width; } |
| 49 void setWidth(float width) { m_width = width; } | 49 void setWidth(float width) { m_width = width; } |
| 50 | 50 |
| 51 float height() const { return m_height; } | 51 float height() const { return m_height; } |
| 52 | |
| 52 // TODO(kojii): We should store logical width (advance) and height instead | 53 // TODO(kojii): We should store logical width (advance) and height instead |
| 53 // of storing physical and calculate logical. crbug.com/544767 | 54 // of storing physical and calculate logical. crbug.com/544767 |
| 54 float advance(FontOrientation) const; | 55 float advance(FontOrientation) const; |
| 55 unsigned length() const { return m_length; } | 56 unsigned length() const { return m_length; } |
| 56 | |
|
fs
2015/12/14 09:59:31
Nit: I like the new blank line, but I think I'd li
pdr.
2015/12/16 04:27:45
Sigh, I was going to use this one in a followup pa
| |
| 57 private: | 57 private: |
| 58 SVGTextMetrics(LineLayoutSVGInlineText, const TextRun&); | 58 SVGTextMetrics(LineLayoutSVGInlineText, const TextRun&); |
| 59 | 59 |
| 60 float m_width; | 60 float m_width; |
| 61 float m_height; | 61 float m_height; |
| 62 unsigned m_length; | 62 unsigned m_length; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace blink | 65 } // namespace blink |
| 66 | 66 |
| 67 #endif | 67 #endif |
| OLD | NEW |