| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 return; | 107 return; |
| 108 } | 108 } |
| 109 | 109 |
| 110 m_dx = dx; | 110 m_dx = dx; |
| 111 m_dy = dy; | 111 m_dy = dy; |
| 112 } | 112 } |
| 113 | 113 |
| 114 static void computeGlyphOverflow(SVGInlineTextBox* textBox, SVGTextFragment& tex
tFragment) | 114 static void computeGlyphOverflow(SVGInlineTextBox* textBox, SVGTextFragment& tex
tFragment) |
| 115 { | 115 { |
| 116 LineLayoutSVGInlineText textLineLayout = LineLayoutSVGInlineText(textBox->ge
tLineLayoutItem()); | 116 LineLayoutSVGInlineText textLineLayout = LineLayoutSVGInlineText(textBox->ge
tLineLayoutItem()); |
| 117 TextRun run = SVGTextMetrics::constructTextRun(textLineLayout, textFragment.
characterOffset, textFragment.length, textLineLayout.styleRef().direction()); | 117 TextRun run = textBox->constructTextRun(textLineLayout.styleRef(), textFragm
ent); |
| 118 | 118 |
| 119 float scalingFactor = textLineLayout.scalingFactor(); | 119 float scalingFactor = textLineLayout.scalingFactor(); |
| 120 ASSERT(scalingFactor); | 120 ASSERT(scalingFactor); |
| 121 const Font& scaledFont = textLineLayout.scaledFont(); | 121 const Font& scaledFont = textLineLayout.scaledFont(); |
| 122 FloatRect glyphOverflowBounds; | 122 FloatRect glyphOverflowBounds; |
| 123 | 123 |
| 124 float width = scaledFont.width(run, nullptr, &glyphOverflowBounds); | 124 float width = scaledFont.width(run, nullptr, &glyphOverflowBounds); |
| 125 float ascent = scaledFont.getFontMetrics().floatAscent(); | 125 float ascent = scaledFont.getFontMetrics().floatAscent(); |
| 126 float descent = scaledFont.getFontMetrics().floatDescent(); | 126 float descent = scaledFont.getFontMetrics().floatDescent(); |
| 127 textFragment.glyphOverflow.setFromBounds(glyphOverflowBounds, ascent, descen
t, width); | 127 textFragment.glyphOverflow.setFromBounds(glyphOverflowBounds, ascent, descen
t, width); |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 } | 548 } |
| 549 | 549 |
| 550 if (!didStartTextFragment) | 550 if (!didStartTextFragment) |
| 551 return; | 551 return; |
| 552 | 552 |
| 553 // Close last open fragment, if needed. | 553 // Close last open fragment, if needed. |
| 554 recordTextFragment(textBox); | 554 recordTextFragment(textBox); |
| 555 } | 555 } |
| 556 | 556 |
| 557 } // namespace blink | 557 } // namespace blink |
| OLD | NEW |