| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2007, 2008, 2010 Google Inc. All rights reserved. | 2 * Copyright (c) 2007, 2008, 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 verticalData->getVerticalTranslationsForGlyphs(font, &glyphs[0], chu
nkLength, reinterpret_cast<float*>(&translations[0])); | 129 verticalData->getVerticalTranslationsForGlyphs(font, &glyphs[0], chu
nkLength, reinterpret_cast<float*>(&translations[0])); |
| 130 | 130 |
| 131 x = verticalOriginX; | 131 x = verticalOriginX; |
| 132 y = SkFloatToScalar(point.y() + horizontalOffset - point.x()); | 132 y = SkFloatToScalar(point.y() + horizontalOffset - point.x()); |
| 133 | 133 |
| 134 float currentWidth = 0; | 134 float currentWidth = 0; |
| 135 for (unsigned i = 0; i < chunkLength; ++i, ++glyphIndex) { | 135 for (unsigned i = 0; i < chunkLength; ++i, ++glyphIndex) { |
| 136 pos[i].set( | 136 pos[i].set( |
| 137 x + SkIntToScalar(lroundf(translations[i].x())), | 137 x + SkIntToScalar(lroundf(translations[i].x())), |
| 138 y + -SkIntToScalar(-lroundf(currentWidth - translations[i].y
()))); | 138 y + -SkIntToScalar(-lroundf(currentWidth - translations[i].y
()))); |
| 139 currentWidth += glyphBuffer.advanceAt(from + glyphIndex); | 139 currentWidth += glyphBuffer.advanceAt(from + glyphIndex).width()
; |
| 140 } | 140 } |
| 141 horizontalOffset += currentWidth; | 141 horizontalOffset += currentWidth; |
| 142 paintGlyphs(gc, font, glyphs, chunkLength, pos, textRect); | 142 paintGlyphs(gc, font, glyphs, chunkLength, pos, textRect); |
| 143 } | 143 } |
| 144 | 144 |
| 145 gc->setCTM(savedMatrix); | 145 gc->setCTM(savedMatrix); |
| 146 return; | 146 return; |
| 147 } | 147 } |
| 148 | 148 |
| 149 // FIXME: text rendering speed: | 149 // FIXME: text rendering speed: |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 const FloatPoint& point, int height, | 229 const FloatPoint& point, int height, |
| 230 int from, int to) const | 230 int from, int to) const |
| 231 { | 231 { |
| 232 HarfBuzzShaper shaper(this, run); | 232 HarfBuzzShaper shaper(this, run); |
| 233 if (!shaper.shape()) | 233 if (!shaper.shape()) |
| 234 return FloatRect(); | 234 return FloatRect(); |
| 235 return shaper.selectionRect(point, height, from, to); | 235 return shaper.selectionRect(point, height, from, to); |
| 236 } | 236 } |
| 237 | 237 |
| 238 } // namespace WebCore | 238 } // namespace WebCore |
| OLD | NEW |