| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 gc->setCTM(savedMatrix); | 146 gc->setCTM(savedMatrix); |
| 147 return; | 147 return; |
| 148 } | 148 } |
| 149 | 149 |
| 150 // FIXME: text rendering speed: | 150 // FIXME: text rendering speed: |
| 151 // Android has code in their WebCore fork to special case when the | 151 // Android has code in their WebCore fork to special case when the |
| 152 // GlyphBuffer has no advances other than the defaults. In that case the | 152 // GlyphBuffer has no advances other than the defaults. In that case the |
| 153 // text drawing can proceed faster. However, it's unclear when those | 153 // text drawing can proceed faster. However, it's unclear when those |
| 154 // patches may be upstreamed to WebKit so we always use the slower path | 154 // patches may be upstreamed to WebKit so we always use the slower path |
| 155 // here. | 155 // here. |
| 156 const GlyphBufferAdvance* adv = glyphBuffer.advances(from); | 156 const FloatSize* adv = glyphBuffer.advances(from); |
| 157 for (unsigned i = 0; i < numGlyphs; i++) { | 157 for (unsigned i = 0; i < numGlyphs; i++) { |
| 158 pos[i].set(x, y); | 158 pos[i].set(x, y); |
| 159 x += SkFloatToScalar(adv[i].width()); | 159 x += SkFloatToScalar(adv[i].width()); |
| 160 y += SkFloatToScalar(adv[i].height()); | 160 y += SkFloatToScalar(adv[i].height()); |
| 161 } | 161 } |
| 162 | 162 |
| 163 const Glyph* glyphs = glyphBuffer.glyphs(from); | 163 const Glyph* glyphs = glyphBuffer.glyphs(from); |
| 164 paintGlyphs(gc, font, glyphs, numGlyphs, pos, textRect); | 164 paintGlyphs(gc, font, glyphs, numGlyphs, pos, textRect); |
| 165 } | 165 } |
| 166 | 166 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 const FloatPoint& point, int height, | 236 const FloatPoint& point, int height, |
| 237 int from, int to) const | 237 int from, int to) const |
| 238 { | 238 { |
| 239 HarfBuzzShaper shaper(this, run); | 239 HarfBuzzShaper shaper(this, run); |
| 240 if (!shaper.shape()) | 240 if (!shaper.shape()) |
| 241 return FloatRect(); | 241 return FloatRect(); |
| 242 return shaper.selectionRect(point, height, from, to); | 242 return shaper.selectionRect(point, height, from, to); |
| 243 } | 243 } |
| 244 | 244 |
| 245 } // namespace WebCore | 245 } // namespace WebCore |
| OLD | NEW |