| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2011 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 paint->setVerticalText(platformData.orientation() == Vertical); | 65 paint->setVerticalText(platformData.orientation() == Vertical); |
| 66 paint->setTypeface(platformData.typeface()); | 66 paint->setTypeface(platformData.typeface()); |
| 67 paint->setFakeBoldText(platformData.m_syntheticBold); | 67 paint->setFakeBoldText(platformData.m_syntheticBold); |
| 68 paint->setTextSkewX(platformData.m_syntheticOblique ? -SK_Scalar1 / 4 : 0); | 68 paint->setTextSkewX(platformData.m_syntheticOblique ? -SK_Scalar1 / 4 : 0); |
| 69 paint->setAutohinted(false); // freetype specific | 69 paint->setAutohinted(false); // freetype specific |
| 70 paint->setLCDRenderText(shouldSmoothFonts); | 70 paint->setLCDRenderText(shouldSmoothFonts); |
| 71 paint->setSubpixelText(true); | 71 paint->setSubpixelText(true); |
| 72 | 72 |
| 73 // When using CoreGraphics, disable hinting when webkit-font-smoothing:antia
liased is used. | 73 // When using CoreGraphics, disable hinting when webkit-font-smoothing:antia
liased is used. |
| 74 // See crbug.com/152304 | 74 // See crbug.com/152304 |
| 75 if (font->fontDescription().fontSmoothing() == Antialiased || font->fontDesc
ription().textRenderingMode() == GeometricPrecision) | 75 if (font->fontDescription().fontSmoothing() == Antialiased || font->fontDesc
ription().textRendering() == GeometricPrecision) |
| 76 paint->setHinting(SkPaint::kNo_Hinting); | 76 paint->setHinting(SkPaint::kNo_Hinting); |
| 77 } | 77 } |
| 78 | 78 |
| 79 // TODO: This needs to be split into helper functions to better scope the | 79 // TODO: This needs to be split into helper functions to better scope the |
| 80 // inputs/outputs, and reduce duplicate code. | 80 // inputs/outputs, and reduce duplicate code. |
| 81 // This issue is tracked in https://bugs.webkit.org/show_bug.cgi?id=62989 | 81 // This issue is tracked in https://bugs.webkit.org/show_bug.cgi?id=62989 |
| 82 void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font, | 82 void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font, |
| 83 const GlyphBuffer& glyphBuffer, unsigned from, unsigned numGlyphs, | 83 const GlyphBuffer& glyphBuffer, unsigned from, unsigned numGlyphs, |
| 84 const FloatPoint& point, const FloatRect& textRect) const | 84 const FloatPoint& point, const FloatRect& textRect) const |
| 85 { | 85 { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 paint.setLooper(0); | 167 paint.setLooper(0); |
| 168 } | 168 } |
| 169 | 169 |
| 170 gc->drawPosText(glyphs, numGlyphs * sizeof(uint16_t), pos, textRect, pai
nt); | 170 gc->drawPosText(glyphs, numGlyphs * sizeof(uint16_t), pos, textRect, pai
nt); |
| 171 } | 171 } |
| 172 if (font->platformData().orientation() == Vertical) | 172 if (font->platformData().orientation() == Vertical) |
| 173 gc->restore(); | 173 gc->restore(); |
| 174 } | 174 } |
| 175 | 175 |
| 176 } // namespace WebCore | 176 } // namespace WebCore |
| OLD | NEW |