Qt 4.8
Public Functions | Public Variables | Properties | List of all members
QFontEngineFT::QGlyphSet Struct Reference

#include <qfontengine_ft_p.h>

Public Functions

void clear ()
 
GlyphgetGlyph (glyph_t index, QFixed subPixelPosition=0) const
 
 QGlyphSet ()
 
void removeGlyphFromCache (glyph_t index, QFixed subPixelPosition)
 
void setGlyph (glyph_t index, QFixed spp, Glyph *glyph)
 
bool useFastGlyphData (glyph_t index, QFixed subPixelPosition) const
 
 ~QGlyphSet ()
 

Public Variables

unsigned long id
 
bool outline_drawing
 
FT_Matrix transformationMatrix
 

Properties

int fast_glyph_count
 
Glyphfast_glyph_data [256]
 
QHash< GlyphAndSubPixelPosition, Glyph * > glyph_data
 

Detailed Description

Definition at line 186 of file qfontengine_ft_p.h.

Constructors and Destructors

◆ QGlyphSet()

QFontEngineFT::QGlyphSet::QGlyphSet ( )

Definition at line 1898 of file qfontengine_ft.cpp.

1899  : id(0), outline_drawing(false)
1900 {
1901  transformationMatrix.xx = 0x10000;
1902  transformationMatrix.yy = 0x10000;
1903  transformationMatrix.xy = 0;
1904  transformationMatrix.yx = 0;
1905  memset(fast_glyph_data, 0, sizeof(fast_glyph_data));
1906  fast_glyph_count = 0;
1907 }

◆ ~QGlyphSet()

QFontEngineFT::QGlyphSet::~QGlyphSet ( )

Definition at line 1909 of file qfontengine_ft.cpp.

1910 {
1911  clear();
1912 }

Functions

◆ clear()

void QFontEngineFT::QGlyphSet::clear ( )

Definition at line 1914 of file qfontengine_ft.cpp.

Referenced by QFontEngineFT::alphaMapBoundingBox(), and ~QGlyphSet().

1915 {
1916  if (fast_glyph_count > 0) {
1917  for (int i = 0; i < 256; ++i) {
1918  if (fast_glyph_data[i]) {
1919  delete fast_glyph_data[i];
1920  fast_glyph_data[i] = 0;
1921  }
1922  }
1923  fast_glyph_count = 0;
1924  }
1926  glyph_data.clear();
1927 }
QHash< GlyphAndSubPixelPosition, Glyph * > glyph_data
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
Definition: qalgorithms.h:319

◆ getGlyph()

QFontEngineFT::Glyph * QFontEngineFT::QGlyphSet::getGlyph ( glyph_t  index,
QFixed  subPixelPosition = 0 
) const
inline

Definition at line 374 of file qfontengine_ft_p.h.

Referenced by QFontEngineFT::alphaMapBoundingBox(), QRasterPaintEngine::drawCachedGlyphs(), QFontEngineFT::loadGlyphs(), and QTextureGlyphCache::textureMapForGlyph().

375 {
376  if (useFastGlyphData(index, subPixelPosition))
377  return fast_glyph_data[index];
378  return glyph_data.value(GlyphAndSubPixelPosition(index, subPixelPosition));
379 }
bool useFastGlyphData(glyph_t index, QFixed subPixelPosition) const
QHash< GlyphAndSubPixelPosition, Glyph * > glyph_data
quint16 index

◆ removeGlyphFromCache()

void QFontEngineFT::QGlyphSet::removeGlyphFromCache ( glyph_t  index,
QFixed  subPixelPosition 
)

Definition at line 1929 of file qfontengine_ft.cpp.

1930 {
1931  if (useFastGlyphData(index, subPixelPosition)) {
1932  if (fast_glyph_data[index]) {
1933  delete fast_glyph_data[index];
1934  fast_glyph_data[index] = 0;
1935  if (fast_glyph_count > 0)
1936  --fast_glyph_count;
1937  }
1938  } else {
1939  delete glyph_data.take(GlyphAndSubPixelPosition(index, subPixelPosition));
1940  }
1941 }
bool useFastGlyphData(glyph_t index, QFixed subPixelPosition) const
QHash< GlyphAndSubPixelPosition, Glyph * > glyph_data
quint16 index

◆ setGlyph()

void QFontEngineFT::QGlyphSet::setGlyph ( glyph_t  index,
QFixed  spp,
Glyph glyph 
)

Definition at line 1943 of file qfontengine_ft.cpp.

1944 {
1945  if (useFastGlyphData(index, subPixelPosition)) {
1946  if (!fast_glyph_data[index])
1947  ++fast_glyph_count;
1948  fast_glyph_data[index] = glyph;
1949  } else {
1950  glyph_data.insert(GlyphAndSubPixelPosition(index, subPixelPosition), glyph);
1951  }
1952 }
bool useFastGlyphData(glyph_t index, QFixed subPixelPosition) const
QHash< GlyphAndSubPixelPosition, Glyph * > glyph_data
quint16 index

◆ useFastGlyphData()

bool QFontEngineFT::QGlyphSet::useFastGlyphData ( glyph_t  index,
QFixed  subPixelPosition 
) const
inline

Definition at line 196 of file qfontengine_ft_p.h.

Referenced by removeGlyphFromCache(), and setGlyph().

196  {
197  return (index < 256 && subPixelPosition == 0);
198  }
quint16 index

Properties

◆ fast_glyph_count

int QFontEngineFT::QGlyphSet::fast_glyph_count
mutableprivate

Definition at line 205 of file qfontengine_ft_p.h.

Referenced by clear(), QGlyphSet(), removeGlyphFromCache(), and setGlyph().

◆ fast_glyph_data

Glyph* QFontEngineFT::QGlyphSet::fast_glyph_data[256]
mutableprivate

Definition at line 204 of file qfontengine_ft_p.h.

Referenced by clear(), QGlyphSet(), removeGlyphFromCache(), and setGlyph().

◆ glyph_data

QHash<GlyphAndSubPixelPosition, Glyph *> QFontEngineFT::QGlyphSet::glyph_data
mutableprivate

Definition at line 203 of file qfontengine_ft_p.h.

Referenced by clear(), removeGlyphFromCache(), and setGlyph().

◆ id

unsigned long QFontEngineFT::QGlyphSet::id

Definition at line 191 of file qfontengine_ft_p.h.

Referenced by QFontEngineFT::alphaMapBoundingBox().

◆ outline_drawing

bool QFontEngineFT::QGlyphSet::outline_drawing

Definition at line 192 of file qfontengine_ft_p.h.

Referenced by QRasterPaintEngine::drawCachedGlyphs(), and loadSingleEngine().

◆ transformationMatrix

FT_Matrix QFontEngineFT::QGlyphSet::transformationMatrix

The documentation for this struct was generated from the following files: