Changeset 267073 in webkit


Ignore:
Timestamp:
Sep 14, 2020 9:19:22 PM (4 years ago)
Author:
mmaxfield@apple.com
Message:

[Apple Win] Migrate from FontPlatformDataWin.cpp to FontPlatformDataCoreText.cpp
https://bugs.webkit.org/show_bug.cgi?id=216448

Reviewed by Darin Adler.

Source/WebCore:

This is one of the steps toward migrating the Apple Win port off of CGFont and on to
CTFont. This patch removes the #if !PLATFORM(WIN) guard in FontPlatformDataCoreText.cpp
and deletes the old functions it used to be using. It fixes up the Core Text functions to
use ctFont() instead of font(), because font() returns the HFONT on Windows.

It also adds a new helper, platformOpenTypeTable(), because it looks like
CTFontCopyTable() sometimes fails, so we can use this function to fall back to using the
HFONT and the win32 API instead.

Covered by existing tests.

  • platform/graphics/FontPlatformData.cpp:
  • platform/graphics/FontPlatformData.h:

(WebCore::FontPlatformData::ctFont const):
(WebCore::FontPlatformData::font const):

  • platform/graphics/cocoa/FontPlatformDataCocoa.mm:

(WebCore::FontPlatformData::platformOpenTypeTable const):

  • platform/graphics/coretext/FontPlatformDataCoreText.cpp:

(WebCore::FontPlatformData::FontPlatformData):
(WebCore::FontPlatformData::registeredFont const):
(WebCore::FontPlatformData::ctFont const):
(WebCore::FontPlatformData::openTypeTable const):
(WebCore::FontPlatformData::description const):
(WebCore::FontPlatformData::familyName const):

  • platform/graphics/win/FontCustomPlatformData.cpp:

(WebCore::FontCustomPlatformData::~FontCustomPlatformData):
(WebCore::FontCustomPlatformData::fontPlatformData):
(WebCore::createFontCustomPlatformData):

  • platform/graphics/win/FontCustomPlatformData.h:

(WebCore::FontCustomPlatformData::FontCustomPlatformData):

  • platform/graphics/win/FontCustomPlatformDataCairo.cpp:

(WebCore::FontCustomPlatformData::~FontCustomPlatformData):
(WebCore::FontCustomPlatformData::fontPlatformData):

  • platform/graphics/win/FontPlatformDataCGWin.cpp:

(WebCore::FontPlatformData::FontPlatformData):

  • platform/graphics/win/FontPlatformDataCairoWin.cpp:

(WebCore::FontPlatformData::openTypeTable const):

  • platform/graphics/win/FontPlatformDataWin.cpp:

(WebCore::FontPlatformData::platformOpenTypeTable const):
(WebCore::FontPlatformData::openTypeTable const): Deleted.
(WebCore::FontPlatformData::description const): Deleted.

Source/WebCore/PAL:

  • pal/spi/win/CoreTextSPIWin.h:

LayoutTests:

These two tests are progressions.

  • platform/win/mathml/opentype/opentype-stretchy-expected.txt:
  • platform/win/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.txt:
Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r267072 r267073  
     12020-09-14  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [Apple Win] Migrate from FontPlatformDataWin.cpp to FontPlatformDataCoreText.cpp
     4        https://bugs.webkit.org/show_bug.cgi?id=216448
     5
     6        Reviewed by Darin Adler.
     7
     8        These two tests are progressions.
     9
     10        * platform/win/mathml/opentype/opentype-stretchy-expected.txt:
     11        * platform/win/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.txt:
     12
    1132020-09-14  Hector Lopez  <hector_i_lopez@apple.com>
    214
  • trunk/LayoutTests/platform/win/mathml/opentype/opentype-stretchy-expected.txt

    r203339 r267073  
    1 layer at (0,0) size 785x33554431
    2   RenderView at (0,0) size 785x600
    3 layer at (0,0) size 785x33554431
    4   RenderBlock {HTML} at (0,0) size 785x33554431
    5     RenderBody {BODY} at (8,16) size 769x33554415
    6       RenderBlock {P} at (0,0) size 769x34
    7         RenderMathMLMath {math} at (0,20) size 8x10
    8           RenderMathMLRow {mrow} at (0,0) size 8x10
    9             RenderMathMLOperator {mo} at (0,0) size 8x10
    10               RenderBlock (anonymous) at (0,0) size 2x10
    11                 RenderText {#text} at (0,0) size 2x0
    12                   text run at (0,0) width 2: "\x{219F}"
    13         RenderText {#text} at (7,16) size 5x18
    14           text run at (7,16) width 5: " "
    15         RenderMathMLMath {math} at (11,15) size 27x15
    16           RenderMathMLRow {mrow} at (0,0) size 26x15
    17             RenderMathMLOperator {mo} at (0,0) size 26x10
    18               RenderBlock (anonymous) at (0,0) size 2x10
    19                 RenderText {#text} at (0,0) size 2x0
    20                   text run at (0,0) width 2: "\x{219F}"
    21         RenderText {#text} at (37,16) size 5x18
    22           text run at (37,16) width 5: " "
    23         RenderMathMLMath {math} at (41,0) size 47x30
    24           RenderMathMLRow {mrow} at (0,0) size 47x30
    25             RenderMathMLOperator {mo} at (0,0) size 47x30
    26               RenderBlock (anonymous) at (0,0) size 2x10
    27                 RenderText {#text} at (0,0) size 2x0
    28                   text run at (0,0) width 2: "\x{219F}"
     1layer at (0,0) size 800x600
     2  RenderView at (0,0) size 800x600
     3layer at (0,0) size 800x338
     4  RenderBlock {HTML} at (0,0) size 800x338
     5    RenderBody {BODY} at (8,16) size 784x306
     6      RenderBlock {P} at (0,0) size 784x34
     7        RenderMathMLMath {math} at (0,20) size 26x11
     8          RenderMathMLRow {mrow} at (0,0) size 26x11
     9            RenderMathMLOperator {mo} at (0,0) size 26x11
     10              RenderBlock (anonymous) at (0,0) size 2x3
     11                RenderText {#text} at (0,-3) size 2x0
     12                  text run at (0,-3) width 2: "\x{219F}"
     13        RenderText {#text} at (25,16) size 5x18
     14          text run at (25,16) width 5: " "
     15        RenderMathMLMath {math} at (29,10) size 27x21
     16          RenderMathMLRow {mrow} at (0,0) size 26x21
     17            RenderMathMLOperator {mo} at (0,0) size 26x21
     18              RenderBlock (anonymous) at (0,0) size 2x3
     19                RenderText {#text} at (0,-3) size 2x0
     20                  text run at (0,-3) width 2: "\x{219F}"
     21        RenderText {#text} at (55,16) size 5x18
     22          text run at (55,16) width 5: " "
     23        RenderMathMLMath {math} at (59,0) size 26x31
     24          RenderMathMLRow {mrow} at (0,0) size 26x31
     25            RenderMathMLOperator {mo} at (0,0) size 26x31
     26              RenderBlock (anonymous) at (0,0) size 2x3
     27                RenderText {#text} at (0,-3) size 2x0
     28                  text run at (0,-3) width 2: "\x{219F}"
    2929        RenderText {#text} at (0,0) size 0x0
    30       RenderBlock {P} at (0,50) size 769x154
     30      RenderBlock {P} at (0,50) size 784x154
    3131        RenderMathMLMath {math} at (0,0) size 47x150
    3232          RenderMathMLRow {mrow} at (0,0) size 47x150
    3333            RenderMathMLOperator {mo} at (0,0) size 47x150
    34               RenderBlock (anonymous) at (0,0) size 2x10
    35                 RenderText {#text} at (0,0) size 2x0
    36                   text run at (0,0) width 2: "\x{219F}"
     34              RenderBlock (anonymous) at (0,0) size 2x3
     35                RenderText {#text} at (0,-3) size 2x0
     36                  text run at (0,-3) width 2: "\x{219F}"
    3737        RenderText {#text} at (0,0) size 0x0
    38       RenderBlock {P} at (0,220) size 769x33554211
    39         RenderMathMLMath {math} at (0,14) size 94x33554417
    40           RenderMathMLRow {mrow} at (0,0) size 94x33554431
    41             RenderMathMLOperator {mo} at (0,33554431) size 94x0
    42               RenderBlock (anonymous) at (0,0) size 10x10
    43                 RenderText {#text} at (0,0) size 10x0
    44                   text run at (0,0) width 10: "\x{2A1B}"
     38      RenderBlock {P} at (0,220) size 784x86
     39        RenderMathMLMath {math} at (0,0) size 84x82
     40          RenderMathMLRow {mrow} at (0,0) size 84x82
     41            RenderMathMLOperator {mo} at (0,0) size 84x82
     42              RenderBlock (anonymous) at (0,0) size 10x12
     43                RenderText {#text} at (0,6) size 10x0
     44                  text run at (0,6) width 10: "\x{2A1B}"
    4545        RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/platform/win/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.txt

    r197145 r267073  
    4040          RenderSVGInlineText {#text} at (0,0) size 164x14
    4141            chunk 1 text run 1 at (230.00,80.00) startOffset 0 endOffset 30 width 164.00: "Relative to font x-height (ex)"
    42         RenderSVGContainer {g} at (20,140) size 320x1
    43           RenderSVGRect {rect} at (20,140) size 320x1 [fill={[type=SOLID] [color=#000000]}] [x=20.00] [y=80.00] [width=320.00] [height=1.00]
     42        RenderSVGContainer {g} at (20,140) size 210x1
     43          RenderSVGRect {rect} at (20,140) size 210x1 [fill={[type=SOLID] [color=#000000]}] [x=20.00] [y=80.00] [width=240.00] [height=1.00]
    4444        RenderSVGText {text} at (20,87) size 99x14 contains 1 chunk(s)
    4545          RenderSVGInlineText {#text} at (0,0) size 99x14
  • trunk/Source/WebCore/ChangeLog

    r267071 r267073  
     12020-09-14  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [Apple Win] Migrate from FontPlatformDataWin.cpp to FontPlatformDataCoreText.cpp
     4        https://bugs.webkit.org/show_bug.cgi?id=216448
     5
     6        Reviewed by Darin Adler.
     7
     8        This is one of the steps toward migrating the Apple Win port off of CGFont and on to
     9        CTFont. This patch removes the #if !PLATFORM(WIN) guard in FontPlatformDataCoreText.cpp
     10        and deletes the old functions it used to be using. It fixes up the Core Text functions to
     11        use ctFont() instead of font(), because font() returns the HFONT on Windows.
     12
     13        It also adds a new helper, platformOpenTypeTable(), because it looks like
     14        CTFontCopyTable() sometimes fails, so we can use this function to fall back to using the
     15        HFONT and the win32 API instead.
     16
     17        Covered by existing tests.
     18
     19        * platform/graphics/FontPlatformData.cpp:
     20        * platform/graphics/FontPlatformData.h:
     21        (WebCore::FontPlatformData::ctFont const):
     22        (WebCore::FontPlatformData::font const):
     23        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
     24        (WebCore::FontPlatformData::platformOpenTypeTable const):
     25        * platform/graphics/coretext/FontPlatformDataCoreText.cpp:
     26        (WebCore::FontPlatformData::FontPlatformData):
     27        (WebCore::FontPlatformData::registeredFont const):
     28        (WebCore::FontPlatformData::ctFont const):
     29        (WebCore::FontPlatformData::openTypeTable const):
     30        (WebCore::FontPlatformData::description const):
     31        (WebCore::FontPlatformData::familyName const):
     32        * platform/graphics/win/FontCustomPlatformData.cpp:
     33        (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
     34        (WebCore::FontCustomPlatformData::fontPlatformData):
     35        (WebCore::createFontCustomPlatformData):
     36        * platform/graphics/win/FontCustomPlatformData.h:
     37        (WebCore::FontCustomPlatformData::FontCustomPlatformData):
     38        * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
     39        (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
     40        (WebCore::FontCustomPlatformData::fontPlatformData):
     41        * platform/graphics/win/FontPlatformDataCGWin.cpp:
     42        (WebCore::FontPlatformData::FontPlatformData):
     43        * platform/graphics/win/FontPlatformDataCairoWin.cpp:
     44        (WebCore::FontPlatformData::openTypeTable const):
     45        * platform/graphics/win/FontPlatformDataWin.cpp:
     46        (WebCore::FontPlatformData::platformOpenTypeTable const):
     47        (WebCore::FontPlatformData::openTypeTable const): Deleted.
     48        (WebCore::FontPlatformData::description const): Deleted.
     49
    1502020-09-14  Chris Dumez  <cdumez@apple.com>
    251
  • trunk/Source/WebCore/PAL/ChangeLog

    r267063 r267073  
     12020-09-14  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [Apple Win] Migrate from FontPlatformDataWin.cpp to FontPlatformDataCoreText.cpp
     4        https://bugs.webkit.org/show_bug.cgi?id=216448
     5
     6        Reviewed by Darin Adler.
     7
     8        * pal/spi/win/CoreTextSPIWin.h:
     9
    1102020-09-14  Peng Liu  <peng.liu6@apple.com>
    211
  • trunk/Source/WebCore/PAL/pal/spi/win/CoreTextSPIWin.h

    r266936 r267073  
    130130CTFontSymbolicTraits CTFontGetSymbolicTraits(CTFontRef);
    131131CFCharacterSetRef CTFontCopyCharacterSet(CTFontRef);
     132CGFontRef CTFontCopyGraphicsFont(CTFontRef, CTFontDescriptorRef* attributes);
    132133CFStringRef CTFontCopyFamilyName(CTFontRef);
    133134CFStringRef CTFontCopyFullName(CTFontRef);
     
    155156bool CTFontGetVerticalGlyphsForCharacters(CTFontRef, const UniChar[], CGGlyph[], CFIndex count);
    156157
     158CTFontDescriptorRef CTFontManagerCreateFontDescriptorFromData(CFDataRef);
     159
    157160CTFontDescriptorRef CTFontDescriptorCreateWithAttributes(CFDictionaryRef);
    158161bool CTFontDescriptorIsSystemUIFont(CTFontDescriptorRef);
  • trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp

    r266982 r267073  
    8080#endif
    8181
    82 #if !USE(CORE_TEXT) || PLATFORM(WIN)
     82#if !USE(CORE_TEXT)
    8383
    8484String FontPlatformData::familyName() const
  • trunk/Source/WebCore/platform/graphics/FontPlatformData.h

    r266982 r267073  
    8989#if PLATFORM(WIN)
    9090    FontPlatformData(GDIObject<HFONT>, float size, bool syntheticBold, bool syntheticOblique, bool useGDI);
    91 #if USE(CG)
    92     FontPlatformData(GDIObject<HFONT>, CGFontRef, float size, bool syntheticBold, bool syntheticOblique, bool useGDI);
    93     FontPlatformData(CGFontRef, float size, bool syntheticBold, bool syntheticOblique, FontOrientation, FontWidthVariant, TextRenderingMode);
     91#if USE(CORE_TEXT)
     92    FontPlatformData(GDIObject<HFONT>, CTFontRef, CGFontRef, float size, bool syntheticBold, bool syntheticOblique, bool useGDI);
    9493#endif
    9594#if USE(DIRECT2D)
     
    115114    CGFontRef cgFont() const { return m_cgFont.get(); }
    116115#endif
    117 #if USE(CORE_TEXT)
    118     CTFontRef ctFont() const { return m_ctFont.get(); }
    119 #endif
    120 #elif USE(CORE_TEXT)
    121     CTFontRef font() const { return m_font.get(); }
     116#endif
     117
     118#if USE(CORE_TEXT)
    122119    WEBCORE_EXPORT CTFontRef registeredFont() const; // Returns nullptr iff the font is not registered, such as web fonts (otherwise returns font()).
    123 
    124     CTFontRef ctFont() const;
    125120    static RetainPtr<CFTypeRef> objectForEqualityCheck(CTFontRef);
    126121    RetainPtr<CFTypeRef> objectForEqualityCheck() const;
    127 
    128122    bool hasCustomTracking() const { return isSystemFont(); }
     123
     124#if PLATFORM(WIN)
     125    CTFontRef ctFont() const { return m_ctFont.get(); }
     126#else
     127    CTFontRef font() const { return m_font.get(); }
     128    CTFontRef ctFont() const;
     129#endif
    129130#endif
    130131
     
    195196
    196197    RefPtr<SharedBuffer> openTypeTable(uint32_t table) const;
     198    RefPtr<SharedBuffer> platformOpenTypeTable(uint32_t table) const;
    197199
    198200    String description() const;
     
    215217#if PLATFORM(WIN)
    216218    RefPtr<SharedGDIObject<HFONT>> m_font; // FIXME: Delete this in favor of m_ctFont or m_dwFont or m_scaledFont.
    217 #if USE(CG)
     219#if USE(CORE_TEXT)
    218220    RetainPtr<CGFontRef> m_cgFont; // FIXME: Delete this in favor of m_ctFont.
    219 #endif
    220 #if USE(CORE_TEXT)
    221221    RetainPtr<CTFontRef> m_ctFont;
    222222#endif
  • trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm

    r266936 r267073  
    5757}
    5858
     59RefPtr<SharedBuffer> FontPlatformData::platformOpenTypeTable(uint32_t) const
     60{
     61    return nullptr;
     62}
     63
    5964} // namespace WebCore
  • trunk/Source/WebCore/platform/graphics/coretext/FontPlatformDataCoreText.cpp

    r266982 r267073  
    3636namespace WebCore {
    3737
    38 #if !PLATFORM(WIN)
    39 
    4038FontPlatformData::FontPlatformData(CTFontRef font, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation, FontWidthVariant widthVariant, TextRenderingMode textRenderingMode)
    4139    : FontPlatformData(size, syntheticBold, syntheticOblique, orientation, widthVariant, textRenderingMode)
    4240{
    4341    ASSERT_ARG(font, font);
     42#if PLATFORM(WIN)
     43    m_ctFont = font;
     44#else
    4445    m_font = font;
     46#endif
    4547    m_isColorBitmapFont = CTFontGetSymbolicTraits(font) & kCTFontColorGlyphsTrait;
    46     m_isSystemFont = WebCore::isSystemFont(m_font.get());
     48    m_isSystemFont = WebCore::isSystemFont(font);
    4749    auto variations = adoptCF(static_cast<CFDictionaryRef>(CTFontCopyAttribute(font, kCTFontVariationAttribute)));
    4850    m_hasVariations = variations && CFDictionaryGetCount(variations.get());
     
    6466CTFontRef FontPlatformData::registeredFont() const
    6567{
    66     CTFontRef platformFont = font();
     68    CTFontRef platformFont = ctFont();
    6769    ASSERT(platformFont);
    6870    if (platformFont && adoptCF(CTFontCopyAttribute(platformFont, kCTFontURLAttribute)))
     
    133135    return m_ctFont.get();
    134136}
    135 #else
    136 CTFontRef FontPlatformData::ctFont() const
    137 {
    138     return font();
    139 }
    140137#endif
    141138
     
    157154RefPtr<SharedBuffer> FontPlatformData::openTypeTable(uint32_t table) const
    158155{
    159     if (RetainPtr<CFDataRef> data = adoptCF(CTFontCopyTable(font(), table, kCTFontTableOptionNoOptions)))
     156    if (RetainPtr<CFDataRef> data = adoptCF(CTFontCopyTable(ctFont(), table, kCTFontTableOptionNoOptions)))
    160157        return SharedBuffer::create(data.get());
    161158
    162     return nullptr;
     159    return platformOpenTypeTable(table);
    163160}
    164161
     
    167164String FontPlatformData::description() const
    168165{
    169     String fontDescription { adoptCF(CFCopyDescription(font())).get() };
     166    String fontDescription { adoptCF(CFCopyDescription(ctFont())).get() };
    170167    return makeString(fontDescription, ' ', m_size,
    171168        (m_syntheticBold ? " synthetic bold" : ""),
     
    178175String FontPlatformData::familyName() const
    179176{
    180     if (auto platformFont = font())
     177    if (auto platformFont = ctFont())
    181178        return adoptCF(CTFontCopyFamilyName(platformFont)).get();
    182179    return { };
    183180}
    184181
    185 #endif
    186 
    187182} // namespace WebCore
  • trunk/Source/WebCore/platform/graphics/win/FontCustomPlatformData.cpp

    r252760 r267073  
    4343FontCustomPlatformData::~FontCustomPlatformData()
    4444{
    45     if (m_fontReference)
    46         RemoveFontMemResourceEx(m_fontReference);
     45    if (fontReference)
     46        RemoveFontMemResourceEx(fontReference);
    4747}
    4848
     
    5252    FontRenderingMode renderingMode = fontDescription.renderingMode();
    5353
    54     ASSERT(m_fontReference);
     54    ASSERT(fontReference);
    5555
    56     auto faceName = m_name.charactersWithNullTermination();
     56    auto faceName = name.charactersWithNullTermination();
    5757    if (faceName.size() > LF_FACESIZE) {
    5858        faceName.resize(LF_FACESIZE);
     
    6161
    6262    LOGFONT logFont { };
    63     memcpy(logFont.lfFaceName, faceName.data(), sizeof(logFont.lfFaceName[0]) * std::min<size_t>(static_cast<size_t>(LF_FACESIZE), 1 + m_name.length()));
     63    memcpy(logFont.lfFaceName, faceName.data(), sizeof(logFont.lfFaceName[0]) * std::min<size_t>(static_cast<size_t>(LF_FACESIZE), 1 + name.length()));
    6464
    6565    logFont.lfHeight = -size;
     
    8383
    8484    auto hfont = adoptGDIObject(::CreateFontIndirect(&logFont));
    85 #if USE(CG)
    86     RetainPtr<CGFontRef> cgFont = adoptCF(CGFontCreateWithPlatformFont(&logFont));
    87     return FontPlatformData(WTFMove(hfont), cgFont.get(), size, bold, italic, renderingMode == FontRenderingMode::Alternate);
     85#if USE(CORE_TEXT)
     86    auto ctFont = adoptCF(CTFontCreateWithFontDescriptor(fontDescriptor.get(), size, nullptr));
     87    auto cgFont = adoptCF(CTFontCopyGraphicsFont(ctFont.get(), nullptr));
     88    return FontPlatformData(WTFMove(hfont), ctFont.get(), cgFont.get(), size, bold, italic, renderingMode == FontRenderingMode::Alternate);
    8889#else
    8990    auto font = DirectWrite::createWithPlatformFont(logFont);
     
    111112    if (!fontReference)
    112113        return nullptr;
    113     return makeUnique<FontCustomPlatformData>(fontReference, fontName);
     114    auto result = makeUnique<FontCustomPlatformData>(fontReference, fontName);
     115#if USE(CORE_TEXT)
     116    result->fontDescriptor = adoptCF(CTFontManagerCreateFontDescriptorFromData(buffer.createCFData().get()));
     117#endif
     118    return result;
    114119}
    115120
  • trunk/Source/WebCore/platform/graphics/win/FontCustomPlatformData.h

    r252760 r267073  
    2828#include <wtf/text/WTFString.h>
    2929
     30#if USE(CORE_TEXT)
     31#include <pal/spi/win/CoreTextSPIWin.h>
     32#endif
     33
    3034typedef struct CGFont* CGFontRef;
    3135
     
    4650public:
    4751    FontCustomPlatformData(HANDLE fontReference, const String& name)
    48         : m_fontReference(fontReference)
    49         , m_name(name)
     52        : fontReference(fontReference)
     53        , name(name)
    5054    {
    5155    }
     
    5761    static bool supportsFormat(const String&);
    5862
    59     HANDLE m_fontReference;
    60     String m_name;
     63    HANDLE fontReference;
     64    String name;
     65#if USE(CORE_TEXT)
     66    RetainPtr<CTFontDescriptorRef> fontDescriptor;
     67#endif
    6168};
    6269
  • trunk/Source/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp

    r264236 r267073  
    3535FontCustomPlatformData::~FontCustomPlatformData()
    3636{
    37     if (m_fontReference)
    38         RemoveFontMemResourceEx(m_fontReference);
     37    if (fontReference)
     38        RemoveFontMemResourceEx(fontReference);
    3939}
    4040
     
    4646    LOGFONT logFont;
    4747    memset(&logFont, 0, sizeof(LOGFONT));
    48     wcsncpy(logFont.lfFaceName, m_name.wideCharacters().data(), LF_FACESIZE - 1);
     48    wcsncpy(logFont.lfFaceName, name.wideCharacters().data(), LF_FACESIZE - 1);
    4949
    5050    logFont.lfHeight = -size;
  • trunk/Source/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp

    r266982 r267073  
    121121}
    122122
    123 FontPlatformData::FontPlatformData(GDIObject<HFONT> hfont, CGFontRef font, float size, bool bold, bool oblique, bool useGDI)
     123FontPlatformData::FontPlatformData(GDIObject<HFONT> hfont, CTFontRef ctFont, CGFontRef cgFont, float size, bool bold, bool oblique, bool useGDI)
    124124    : m_syntheticBold(bold)
    125125    , m_syntheticOblique(oblique)
    126126    , m_size(size)
    127127    , m_font(SharedGDIObject<HFONT>::create(WTFMove(hfont)))
    128     , m_cgFont(font)
    129     , m_ctFont(adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), size, nullptr, nullptr)))
     128    , m_cgFont(cgFont)
     129    , m_ctFont(ctFont)
    130130    , m_useGDI(useGDI)
    131131{
    132 }
    133 
    134 FontPlatformData::FontPlatformData(CGFontRef cgFont, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation, FontWidthVariant widthVariant, TextRenderingMode textRenderingMode)
    135     : FontPlatformData(size, syntheticBold, syntheticOblique, orientation, widthVariant, textRenderingMode)
    136 {
    137     m_cgFont = cgFont;
    138     ASSERT(m_cgFont);
    139     m_ctFont = adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), size, nullptr, nullptr));
    140132}
    141133
  • trunk/Source/WebCore/platform/graphics/win/FontPlatformDataCairoWin.cpp

    r239549 r267073  
    2727#include "FontPlatformData.h"
    2828
     29#include "SharedBuffer.h"
    2930#include <wtf/HashMap.h>
    3031#include <wtf/RetainPtr.h>
     
    3435
    3536#include <cairo-win32.h>
    36 
    3737
    3838namespace WebCore {
     
    9797}
    9898
     99RefPtr<SharedBuffer> FontPlatformData::openTypeTable(uint32_t table) const
     100{
     101    return platformOpenTypeTable(table);
    99102}
     103
     104}
  • trunk/Source/WebCore/platform/graphics/win/FontPlatformDataWin.cpp

    r248748 r267073  
    6161}
    6262
    63 RefPtr<SharedBuffer> FontPlatformData::openTypeTable(uint32_t table) const
     63RefPtr<SharedBuffer> FontPlatformData::platformOpenTypeTable(uint32_t table) const
    6464{
    6565    HWndDC hdc(0);
     
    7979}
    8080
    81 #if !LOG_DISABLED
    82 String FontPlatformData::description() const
    83 {
    84     return String();
    8581}
    86 #endif
    87 
    88 }
Note: See TracChangeset for help on using the changeset viewer.