Changeset 245753 in webkit


Ignore:
Timestamp:
May 24, 2019 2:41:32 PM (5 years ago)
Author:
timothy_horton@apple.com
Message:

Refactor how showLetterpressedGlyphsWithAdvances gets the graphics context.
https://bugs.webkit.org/show_bug.cgi?id=198225

Reviewed by Dean Jackson.

  • platform/graphics/cocoa/FontCascadeCocoa.mm:

(WebCore::showLetterpressedGlyphsWithAdvances):
(WebCore::FontCascade::drawGlyphs):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r245752 r245753  
     12019-05-24  Timothy Hatcher  <timothy@apple.com>
     2
     3        Refactor how showLetterpressedGlyphsWithAdvances gets the graphics context.
     4        https://bugs.webkit.org/show_bug.cgi?id=198225
     5
     6        Reviewed by Dean Jackson.
     7
     8        * platform/graphics/cocoa/FontCascadeCocoa.mm:
     9        (WebCore::showLetterpressedGlyphsWithAdvances):
     10        (WebCore::FontCascade::drawGlyphs):
     11
    1122019-05-24  Timothy Hatcher  <timothy@apple.com>
    213
  • trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm

    r245191 r245753  
    9999}
    100100
    101 static void showLetterpressedGlyphsWithAdvances(const FloatPoint& point, const Font& font, CGContextRef context, const CGGlyph* glyphs, const CGSize* advances, unsigned count)
     101static void showLetterpressedGlyphsWithAdvances(const FloatPoint& point, const Font& font, GraphicsContext& coreContext, const CGGlyph* glyphs, const CGSize* advances, unsigned count)
    102102{
    103103#if ENABLE(LETTERPRESS)
     
    110110        return;
    111111    }
     112
     113    CGContextRef context = coreContext.platformContext();
    112114
    113115    CGContextSetTextPosition(context, point.x(), point.y());
     
    127129        styleConfiguration.useSimplifiedEffect = YES;
    128130    }
     131
     132#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/FontCascadeCocoaAdditions.mm>)
     133#include <WebKitAdditions/FontCascadeCocoaAdditions.mm>
     134#endif
    129135
    130136    CGContextSetFont(context, adoptCF(CTFontCopyGraphicsFont(ctFont, nullptr)).get());
     
    138144    UNUSED_PARAM(point);
    139145    UNUSED_PARAM(font);
    140     UNUSED_PARAM(context);
     146    UNUSED_PARAM(coreContext);
    141147    UNUSED_PARAM(glyphs);
    142148    UNUSED_PARAM(advances);
     
    300306
    301307    if (useLetterpressEffect)
    302         showLetterpressedGlyphsWithAdvances(point, font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs);
     308        showLetterpressedGlyphsWithAdvances(point, font, context, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs);
    303309    else
    304310        showGlyphsWithAdvances(point, font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs);
Note: See TracChangeset for help on using the changeset viewer.