| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 switch (svgStyle.baselineShift()) { | 43 switch (svgStyle.baselineShift()) { |
| 44 case BS_LENGTH: | 44 case BS_LENGTH: |
| 45 return SVGLengthContext::valueForLength( | 45 return SVGLengthContext::valueForLength( |
| 46 svgStyle.baselineShiftValue(), style, | 46 svgStyle.baselineShiftValue(), style, |
| 47 m_font.getFontDescription().computedPixelSize() / m_effectiveZoom); | 47 m_font.getFontDescription().computedPixelSize() / m_effectiveZoom); |
| 48 case BS_SUB: | 48 case BS_SUB: |
| 49 return -fontData->getFontMetrics().floatHeight() / 2 / m_effectiveZoom; | 49 return -fontData->getFontMetrics().floatHeight() / 2 / m_effectiveZoom; |
| 50 case BS_SUPER: | 50 case BS_SUPER: |
| 51 return fontData->getFontMetrics().floatHeight() / 2 / m_effectiveZoom; | 51 return fontData->getFontMetrics().floatHeight() / 2 / m_effectiveZoom; |
| 52 default: | 52 default: |
| 53 ASSERT_NOT_REACHED(); | 53 NOTREACHED(); |
| 54 return 0; | 54 return 0; |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 | 57 |
| 58 EAlignmentBaseline | 58 EAlignmentBaseline |
| 59 SVGTextLayoutEngineBaseline::dominantBaselineToAlignmentBaseline( | 59 SVGTextLayoutEngineBaseline::dominantBaselineToAlignmentBaseline( |
| 60 bool isVerticalText, | 60 bool isVerticalText, |
| 61 LineLayoutItem textLineLayout) const { | 61 LineLayoutItem textLineLayout) const { |
| 62 ASSERT(textLineLayout); | 62 ASSERT(textLineLayout); |
| 63 ASSERT(textLineLayout.style()); | 63 ASSERT(textLineLayout.style()); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 return AB_MATHEMATICAL; | 96 return AB_MATHEMATICAL; |
| 97 case DB_CENTRAL: | 97 case DB_CENTRAL: |
| 98 return AB_CENTRAL; | 98 return AB_CENTRAL; |
| 99 case DB_MIDDLE: | 99 case DB_MIDDLE: |
| 100 return AB_MIDDLE; | 100 return AB_MIDDLE; |
| 101 case DB_TEXT_AFTER_EDGE: | 101 case DB_TEXT_AFTER_EDGE: |
| 102 return AB_TEXT_AFTER_EDGE; | 102 return AB_TEXT_AFTER_EDGE; |
| 103 case DB_TEXT_BEFORE_EDGE: | 103 case DB_TEXT_BEFORE_EDGE: |
| 104 return AB_TEXT_BEFORE_EDGE; | 104 return AB_TEXT_BEFORE_EDGE; |
| 105 default: | 105 default: |
| 106 ASSERT_NOT_REACHED(); | 106 NOTREACHED(); |
| 107 return AB_AUTO; | 107 return AB_AUTO; |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 | 110 |
| 111 float SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift( | 111 float SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift( |
| 112 bool isVerticalText, | 112 bool isVerticalText, |
| 113 LineLayoutItem textLineLayout) const { | 113 LineLayoutItem textLineLayout) const { |
| 114 ASSERT(textLineLayout); | 114 ASSERT(textLineLayout); |
| 115 ASSERT(textLineLayout.style()); | 115 ASSERT(textLineLayout.style()); |
| 116 ASSERT(textLineLayout.parent()); | 116 ASSERT(textLineLayout.parent()); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 case AB_IDEOGRAPHIC: | 150 case AB_IDEOGRAPHIC: |
| 151 return -descent; | 151 return -descent; |
| 152 case AB_ALPHABETIC: | 152 case AB_ALPHABETIC: |
| 153 return 0; | 153 return 0; |
| 154 case AB_HANGING: | 154 case AB_HANGING: |
| 155 return ascent * 8 / 10.f; | 155 return ascent * 8 / 10.f; |
| 156 case AB_MATHEMATICAL: | 156 case AB_MATHEMATICAL: |
| 157 return ascent / 2; | 157 return ascent / 2; |
| 158 case AB_BASELINE: | 158 case AB_BASELINE: |
| 159 default: | 159 default: |
| 160 ASSERT_NOT_REACHED(); | 160 NOTREACHED(); |
| 161 return 0; | 161 return 0; |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 | 164 |
| 165 } // namespace blink | 165 } // namespace blink |
| OLD | NEW |