Changeset 182605 in webkit


Ignore:
Timestamp:
Apr 9, 2015, 12:03:28 PM (11 years ago)
Author:
Simon Fraser
Message:

Revert part of 182516: it broke tests
https://bugs.webkit.org/show_bug.cgi?id=143568
rdar://problem/20484578

Reviewed by Myles Maxfield.

Revert the FontCascadeCocoa parts of r182516, since it broke some CSS shapes tests.

  • platform/graphics/cocoa/FontCascadeCocoa.mm:

(WebCore::FontCascade::drawGlyphs):
(WebCore::dilationSizeForTextColor): Deleted.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r182604 r182605  
     12015-04-09  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Revert part of 182516: it broke tests
     4        https://bugs.webkit.org/show_bug.cgi?id=143568
     5        rdar://problem/20484578
     6
     7        Reviewed by Myles Maxfield.
     8
     9        Revert the FontCascadeCocoa parts of r182516, since it broke some CSS shapes tests.
     10
     11        * platform/graphics/cocoa/FontCascadeCocoa.mm:
     12        (WebCore::FontCascade::drawGlyphs):
     13        (WebCore::dilationSizeForTextColor): Deleted.
     14
    1152015-04-09  Zalan Bujtas  <zalan@apple.com>
    216
  • trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm

    r182558 r182605  
    204204#endif
    205205
    206 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
    207 static CGSize dilationSizeForTextColor(const Color& color)
    208 {
    209     double hue;
    210     double saturation;
    211     double lightness;
    212     color.getHSL(hue, saturation, lightness);
    213    
    214     // These values were derived empirically, and are only experimental.
    215     if (lightness < 0.3333) // Dark
    216         return CGSizeMake(0.007, 0.019);
    217 
    218     if (lightness < 0.6667) // Medium
    219         return CGSizeMake(0.032, 0.032);
    220 
    221     // Light
    222     return CGSizeMake(0.0475, 0.039);
    223 }
    224 #endif
    225 
    226206void FontCascade::drawGlyphs(GraphicsContext* context, const Font* font, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& anchorPoint) const
    227207{
     
    278258        CGContextSetShouldSmoothFonts(cgContext, shouldSmoothFonts);
    279259    }
    280    
    281 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
    282     CGFontAntialiasingStyle oldAntialiasingStyle;
    283     bool resetAntialiasingStyle = false;
    284     if (antialiasedFontDilationEnabled() && !CGContextGetShouldSmoothFonts(cgContext) && matchAntialiasedAndSmoothedFonts) {
    285         resetAntialiasingStyle = true;
    286         oldAntialiasingStyle = CGContextGetFontAntialiasingStyle(cgContext);
    287         CGContextSetFontAntialiasingStyle(cgContext, kCGFontAntialiasingStyleUnfilteredCustomDilation);
    288         CGContextSetFontDilation(cgContext, dilationSizeForTextColor(context->fillColor()));
    289     }
    290 #endif
    291260#endif
    292261
     
    406375
    407376#if !PLATFORM(IOS)
    408 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
    409     if (resetAntialiasingStyle)
    410         CGContextSetFontAntialiasingStyle(cgContext, oldAntialiasingStyle);
    411 #endif
    412    
    413377    if (changeFontSmoothing)
    414378        CGContextSetShouldSmoothFonts(cgContext, originalShouldUseFontSmoothing);
Note: See TracChangeset for help on using the changeset viewer.