Use a ServerFont instance which is assigned to the currently
used font, so that the FontStyle reference count reflects the fact that the AGG engine might still use the font -> I think this "fix" is valid, but I have still seen crashes in the freetype code. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14446 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -70,6 +70,7 @@ AGGTextRenderer::AGGTextRenderer()
|
|||||||
fKerning(true),
|
fKerning(true),
|
||||||
fEmbeddedTransformation(),
|
fEmbeddedTransformation(),
|
||||||
|
|
||||||
|
fFont(),
|
||||||
fLastFamilyAndStyle(0),
|
fLastFamilyAndStyle(0),
|
||||||
fLastPointSize(-1.0),
|
fLastPointSize(-1.0),
|
||||||
fLastHinted(false)
|
fLastHinted(false)
|
||||||
@@ -111,6 +112,7 @@ AGGTextRenderer::SetFont(const ServerFont &font)
|
|||||||
|
|
||||||
fLastFamilyAndStyle = font.GetFamilyAndStyle();
|
fLastFamilyAndStyle = font.GetFamilyAndStyle();
|
||||||
fEmbeddedTransformation = transform;
|
fEmbeddedTransformation = transform;
|
||||||
|
fFont = font;
|
||||||
|
|
||||||
_UpdateSizeAndHinting(font.Size(), fEmbeddedTransformation.IsIdentity() && fHinted, load);
|
_UpdateSizeAndHinting(font.Size(), fEmbeddedTransformation.IsIdentity() && fHinted, load);
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ class AGGTextRenderer {
|
|||||||
Transformable fEmbeddedTransformation; // rotated or sheared font?
|
Transformable fEmbeddedTransformation; // rotated or sheared font?
|
||||||
|
|
||||||
// caching to avoid loading a font unnecessarily
|
// caching to avoid loading a font unnecessarily
|
||||||
|
ServerFont fFont;
|
||||||
uint32 fLastFamilyAndStyle;
|
uint32 fLastFamilyAndStyle;
|
||||||
float fLastPointSize;
|
float fLastPointSize;
|
||||||
bool fLastHinted;
|
bool fLastHinted;
|
||||||
|
|||||||
Reference in New Issue
Block a user