mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
make use of cached alpha color table in QFontEngine::alphaMapForGlyph() and QFontEngineBox::alphaMapForGlyph()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
a28897786a
commit
2a5450f8b4
1 changed files with 3 additions and 8 deletions
|
@ -31,6 +31,7 @@
|
|||
#include "qharfbuzz_p.h"
|
||||
#include "qdrawhelper_p.h"
|
||||
#include "qcorecommon_p.h"
|
||||
#include "qguicommon_p.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -632,10 +633,7 @@ QImage QFontEngine::alphaMapForGlyph(glyph_t glyph)
|
|||
p.end();
|
||||
|
||||
QImage indexed(im.width(), im.height(), QImage::Format_Indexed8);
|
||||
QVector<QRgb> colors(256);
|
||||
for (int i=0; i<256; ++i)
|
||||
colors[i] = qRgba(0, 0, 0, i);
|
||||
indexed.setColorTable(colors);
|
||||
indexed.setColorTable(alphaColorTable());
|
||||
|
||||
const int bpl = indexed.bytesPerLine();
|
||||
uchar *dest = indexed.bits();
|
||||
|
@ -1210,10 +1208,7 @@ QFontEngine::Type QFontEngineBox::type() const
|
|||
QImage QFontEngineBox::alphaMapForGlyph(glyph_t)
|
||||
{
|
||||
QImage image(_size, _size, QImage::Format_Indexed8);
|
||||
QVector<QRgb> colors(256);
|
||||
for (int i=0; i<256; ++i)
|
||||
colors[i] = qRgba(0, 0, 0, i);
|
||||
image.setColorTable(colors);
|
||||
image.setColorTable(alphaColorTable());
|
||||
image.fill(0);
|
||||
|
||||
// can't use qpainter for index8; so use setPixel to draw our rectangle.
|
||||
|
|
Loading…
Add table
Reference in a new issue