Changeset 96366 in webkit
- Timestamp:
- Sep 29, 2011 3:21:00 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r96365 r96366 1 2011-09-29 Cary Clark <caryclark@google.com> 2 3 Enable LCD text in Skia on Mac 4 https://bugs.webkit.org/show_bug.cgi?id=68734 5 6 Reviewed by Stephen White. 7 8 No new tests. Existing layout tests are generated 9 with LCD text disabled for pixel comparisons. 10 11 Duplicate the logic in FontMac.mm to pass settings 12 for antialiasing and smoothing. Also disable smoothing 13 for DumpRenderTree. 14 15 * platform/graphics/skia/FontSkia.cpp: 16 (WebCore::setupPaint): 17 (WebCore::Font::drawGlyphs): 18 1 19 2011-09-29 Varun Jain <varunjain@google.com> 2 20 -
trunk/Source/WebCore/platform/graphics/skia/FontSkia.cpp
r95901 r96366 35 35 #include "GraphicsContext.h" 36 36 #include "PlatformContextSkia.h" 37 #include "PlatformSupport.h" 37 38 #include "SimpleFontData.h" 38 39 … … 74 75 } 75 76 76 static void setupPaint(SkPaint* paint, const SimpleFontData* fontData, const Font* font )77 static void setupPaint(SkPaint* paint, const SimpleFontData* fontData, const Font* font, bool shouldAntialias, bool shouldSmoothFonts) 77 78 { 78 79 const FontPlatformData& platformData = fontData->platformData(); 79 80 const float textSize = platformData.m_size >= 0 ? platformData.m_size : 12; 80 81 81 paint->setAntiAlias( true);82 paint->setAntiAlias(shouldAntialias); 82 83 paint->setEmbeddedBitmapText(false); 83 84 paint->setTextSize(SkFloatToScalar(textSize)); … … 88 89 paint->setTextSkewX(platformData.m_syntheticOblique ? -SK_Scalar1 / 4 : 0); 89 90 paint->setAutohinted(false); // freetype specific 90 paint->setLCDRenderText( font->fontDescription().fontSmoothing() == SubpixelAntialiased);91 paint->setLCDRenderText(shouldSmoothFonts); 91 92 } 92 93 … … 98 99 const FloatPoint& point) const { 99 100 COMPILE_ASSERT(sizeof(GlyphBufferGlyph) == sizeof(uint16_t), GlyphBufferGlyphSize_equals_uint16_t); 101 102 bool shouldSmoothFonts = true; 103 bool shouldAntialias = true; 104 105 switch (fontDescription().fontSmoothing()) { 106 case Antialiased: 107 shouldSmoothFonts = false; 108 break; 109 case SubpixelAntialiased: 110 break; 111 case NoSmoothing: 112 shouldAntialias = false; 113 shouldSmoothFonts = false; 114 break; 115 case AutoSmoothing: 116 // For the AutoSmooth case, don't do anything! Keep the default settings. 117 break; 118 } 119 120 if (!shouldUseSmoothing() || PlatformSupport::layoutTestMode()) 121 shouldSmoothFonts = false; 100 122 101 123 const GlyphBufferGlyph* glyphs = glyphBuffer.glyphs(from); … … 134 156 SkPaint paint; 135 157 gc->platformContext()->setupPaintForFilling(&paint); 136 setupPaint(&paint, font, this );158 setupPaint(&paint, font, this, shouldAntialias, shouldSmoothFonts); 137 159 adjustTextRenderMode(&paint, gc->platformContext()); 138 160 paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); … … 157 179 SkPaint paint; 158 180 gc->platformContext()->setupPaintForStroking(&paint, 0, 0); 159 setupPaint(&paint, font, this );181 setupPaint(&paint, font, this, shouldAntialias, shouldSmoothFonts); 160 182 adjustTextRenderMode(&paint, gc->platformContext()); 161 183 paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
Note: See TracChangeset
for help on using the changeset viewer.