1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Made a couple of internal glyph handling methods public to help 3rd party tweaking.

This commit is contained in:
jules 2015-02-03 09:27:29 +00:00
parent 94a0793a09
commit c304ea1e15

View file

@ -162,15 +162,6 @@ public:
}
//==============================================================================
void drawGlyph (RenderTargetType& target, const Font& font, const int glyphNumber, Point<float> pos)
{
if (ReferenceCountedObjectPtr<CachedGlyphType> glyph = findOrCreateGlyph (font, glyphNumber))
{
glyph->lastAccessCount = ++accessCounter;
glyph->draw (target, pos);
}
}
void reset()
{
const ScopedLock sl (lock);
@ -180,11 +171,14 @@ public:
misses.set (0);
}
private:
friend struct ContainerDeletePolicy<CachedGlyphType>;
ReferenceCountedArray<CachedGlyphType> glyphs;
Atomic<int> accessCounter, hits, misses;
CriticalSection lock;
void drawGlyph (RenderTargetType& target, const Font& font, const int glyphNumber, Point<float> pos)
{
if (ReferenceCountedObjectPtr<CachedGlyphType> glyph = findOrCreateGlyph (font, glyphNumber))
{
glyph->lastAccessCount = ++accessCounter;
glyph->draw (target, pos);
}
}
ReferenceCountedObjectPtr<CachedGlyphType> findOrCreateGlyph (const Font& font, int glyphNumber)
{
@ -203,6 +197,12 @@ private:
return g;
}
private:
friend struct ContainerDeletePolicy<CachedGlyphType>;
ReferenceCountedArray<CachedGlyphType> glyphs;
Atomic<int> accessCounter, hits, misses;
CriticalSection lock;
CachedGlyphType* findExistingGlyph (const Font& font, int glyphNumber) const
{
for (int i = 0; i < glyphs.size(); ++i)
@ -302,12 +302,10 @@ public:
}
Font font;
ScopedPointer<EdgeTable> edgeTable;
int glyph, lastAccessCount;
bool snapToIntegerCoordinate;
private:
ScopedPointer<EdgeTable> edgeTable;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CachedGlyphEdgeTable)
};