~ubuntu-branches/ubuntu/karmic/webkit/karmic-proposed

« back to all changes in this revision

Viewing changes to WebCore/platform/graphics/FontFastPath.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2009-05-15 18:30:58 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090515183058-50q5exjo9b1kxy9s
Tags: 1.1.7-1
* New upstream release
* debian/libwebkit-1.0-2.symbols:
- updated with the new symbols in 1.1.7
* debian/libwebkit-dev.install, debian/libwebkit-dev.links,
  debian/rules:
- Build, and ship gtk-doc documentation (Closes: #526683)
* debian/copyright:
- updated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
namespace WebCore {
41
41
 
42
 
const GlyphData& Font::glyphDataForCharacter(UChar32 c, bool mirror, bool forceSmallCaps) const
 
42
GlyphData Font::glyphDataForCharacter(UChar32 c, bool mirror, bool forceSmallCaps) const
43
43
{
44
44
    bool useSmallCapsFont = forceSmallCaps;
45
45
    if (m_fontDescription.smallCaps()) {
70
70
        while (true) {
71
71
            page = node->page();
72
72
            if (page) {
73
 
                const GlyphData& data = page->glyphDataForCharacter(c);
 
73
                GlyphData data = page->glyphDataForCharacter(c);
74
74
                if (data.fontData)
75
75
                    return data;
76
76
                if (node->isSystemFallback())
88
88
        while (true) {
89
89
            page = node->page();
90
90
            if (page) {
91
 
                const GlyphData& data = page->glyphDataForCharacter(c);
 
91
                GlyphData data = page->glyphDataForCharacter(c);
92
92
                if (data.fontData) {
93
93
                    // The smallCapsFontData function should not normally return 0.
94
94
                    // But if it does, we will just render the capital letter big.
99
99
                    GlyphPageTreeNode* smallCapsNode = GlyphPageTreeNode::getRootChild(smallCapsFontData, pageNumber);
100
100
                    const GlyphPage* smallCapsPage = smallCapsNode->page();
101
101
                    if (smallCapsPage) {
102
 
                        const GlyphData& data = smallCapsPage->glyphDataForCharacter(c);
 
102
                        GlyphData data = smallCapsPage->glyphDataForCharacter(c);
103
103
                        if (data.fontData)
104
104
                            return data;
105
105
                    }
150
150
    if (characterFontData) {
151
151
        // Got the fallback glyph and font.
152
152
        GlyphPage* fallbackPage = GlyphPageTreeNode::getRootChild(characterFontData, pageNumber)->page();
153
 
        const GlyphData& data = fallbackPage && fallbackPage->glyphDataForCharacter(c).fontData ? fallbackPage->glyphDataForCharacter(c) : characterFontData->missingGlyphData();
 
153
        GlyphData data = fallbackPage && fallbackPage->fontDataForCharacter(c) ? fallbackPage->glyphDataForCharacter(c) : characterFontData->missingGlyphData();
154
154
        // Cache it so we don't have to do system fallback again next time.
155
155
        if (!useSmallCapsFont)
156
156
            page->setGlyphDataForCharacter(c, data.glyph, data.fontData);
159
159
 
160
160
    // Even system fallback can fail; use the missing glyph in that case.
161
161
    // FIXME: It would be nicer to use the missing glyph from the last resort font instead.
162
 
    const GlyphData& data = primaryFont()->missingGlyphData();
 
162
    GlyphData data = primaryFont()->missingGlyphData();
163
163
    if (!useSmallCapsFont)
164
164
        page->setGlyphDataForCharacter(c, data.glyph, data.fontData);
165
165
    return data;