Changeset 238363 in webkit


Ignore:
Timestamp:
Nov 18, 2018 9:26:15 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

HarfBuzzFace::CacheEntry should use 32-bit values in its HashMap
https://bugs.webkit.org/show_bug.cgi?id=191825

Patch by Zan Dobersek <zdobersek@igalia.com> on 2018-11-18
Reviewed by Michael Catanzaro.

The HashMap-based glyph cache contained in HarfBuzzFace::CacheEntry
objects is used to map given Unicode codepoints to corresponding
glyph indices (which occurs in the harfBuzzGetGlyph() function that's
invoked by HarfBuzz).

The 16-bit unsigned integer as the map's value type is not enough here
when the glyph index mapping is done through Freetype -- its API returns
32-bit glyph indices, and Cairo assigns this value to the 64-bit
unsigned index variable in the cairo_glyph_t struct. The value type is
thus bumped to 32 bits to match the unsigned type size of the index's
origin.

  • platform/graphics/harfbuzz/HarfBuzzFace.h:
  • platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r238360 r238363  
     12018-11-18  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        HarfBuzzFace::CacheEntry should use 32-bit values in its HashMap
     4        https://bugs.webkit.org/show_bug.cgi?id=191825
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        The HashMap-based glyph cache contained in HarfBuzzFace::CacheEntry
     9        objects is used to map given Unicode codepoints to corresponding
     10        glyph indices (which occurs in the harfBuzzGetGlyph() function that's
     11        invoked by HarfBuzz).
     12
     13        The 16-bit unsigned integer as the map's value type is not enough here
     14        when the glyph index mapping is done through Freetype -- its API returns
     15        32-bit glyph indices, and Cairo assigns this value to the 64-bit
     16        unsigned index variable in the cairo_glyph_t struct. The value type is
     17        thus bumped to 32 bits to match the unsigned type size of the index's
     18        origin.
     19
     20        * platform/graphics/harfbuzz/HarfBuzzFace.h:
     21        * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
     22
    1232018-11-17  Wenson Hsieh  <wenson_hsieh@apple.com>
    224
  • trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzFace.h

    r228553 r238363  
    6161    class CacheEntry : public RefCounted<CacheEntry> {
    6262    public:
    63         using GlyphCache = HashMap<uint32_t, uint16_t>;
     63        using GlyphCache = HashMap<uint32_t, uint32_t>;
    6464
    6565        static Ref<CacheEntry> create(hb_face_t* face)
  • trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp

    r228553 r238363  
    5151
    5252struct HarfBuzzFontData {
    53     WTF::HashMap<uint32_t, uint16_t>& glyphCacheForFaceCacheEntry;
     53    WTF::HashMap<uint32_t, uint32_t>& glyphCacheForFaceCacheEntry;
    5454    RefPtr<cairo_scaled_font_t> cairoScaledFont;
    5555};
Note: See TracChangeset for help on using the changeset viewer.