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 27 matching lines...) Expand all Loading... |
38 , m_layoutAttributesPosition(0) | 38 , m_layoutAttributesPosition(0) |
39 , m_logicalCharacterOffset(0) | 39 , m_logicalCharacterOffset(0) |
40 , m_logicalMetricsListOffset(0) | 40 , m_logicalMetricsListOffset(0) |
41 , m_x(0) | 41 , m_x(0) |
42 , m_y(0) | 42 , m_y(0) |
43 , m_dx(0) | 43 , m_dx(0) |
44 , m_dy(0) | 44 , m_dy(0) |
45 , m_isVerticalText(false) | 45 , m_isVerticalText(false) |
46 , m_inPathLayout(false) | 46 , m_inPathLayout(false) |
47 , m_textLengthSpacingInEffect(false) | 47 , m_textLengthSpacingInEffect(false) |
48 , m_textPathCalculator(0) | 48 , m_textPathCalculator(nullptr) |
49 , m_textPathLength(0) | 49 , m_textPathLength(0) |
50 , m_textPathCurrentOffset(0) | 50 , m_textPathCurrentOffset(0) |
51 , m_textPathSpacing(0) | 51 , m_textPathSpacing(0) |
52 , m_textPathScaling(1) | 52 , m_textPathScaling(1) |
53 { | 53 { |
54 ASSERT(!m_layoutAttributes.isEmpty()); | 54 ASSERT(!m_layoutAttributes.isEmpty()); |
55 } | 55 } |
56 | 56 |
57 void SVGTextLayoutEngine::updateCharacterPositionIfNeeded(float& x, float& y) | 57 void SVGTextLayoutEngine::updateCharacterPositionIfNeeded(float& x, float& y) |
58 { | 58 { |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 | 353 |
354 // Main layout algorithm. | 354 // Main layout algorithm. |
355 const unsigned boxEndOffset = textBox->start() + textBox->len(); | 355 const unsigned boxEndOffset = textBox->start() + textBox->len(); |
356 while (!m_visualMetricsIterator.isAtEnd() && m_visualMetricsIterator.charact
erOffset() < boxEndOffset) { | 356 while (!m_visualMetricsIterator.isAtEnd() && m_visualMetricsIterator.charact
erOffset() < boxEndOffset) { |
357 const SVGTextMetrics& visualMetrics = m_visualMetricsIterator.metrics(); | 357 const SVGTextMetrics& visualMetrics = m_visualMetricsIterator.metrics(); |
358 if (visualMetrics.isEmpty()) { | 358 if (visualMetrics.isEmpty()) { |
359 m_visualMetricsIterator.next(); | 359 m_visualMetricsIterator.next(); |
360 continue; | 360 continue; |
361 } | 361 } |
362 | 362 |
363 SVGTextLayoutAttributes* logicalAttributes = 0; | 363 SVGTextLayoutAttributes* logicalAttributes = nullptr; |
364 if (!currentLogicalCharacterAttributes(logicalAttributes)) | 364 if (!currentLogicalCharacterAttributes(logicalAttributes)) |
365 break; | 365 break; |
366 | 366 |
367 ASSERT(logicalAttributes); | 367 ASSERT(logicalAttributes); |
368 SVGTextMetrics logicalMetrics(SVGTextMetrics::SkippedSpaceMetrics); | 368 SVGTextMetrics logicalMetrics(SVGTextMetrics::SkippedSpaceMetrics); |
369 if (!currentLogicalCharacterMetrics(logicalAttributes, logicalMetrics)) | 369 if (!currentLogicalCharacterMetrics(logicalAttributes, logicalMetrics)) |
370 break; | 370 break; |
371 | 371 |
372 SVGCharacterDataMap& characterDataMap = logicalAttributes->characterData
Map(); | 372 SVGCharacterDataMap& characterDataMap = logicalAttributes->characterData
Map(); |
373 SVGCharacterData data; | 373 SVGCharacterData data; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 } | 532 } |
533 | 533 |
534 if (!didStartTextFragment) | 534 if (!didStartTextFragment) |
535 return; | 535 return; |
536 | 536 |
537 // Close last open fragment, if needed. | 537 // Close last open fragment, if needed. |
538 recordTextFragment(textBox); | 538 recordTextFragment(textBox); |
539 } | 539 } |
540 | 540 |
541 } | 541 } |
OLD | NEW |