Changeset 205771 in webkit


Ignore:
Timestamp:
Sep 9, 2016 2:54:31 PM (8 years ago)
Author:
mmaxfield@apple.com
Message:

Remove unused member of GlyphBuffer
https://bugs.webkit.org/show_bug.cgi?id=161814

Reviewed by Simon Fraser.

This m_offsets member never actually affected anything. It just made
FontCascade::drawGlyphBuffer() slower.

No new tests because there is no behavior change.

  • platform/graphics/FontCascade.cpp:

(WebCore::FontCascade::drawGlyphBuffer):

  • platform/graphics/GlyphBuffer.h:

(WebCore::GlyphBuffer::clear):
(WebCore::GlyphBuffer::advanceAt):
(WebCore::GlyphBuffer::add):
(WebCore::GlyphBuffer::shrink):
(WebCore::GlyphBuffer::swap):
(WebCore::GlyphBuffer::offsetAt): Deleted.

  • platform/graphics/win/UniscribeController.cpp:

(WebCore::UniscribeController::shapeAndPlaceItem):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r205768 r205771  
     12016-09-09  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Remove unused member of GlyphBuffer
     4        https://bugs.webkit.org/show_bug.cgi?id=161814
     5
     6        Reviewed by Simon Fraser.
     7
     8        This m_offsets member never actually affected anything. It just made
     9        FontCascade::drawGlyphBuffer() slower.
     10
     11        No new tests because there is no behavior change.
     12
     13        * platform/graphics/FontCascade.cpp:
     14        (WebCore::FontCascade::drawGlyphBuffer):
     15        * platform/graphics/GlyphBuffer.h:
     16        (WebCore::GlyphBuffer::clear):
     17        (WebCore::GlyphBuffer::advanceAt):
     18        (WebCore::GlyphBuffer::add):
     19        (WebCore::GlyphBuffer::shrink):
     20        (WebCore::GlyphBuffer::swap):
     21        (WebCore::GlyphBuffer::offsetAt): Deleted.
     22        * platform/graphics/win/UniscribeController.cpp:
     23        (WebCore::UniscribeController::shapeAndPlaceItem):
     24
    1252016-09-09  Tim Horton  <timothy_horton@apple.com>
    226
  • trunk/Source/WebCore/platform/graphics/FontCascade.cpp

    r205186 r205771  
    12851285    // Draw each contiguous run of glyphs that use the same font data.
    12861286    const Font* fontData = glyphBuffer.fontAt(0);
    1287     FloatSize offset = glyphBuffer.offsetAt(0);
    12881287    FloatPoint startPoint(point.x(), point.y() - glyphBuffer.initialAdvance().height());
    12891288    float nextX = startPoint.x() + glyphBuffer.advanceAt(0).width();
     
    12931292    while (nextGlyph < glyphBuffer.size()) {
    12941293        const Font* nextFontData = glyphBuffer.fontAt(nextGlyph);
    1295         FloatSize nextOffset = glyphBuffer.offsetAt(nextGlyph);
    1296 
    1297         if (nextFontData != fontData || nextOffset != offset) {
     1294
     1295        if (nextFontData != fontData) {
    12981296            context.drawGlyphs(*this, *fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
    12991297
    13001298            lastFrom = nextGlyph;
    13011299            fontData = nextFontData;
    1302             offset = nextOffset;
    13031300            startPoint.setX(nextX);
    13041301            startPoint.setY(nextY);
  • trunk/Source/WebCore/platform/graphics/GlyphBuffer.h

    r205396 r205771  
    8888        if (m_offsetsInString)
    8989            m_offsetsInString->clear();
    90 #if PLATFORM(WIN)
    91         m_offsets.clear();
    92 #endif
    9390    }
    9491
     
    119116        return m_advances[index];
    120117    }
    121 
    122     FloatSize offsetAt(unsigned index) const
    123     {
    124 #if PLATFORM(WIN)
    125         return m_offsets[index];
    126 #else
    127         UNUSED_PARAM(index);
    128         return FloatSize();
    129 #endif
    130     }
    131118   
    132119    static const unsigned noOffset = UINT_MAX;
    133     void add(Glyph glyph, const Font* font, float width, unsigned offsetInString = noOffset, const FloatSize* offset = 0)
     120    void add(Glyph glyph, const Font* font, float width, unsigned offsetInString = noOffset)
    134121    {
    135122        m_font.append(font);
     
    148135#else
    149136        m_advances.append(FloatSize(width, 0));
    150 #endif
    151 
    152 #if PLATFORM(WIN)
    153         if (offset)
    154             m_offsets.append(*offset);
    155         else
    156             m_offsets.append(FloatSize());
    157 #else
    158         UNUSED_PARAM(offset);
    159137#endif
    160138       
     
    213191        if (m_offsetsInString)
    214192            m_offsetsInString->shrink(truncationPoint);
    215 #if PLATFORM(WIN)
    216         m_offsets.shrink(truncationPoint);
    217 #endif
    218193    }
    219194
     
    232207        m_advances[index1] = m_advances[index2];
    233208        m_advances[index2] = s;
    234 
    235 #if PLATFORM(WIN)
    236         FloatSize offset = m_offsets[index1];
    237         m_offsets[index1] = m_offsets[index2];
    238         m_offsets[index2] = offset;
    239 #endif
    240209    }
    241210
     
    245214    GlyphBufferAdvance m_initialAdvance;
    246215    std::unique_ptr<Vector<unsigned, 2048>> m_offsetsInString;
    247 #if PLATFORM(WIN)
    248     Vector<FloatSize, 2048> m_offsets;
    249 #endif
    250216    float m_leadingExpansion;
    251217};
  • trunk/Source/WebCore/platform/graphics/win/UniscribeController.cpp

    r192895 r205771  
    366366        if (glyphBuffer) {
    367367            FloatSize size(offsetX, -offsetY);
    368             glyphBuffer->add(glyph, fontData, advance, GlyphBuffer::noOffset, &size);
     368            glyphBuffer->add(glyph, fontData, advance, GlyphBuffer::noOffset);
    369369        }
    370370
Note: See TracChangeset for help on using the changeset viewer.