Changeset 46939 in webkit


Ignore:
Timestamp:
Aug 7, 2009 6:25:07 PM (15 years ago)
Author:
abarth@webkit.org
Message:

2009-08-07 Yong Li <yong.li@torchmobile.com>

WINCE PORT: store only width for GlyphBufferAdvance, to save space on low-memory devices
https://bugs.webkit.org/show_bug.cgi?id=27734

  • platform/graphics/GlyphBuffer.h: (WebCore::GlyphBuffer::advanceAt): (WebCore::GlyphBuffer::advanceData): (WebCore::GlyphBuffer::add):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r46938 r46939  
     12009-08-07  Yong Li  <yong.li@torchmobile.com>
     2
     3        WINCE PORT: store only width for GlyphBufferAdvance, to save space on low-memory devices
     4        https://bugs.webkit.org/show_bug.cgi?id=27734
     5
     6        * platform/graphics/GlyphBuffer.h:
     7        (WebCore::GlyphBuffer::advanceAt):
     8        (WebCore::GlyphBuffer::advanceData):
     9        (WebCore::GlyphBuffer::add):
     10
    1112009-08-07  Yong Li  <yong.li@torchmobile.com>
    212
  • trunk/WebCore/platform/graphics/GlyphBuffer.h

    r40965 r46939  
    11/*
    22 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
     3 * Copyright (C) 2007-2008 Torch Mobile Inc.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    5051// FIXME: Why does Cairo use such a huge struct instead of just an offset into an array?
    5152typedef cairo_glyph_t GlyphBufferGlyph;
     53#elif PLATFORM(WINCE)
     54typedef wchar_t GlyphBufferGlyph;
    5255#else
    5356typedef Glyph GlyphBufferGlyph;
     
    5861#if PLATFORM(CG)
    5962typedef CGSize GlyphBufferAdvance;
     63#elif PLATFORM(WINCE)
     64// There is no cross-platform code that uses the height of GlyphBufferAdvance,
     65// so we can save memory space on embedded devices by storing only the width
     66typedef float GlyphBufferAdvance;
    6067#else
    6168typedef FloatSize GlyphBufferAdvance;
     
    118125#if PLATFORM(CG)
    119126        return m_advances[index].width;
     127#elif PLATFORM(WINCE)
     128        return m_advances[index];
    120129#else
    121130        return m_advances[index].width();
    122131#endif
    123132    }
     133
     134#if PLATFORM(WINCE)
     135    const GlyphBufferAdvance* advanceData() const
     136    {
     137        return m_advances.data();
     138    }
     139#endif
    124140
    125141    FloatSize offsetAt(int index) const
     
    148164        CGSize advance = { width, 0 };
    149165        m_advances.append(advance);
     166#elif PLATFORM(WINCE)
     167        m_advances.append(width);
    150168#else
    151169        m_advances.append(FloatSize(width, 0));
     
    162180    }
    163181   
     182#if !PLATFORM(WINCE)
    164183    void add(Glyph glyph, const SimpleFontData* font, GlyphBufferAdvance advance)
    165184    {
     
    175194        m_advances.append(advance);
    176195    }
     196#endif
    177197   
    178198private:
Note: See TracChangeset for help on using the changeset viewer.