mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
LruCache: Factor out of GlyphArrangementCache
This commit is contained in:
parent
b2422514db
commit
080ac6e7e7
37 changed files with 173 additions and 56 deletions
|
|
@ -1821,6 +1821,7 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_graphics/fonts/juce_FunctionPointerDestructor.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.cpp"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_LruCache.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.cpp"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_Typeface.cpp"
|
||||
|
|
@ -4284,6 +4285,7 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_graphics/fonts/juce_FunctionPointerDestructor.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.cpp"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_LruCache.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.cpp"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_Typeface.cpp"
|
||||
|
|
|
|||
|
|
@ -4135,6 +4135,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Font.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\geometry\juce_AffineTransform.h"/>
|
||||
|
|
|
|||
|
|
@ -7137,6 +7137,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -4135,6 +4135,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Font.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\geometry\juce_AffineTransform.h"/>
|
||||
|
|
|
|||
|
|
@ -7137,6 +7137,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -4135,6 +4135,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Font.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\geometry\juce_AffineTransform.h"/>
|
||||
|
|
|
|||
|
|
@ -7137,6 +7137,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -1583,6 +1583,7 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_graphics/fonts/juce_FunctionPointerDestructor.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.cpp"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_LruCache.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.cpp"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_Typeface.cpp"
|
||||
|
|
@ -3728,6 +3729,7 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_graphics/fonts/juce_FunctionPointerDestructor.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.cpp"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_LruCache.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.cpp"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_Typeface.cpp"
|
||||
|
|
|
|||
|
|
@ -3606,6 +3606,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Font.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\geometry\juce_AffineTransform.h"/>
|
||||
|
|
|
|||
|
|
@ -6192,6 +6192,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -1713,6 +1713,7 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_graphics/fonts/juce_FunctionPointerDestructor.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.cpp"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_LruCache.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.cpp"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_Typeface.cpp"
|
||||
|
|
@ -4011,6 +4012,7 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_graphics/fonts/juce_FunctionPointerDestructor.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.cpp"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_LruCache.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.cpp"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_Typeface.cpp"
|
||||
|
|
|
|||
|
|
@ -3839,6 +3839,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Font.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\geometry\juce_AffineTransform.h"/>
|
||||
|
|
|
|||
|
|
@ -6627,6 +6627,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -3839,6 +3839,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Font.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\geometry\juce_AffineTransform.h"/>
|
||||
|
|
|
|||
|
|
@ -6627,6 +6627,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -3839,6 +3839,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Font.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\geometry\juce_AffineTransform.h"/>
|
||||
|
|
|
|||
|
|
@ -6627,6 +6627,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -1602,6 +1602,7 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_graphics/fonts/juce_FunctionPointerDestructor.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.cpp"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_LruCache.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.cpp"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_Typeface.cpp"
|
||||
|
|
@ -3827,6 +3828,7 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_graphics/fonts/juce_FunctionPointerDestructor.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.cpp"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_LruCache.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.cpp"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.h"
|
||||
"../../../../../modules/juce_graphics/fonts/juce_Typeface.cpp"
|
||||
|
|
|
|||
|
|
@ -3704,6 +3704,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Font.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\geometry\juce_AffineTransform.h"/>
|
||||
|
|
|
|||
|
|
@ -6354,6 +6354,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -2521,6 +2521,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Font.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\geometry\juce_AffineTransform.h"/>
|
||||
|
|
|
|||
|
|
@ -4332,6 +4332,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -2521,6 +2521,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Font.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\geometry\juce_AffineTransform.h"/>
|
||||
|
|
|
|||
|
|
@ -4332,6 +4332,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -2521,6 +2521,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Font.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\geometry\juce_AffineTransform.h"/>
|
||||
|
|
|
|||
|
|
@ -4332,6 +4332,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -3935,6 +3935,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Font.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\geometry\juce_AffineTransform.h"/>
|
||||
|
|
|
|||
|
|
@ -6741,6 +6741,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -3935,6 +3935,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Font.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\geometry\juce_AffineTransform.h"/>
|
||||
|
|
|
|||
|
|
@ -6741,6 +6741,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -3935,6 +3935,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Font.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\geometry\juce_AffineTransform.h"/>
|
||||
|
|
|
|||
|
|
@ -6741,6 +6741,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -3680,6 +3680,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Font.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\geometry\juce_AffineTransform.h"/>
|
||||
|
|
|
|||
|
|
@ -6321,6 +6321,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h">
|
||||
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -62,7 +62,10 @@ namespace
|
|||
{
|
||||
struct ConfiguredArrangement
|
||||
{
|
||||
void draw (const Graphics& g) const { arrangement.draw (g, transform); }
|
||||
void draw (const Graphics& g) const
|
||||
{
|
||||
arrangement.draw (g, transform);
|
||||
}
|
||||
|
||||
GlyphArrangement arrangement;
|
||||
AffineTransform transform;
|
||||
|
|
@ -80,56 +83,17 @@ namespace
|
|||
}
|
||||
|
||||
template <typename ConfigureArrangement>
|
||||
void draw (const Graphics& g, ArrangementArgs&& args, ConfigureArrangement&& configureArrangement)
|
||||
[[nodiscard]] auto get (ArrangementArgs&& args, ConfigureArrangement&& configureArrangement)
|
||||
{
|
||||
const ScopedTryLock stl (lock);
|
||||
|
||||
if (! stl.isLocked())
|
||||
{
|
||||
configureArrangement (args).draw (g);
|
||||
return;
|
||||
}
|
||||
|
||||
const auto cached = [&]
|
||||
{
|
||||
const auto iter = cache.find (args);
|
||||
|
||||
if (iter != cache.end())
|
||||
{
|
||||
if (iter->second.cachePosition != cacheOrder.begin())
|
||||
cacheOrder.splice (cacheOrder.begin(), cacheOrder, iter->second.cachePosition);
|
||||
|
||||
return iter;
|
||||
}
|
||||
|
||||
auto result = cache.emplace (std::move (args), CachedGlyphArrangement { configureArrangement (args), {} }).first;
|
||||
cacheOrder.push_front (result);
|
||||
return result;
|
||||
}();
|
||||
|
||||
cached->second.cachePosition = cacheOrder.begin();
|
||||
cached->second.configured.draw (g);
|
||||
|
||||
while (cache.size() > cacheSize)
|
||||
{
|
||||
cache.erase (cacheOrder.back());
|
||||
cacheOrder.pop_back();
|
||||
}
|
||||
return stl.isLocked() ? cache.get (args, std::forward<ConfigureArrangement> (configureArrangement))
|
||||
: configureArrangement (args);
|
||||
}
|
||||
|
||||
JUCE_DECLARE_SINGLETON (GlyphArrangementCache<ArrangementArgs>, false)
|
||||
|
||||
private:
|
||||
struct CachedGlyphArrangement
|
||||
{
|
||||
using CachePtr = typename std::map<ArrangementArgs, CachedGlyphArrangement>::const_iterator;
|
||||
ConfiguredArrangement configured;
|
||||
typename std::list<CachePtr>::const_iterator cachePosition;
|
||||
};
|
||||
|
||||
static constexpr size_t cacheSize = 128;
|
||||
std::map<ArrangementArgs, CachedGlyphArrangement> cache;
|
||||
std::list<typename CachedGlyphArrangement::CachePtr> cacheOrder;
|
||||
LruCache<ArrangementArgs, ConfiguredArrangement> cache;
|
||||
CriticalSection lock;
|
||||
};
|
||||
|
||||
|
|
@ -383,9 +347,9 @@ void Graphics::drawSingleLineText (const String& text, const int startX, const i
|
|||
return ConfiguredArrangement { std::move (arrangement), std::move (transform) };
|
||||
};
|
||||
|
||||
GlyphArrangementCache<ArrangementArgs>::getInstance()->draw (*this,
|
||||
{ context.getFont(), text, startX, baselineY, flags },
|
||||
std::move (configureArrangement));
|
||||
GlyphArrangementCache<ArrangementArgs>::getInstance()->get ({ context.getFont(), text, startX, baselineY, flags },
|
||||
std::move (configureArrangement))
|
||||
.draw (*this);
|
||||
}
|
||||
|
||||
void Graphics::drawMultiLineText (const String& text, const int startX,
|
||||
|
|
@ -416,9 +380,9 @@ void Graphics::drawMultiLineText (const String& text, const int startX,
|
|||
return ConfiguredArrangement { std::move (arrangement), {} };
|
||||
};
|
||||
|
||||
GlyphArrangementCache<ArrangementArgs>::getInstance()->draw (*this,
|
||||
{ context.getFont(), text, startX, baselineY, maximumLineWidth, justification, leading },
|
||||
std::move (configureArrangement));
|
||||
GlyphArrangementCache<ArrangementArgs>::getInstance()->get ({ context.getFont(), text, startX, baselineY, maximumLineWidth, justification, leading },
|
||||
std::move (configureArrangement))
|
||||
.draw (*this);
|
||||
}
|
||||
|
||||
void Graphics::drawText (const String& text, Rectangle<float> area,
|
||||
|
|
@ -451,9 +415,9 @@ void Graphics::drawText (const String& text, Rectangle<float> area,
|
|||
return ConfiguredArrangement { std::move (arrangement), {} };
|
||||
};
|
||||
|
||||
GlyphArrangementCache<ArrangementArgs>::getInstance()->draw (*this,
|
||||
{ context.getFont(), text, area, justificationType, useEllipsesIfTooBig },
|
||||
std::move (configureArrangement));
|
||||
GlyphArrangementCache<ArrangementArgs>::getInstance()->get ({ context.getFont(), text, area, justificationType, useEllipsesIfTooBig },
|
||||
std::move (configureArrangement))
|
||||
.draw (*this);
|
||||
}
|
||||
|
||||
void Graphics::drawText (const String& text, Rectangle<int> area,
|
||||
|
|
@ -501,9 +465,9 @@ void Graphics::drawFittedText (const String& text, Rectangle<int> area,
|
|||
return ConfiguredArrangement { std::move (arrangement), {} };
|
||||
};
|
||||
|
||||
GlyphArrangementCache<ArrangementArgs>::getInstance()->draw (*this,
|
||||
{ context.getFont(), text, area.toFloat(), justification, maximumNumberOfLines, minimumHorizontalScale },
|
||||
std::move (configureArrangement));
|
||||
GlyphArrangementCache<ArrangementArgs>::getInstance()->get ({ context.getFont(), text, area.toFloat(), justification, maximumNumberOfLines, minimumHorizontalScale },
|
||||
std::move (configureArrangement))
|
||||
.draw (*this);
|
||||
}
|
||||
|
||||
void Graphics::drawFittedText (const String& text, int x, int y, int width, int height,
|
||||
|
|
|
|||
84
modules/juce_graphics/fonts/juce_LruCache.h
Normal file
84
modules/juce_graphics/fonts/juce_LruCache.h
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE framework.
|
||||
Copyright (c) Raw Material Software Limited
|
||||
|
||||
JUCE is an open source framework subject to commercial or open source
|
||||
licensing.
|
||||
|
||||
By downloading, installing, or using the JUCE framework, or combining the
|
||||
JUCE framework with any other source code, object code, content or any other
|
||||
copyrightable work, you agree to the terms of the JUCE End User Licence
|
||||
Agreement, and all incorporated terms including the JUCE Privacy Policy and
|
||||
the JUCE Website Terms of Service, as applicable, which will bind you. If you
|
||||
do not agree to the terms of these agreements, we will not license the JUCE
|
||||
framework to you, and you must discontinue the installation or download
|
||||
process and cease use of the JUCE framework.
|
||||
|
||||
JUCE End User Licence Agreement: https://juce.com/legal/juce-8-licence/
|
||||
JUCE Privacy Policy: https://juce.com/juce-privacy-policy
|
||||
JUCE Website Terms of Service: https://juce.com/juce-website-terms-of-service/
|
||||
|
||||
Or:
|
||||
|
||||
You may also use this code under the terms of the AGPLv3:
|
||||
https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
|
||||
THE JUCE FRAMEWORK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL
|
||||
WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING WARRANTY OF
|
||||
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
template <typename Key, typename Value, size_t maxEntries = 128>
|
||||
class LruCache
|
||||
{
|
||||
public:
|
||||
template <typename Fn>
|
||||
Value get (Key key, Fn&& fn)
|
||||
{
|
||||
if (const auto iter = map.find (key); iter != map.end())
|
||||
{
|
||||
list.erase (iter->second.listIterator);
|
||||
iter->second.listIterator = list.insert (list.end(), iter);
|
||||
return iter->second.value;
|
||||
}
|
||||
|
||||
while (list.size() >= maxEntries)
|
||||
{
|
||||
const auto toRemove = list.begin();
|
||||
map.erase (*toRemove);
|
||||
list.erase (toRemove);
|
||||
}
|
||||
|
||||
auto value = fn (key);
|
||||
const auto mapIteratorPair = map.emplace (std::move (key), Pair { std::move (value), {} });
|
||||
|
||||
jassert (mapIteratorPair.second);
|
||||
|
||||
mapIteratorPair.first->second.listIterator = list.insert (list.end(), mapIteratorPair.first);
|
||||
return mapIteratorPair.first->second.value;
|
||||
}
|
||||
|
||||
private:
|
||||
struct Pair
|
||||
{
|
||||
using Map = std::map<Key, Pair>;
|
||||
using MapIterator = typename Map::const_iterator;
|
||||
using List = std::list<MapIterator>;
|
||||
using ListIterator = typename List::const_iterator;
|
||||
|
||||
Value value;
|
||||
ListIterator listIterator;
|
||||
};
|
||||
|
||||
typename Pair::Map map;
|
||||
typename Pair::List list;
|
||||
};
|
||||
|
||||
} // namespace juce
|
||||
|
|
@ -105,6 +105,7 @@
|
|||
|
||||
//==============================================================================
|
||||
#include "fonts/juce_FunctionPointerDestructor.h"
|
||||
#include "fonts/juce_LruCache.h"
|
||||
|
||||
#include "colour/juce_Colour.cpp"
|
||||
#include "colour/juce_ColourGradient.cpp"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue