Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/text/qfontengine_qpf.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    579579        for (int i = 0; i < len; ++i) {
    580580            unsigned int uc = getChar(str, i, len);
    581             if (mirrored)
    582                 uc = QChar::mirroredChar(uc);
    583581            glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, uc);
    584582            if(!glyphs->glyphs[glyph_pos] && uc < 0x100)
     
    921919    if (!renderingFontEngine)
    922920        return;
    923 
    924     QImage img = renderingFontEngine->alphaMapForGlyph(glyph).convertToFormat(QImage::Format_Indexed8);
     921    QImage img = renderingFontEngine->alphaMapForGlyph(glyph);
     922    if (img.format() != QImage::Format_Indexed8) {
     923        bool mono = img.depth() == 1;
     924        img = img.convertToFormat(QImage::Format_Indexed8);
     925        if (mono) {
     926            //### we know that 1 is opaque and 0 is transparent
     927            uchar *byte = img.bits();
     928            int count = img.byteCount();
     929            while (count--)
     930                *byte++ *= 0xff;
     931        }
     932    }
    925933    glyph_metrics_t metrics = renderingFontEngine->boundingBox(glyph);
    926934    renderingFontEngine->removeGlyphFromCache(glyph);
Note: See TracChangeset for help on using the changeset viewer.