| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 && gc->strokeStyle() != NoStroke | 78 && gc->strokeStyle() != NoStroke |
| 79 && gc->strokeThickness() > 0) { | 79 && gc->strokeThickness() > 0) { |
| 80 | 80 |
| 81 SkPaint paint; | 81 SkPaint paint; |
| 82 gc->setupPaintForStroking(&paint); | 82 gc->setupPaintForStroking(&paint); |
| 83 font->platformData().setupPaint(&paint, gc); | 83 font->platformData().setupPaint(&paint, gc); |
| 84 gc->adjustTextRenderMode(&paint); | 84 gc->adjustTextRenderMode(&paint); |
| 85 paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); | 85 paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); |
| 86 | 86 |
| 87 if (textMode & TextModeFill) { | 87 if (textMode & TextModeFill) { |
| 88 // If we also filled, we don't want to draw shadows twice. | 88 // If there is a shadow and we filled above, there will already be |
| 89 // See comment in FontChromiumWin.cpp::paintSkiaText() for more deta
ils. | 89 // a shadow. We don't want to draw it again or it will be too dark |
| 90 // Since we use the looper for shadows, we remove it (if any) now. | 90 // and it will go on top of the fill. |
| 91 // |
| 92 // Note that this isn't strictly correct, since the stroke could be |
| 93 // very thick and the shadow wouldn't account for this. The "right" |
| 94 // thing would be to draw to a new layer and then draw that layer |
| 95 // with a shadow. But this is a lot of extra work for something |
| 96 // that isn't normally an issue. |
| 91 paint.setLooper(0); | 97 paint.setLooper(0); |
| 92 } | 98 } |
| 93 | 99 |
| 94 gc->drawPosText(glyphs, numGlyphs << 1, pos, textRect, paint); | 100 gc->drawPosText(glyphs, numGlyphs << 1, pos, textRect, paint); |
| 95 } | 101 } |
| 96 } | 102 } |
| 97 | 103 |
| 98 void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font, | 104 void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font, |
| 99 const GlyphBuffer& glyphBuffer, unsigned from, unsigned numGlyphs, | 105 const GlyphBuffer& glyphBuffer, unsigned from, unsigned numGlyphs, |
| 100 const FloatPoint& point, const FloatRect& textRect) const | 106 const FloatPoint& point, const FloatRect& textRect) const |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 const FloatPoint& point, int height, | 242 const FloatPoint& point, int height, |
| 237 int from, int to) const | 243 int from, int to) const |
| 238 { | 244 { |
| 239 HarfBuzzShaper shaper(this, run); | 245 HarfBuzzShaper shaper(this, run); |
| 240 if (!shaper.shape()) | 246 if (!shaper.shape()) |
| 241 return FloatRect(); | 247 return FloatRect(); |
| 242 return shaper.selectionRect(point, height, from, to); | 248 return shaper.selectionRect(point, height, from, to); |
| 243 } | 249 } |
| 244 | 250 |
| 245 } // namespace WebCore | 251 } // namespace WebCore |
| OLD | NEW |