summaryrefslogtreecommitdiff
path: root/vcl/workben
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-05-19 16:36:36 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-05-22 13:28:50 +0200
commitf73980ed151e3d04b02cc463cf9fd6432f14ba03 (patch)
tree97c5ae2757221b4bc7f56aa90bc12d252301c66a /vcl/workben
parent78b7e1dfba4fb776db801c478a830057ff67d965 (diff)
Related: tdf#132536 drop FreetypeManager FreetypeFont caching
the FreetypeFont only makes sense in the context of the FreetypeFontInstance it belongs to so remove the faux "garbage collection" and just have FreetypeFontInstance own the FreetypeFont and keep it simple. Setting a value low enough to make the garbage collection kick in just crasheed libreoffice by pulling FreetypeFont out from under living FreetypeFontInstance seeing as the Cache/Uncache was by the FreeTypeTextRenderImpl not the FreetypeFontInstance which had HarfBuff faces which continued to point to the removed FreetypeFont There is still a cache at the LogicalFontInstance level, so this aligns the libfreetype platforms with windows, mac etc. Change-Id: Iac669fae8dc1df81a5bc10d2943d84a2ff623180 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94546 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/workben')
-rw-r--r--vcl/workben/docxfuzzer.cxx4
-rw-r--r--vcl/workben/fodpfuzzer.cxx4
-rw-r--r--vcl/workben/fodsfuzzer.cxx4
-rw-r--r--vcl/workben/fodtfuzzer.cxx4
-rw-r--r--vcl/workben/htmlfuzzer.cxx4
-rw-r--r--vcl/workben/mmlfuzzer.cxx4
-rw-r--r--vcl/workben/pptfuzzer.cxx4
-rw-r--r--vcl/workben/pptxfuzzer.cxx4
-rw-r--r--vcl/workben/rtffuzzer.cxx4
-rw-r--r--vcl/workben/scrtffuzzer.cxx4
-rw-r--r--vcl/workben/wksfuzzer.cxx4
-rw-r--r--vcl/workben/wmffuzzer.cxx4
-rw-r--r--vcl/workben/ww2fuzzer.cxx4
-rw-r--r--vcl/workben/ww6fuzzer.cxx4
-rw-r--r--vcl/workben/ww8fuzzer.cxx4
-rw-r--r--vcl/workben/xlsfuzzer.cxx4
-rw-r--r--vcl/workben/xlsxfuzzer.cxx4
17 files changed, 0 insertions, 68 deletions
diff --git a/vcl/workben/docxfuzzer.cxx b/vcl/workben/docxfuzzer.cxx
index 89766618b982..4e116c6002cf 100644
--- a/vcl/workben/docxfuzzer.cxx
+++ b/vcl/workben/docxfuzzer.cxx
@@ -33,10 +33,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
(void)TestImportDOCX(aStream);
- //fontconfigs alloc mechanism is too complicated for lsan/valgrind so
- //force the fontconfig options to be released now, they are demand loaded
- //so will be recreated if necessary
- FreetypeManager::get().ClearFontOptions();
return 0;
}
diff --git a/vcl/workben/fodpfuzzer.cxx b/vcl/workben/fodpfuzzer.cxx
index 12bfbc353ae0..603849742783 100644
--- a/vcl/workben/fodpfuzzer.cxx
+++ b/vcl/workben/fodpfuzzer.cxx
@@ -33,10 +33,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
(void)TestImportFODP(aStream);
- //fontconfigs alloc mechanism is too complicated for lsan/valgrind so
- //force the fontconfig options to be released now, they are demand loaded
- //so will be recreated if necessary
- FreetypeManager::get().ClearFontOptions();
return 0;
}
diff --git a/vcl/workben/fodsfuzzer.cxx b/vcl/workben/fodsfuzzer.cxx
index 030ac147b77e..ed9efd6e3975 100644
--- a/vcl/workben/fodsfuzzer.cxx
+++ b/vcl/workben/fodsfuzzer.cxx
@@ -28,10 +28,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
(void)TestImportFODS(aStream);
- //fontconfigs alloc mechanism is too complicated for lsan/valgrind so
- //force the fontconfig options to be released now, they are demand loaded
- //so will be recreated if necessary
- FreetypeManager::get().ClearFontOptions();
return 0;
}
diff --git a/vcl/workben/fodtfuzzer.cxx b/vcl/workben/fodtfuzzer.cxx
index 2b110212a57e..54ae26622b7b 100644
--- a/vcl/workben/fodtfuzzer.cxx
+++ b/vcl/workben/fodtfuzzer.cxx
@@ -33,10 +33,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
(void)TestImportFODT(aStream);
- //fontconfigs alloc mechanism is too complicated for lsan/valgrind so
- //force the fontconfig options to be released now, they are demand loaded
- //so will be recreated if necessary
- FreetypeManager::get().ClearFontOptions();
return 0;
}
diff --git a/vcl/workben/htmlfuzzer.cxx b/vcl/workben/htmlfuzzer.cxx
index fbeec9f3a4f1..6da6c853f3bb 100644
--- a/vcl/workben/htmlfuzzer.cxx
+++ b/vcl/workben/htmlfuzzer.cxx
@@ -27,10 +27,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
(void)TestImportHTML(aStream);
- //fontconfigs alloc mechanism is too complicated for lsan/valgrind so
- //force the fontconfig options to be released now, they are demand loaded
- //so will be recreated if necessary
- FreetypeManager::get().ClearFontOptions();
return 0;
}
diff --git a/vcl/workben/mmlfuzzer.cxx b/vcl/workben/mmlfuzzer.cxx
index 02bd50236e93..8811c2743a15 100644
--- a/vcl/workben/mmlfuzzer.cxx
+++ b/vcl/workben/mmlfuzzer.cxx
@@ -23,10 +23,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
(void)TestImportMML(aStream);
- //fontconfigs alloc mechanism is too complicated for lsan/valgrind so
- //force the fontconfig options to be released now, they are demand loaded
- //so will be recreated if necessary
- FreetypeManager::get().ClearFontOptions();
return 0;
}
diff --git a/vcl/workben/pptfuzzer.cxx b/vcl/workben/pptfuzzer.cxx
index 6e725b554e31..d7f6b73f986e 100644
--- a/vcl/workben/pptfuzzer.cxx
+++ b/vcl/workben/pptfuzzer.cxx
@@ -129,10 +129,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
(void)TestImportPPT(aStream);
- //fontconfigs alloc mechanism is too complicated for lsan/valgrind so
- //force the fontconfig options to be released now, they are demand loaded
- //so will be recreated if necessary
- FreetypeManager::get().ClearFontOptions();
return 0;
}
diff --git a/vcl/workben/pptxfuzzer.cxx b/vcl/workben/pptxfuzzer.cxx
index 021bc398de64..976b53d9ba1c 100644
--- a/vcl/workben/pptxfuzzer.cxx
+++ b/vcl/workben/pptxfuzzer.cxx
@@ -27,10 +27,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
(void)TestImportPPTX(aStream);
- //fontconfigs alloc mechanism is too complicated for lsan/valgrind so
- //force the fontconfig options to be released now, they are demand loaded
- //so will be recreated if necessary
- FreetypeManager::get().ClearFontOptions();
return 0;
}
diff --git a/vcl/workben/rtffuzzer.cxx b/vcl/workben/rtffuzzer.cxx
index cc109fcfdb6e..5f2ac75e83e8 100644
--- a/vcl/workben/rtffuzzer.cxx
+++ b/vcl/workben/rtffuzzer.cxx
@@ -84,10 +84,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
(void)TestImportRTF(aStream);
- //fontconfigs alloc mechanism is too complicated for lsan/valgrind so
- //force the fontconfig options to be released now, they are demand loaded
- //so will be recreated if necessary
- FreetypeManager::get().ClearFontOptions();
return 0;
}
diff --git a/vcl/workben/scrtffuzzer.cxx b/vcl/workben/scrtffuzzer.cxx
index 0afaf8fbe97b..779519f34336 100644
--- a/vcl/workben/scrtffuzzer.cxx
+++ b/vcl/workben/scrtffuzzer.cxx
@@ -77,10 +77,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
(void)TestImportCalcRTF(aStream);
- //fontconfigs alloc mechanism is too complicated for lsan/valgrind so
- //force the fontconfig options to be released now, they are demand loaded
- //so will be recreated if necessary
- FreetypeManager::get().ClearFontOptions();
return 0;
}
diff --git a/vcl/workben/wksfuzzer.cxx b/vcl/workben/wksfuzzer.cxx
index 617bce16cc9b..3edacb48411c 100644
--- a/vcl/workben/wksfuzzer.cxx
+++ b/vcl/workben/wksfuzzer.cxx
@@ -47,10 +47,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
(void)TestImportWKS(aStream);
- // fontconfigs alloc mechanism is too complicated for lsan/valgrind so
- // force the fontconfig options to be released now, they are demand loaded
- // so will be recreated if necessary
- FreetypeManager::get().ClearFontOptions();
return 0;
}
diff --git a/vcl/workben/wmffuzzer.cxx b/vcl/workben/wmffuzzer.cxx
index ebb9c4cd4cd7..7ce9ff90d569 100644
--- a/vcl/workben/wmffuzzer.cxx
+++ b/vcl/workben/wmffuzzer.cxx
@@ -62,10 +62,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
GDIMetaFile aGDIMetaFile;
(void)ReadWindowMetafile(aStream, aGDIMetaFile);
- //fontconfigs alloc mechanism is too complicated for lsan/valgrind so
- //force the fontconfig options to be released now, they are demand loaded
- //so will be recreated if necessary
- FreetypeManager::get().ClearFontOptions();
return 0;
}
diff --git a/vcl/workben/ww2fuzzer.cxx b/vcl/workben/ww2fuzzer.cxx
index 5e743ee62cc3..24038ae166ed 100644
--- a/vcl/workben/ww2fuzzer.cxx
+++ b/vcl/workben/ww2fuzzer.cxx
@@ -98,10 +98,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
(void)TestImportWW2(aStream);
- //fontconfigs alloc mechanism is too complicated for lsan/valgrind so
- //force the fontconfig options to be released now, they are demand loaded
- //so will be recreated if necessary
- FreetypeManager::get().ClearFontOptions();
return 0;
}
diff --git a/vcl/workben/ww6fuzzer.cxx b/vcl/workben/ww6fuzzer.cxx
index ceba3ff0b883..56db11981d54 100644
--- a/vcl/workben/ww6fuzzer.cxx
+++ b/vcl/workben/ww6fuzzer.cxx
@@ -100,10 +100,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
(void)TestImportWW6(aStream);
- //fontconfigs alloc mechanism is too complicated for lsan/valgrind so
- //force the fontconfig options to be released now, they are demand loaded
- //so will be recreated if necessary
- FreetypeManager::get().ClearFontOptions();
return 0;
}
diff --git a/vcl/workben/ww8fuzzer.cxx b/vcl/workben/ww8fuzzer.cxx
index cdb2cbe89a8b..d8613afcd1fa 100644
--- a/vcl/workben/ww8fuzzer.cxx
+++ b/vcl/workben/ww8fuzzer.cxx
@@ -100,10 +100,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
(void)TestImportWW8(aStream);
- //fontconfigs alloc mechanism is too complicated for lsan/valgrind so
- //force the fontconfig options to be released now, they are demand loaded
- //so will be recreated if necessary
- FreetypeManager::get().ClearFontOptions();
return 0;
}
diff --git a/vcl/workben/xlsfuzzer.cxx b/vcl/workben/xlsfuzzer.cxx
index 14d9eea2622f..893110988b3d 100644
--- a/vcl/workben/xlsfuzzer.cxx
+++ b/vcl/workben/xlsfuzzer.cxx
@@ -47,10 +47,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
(void)TestImportXLS(aStream);
- //fontconfigs alloc mechanism is too complicated for lsan/valgrind so
- //force the fontconfig options to be released now, they are demand loaded
- //so will be recreated if necessary
- FreetypeManager::get().ClearFontOptions();
return 0;
}
diff --git a/vcl/workben/xlsxfuzzer.cxx b/vcl/workben/xlsxfuzzer.cxx
index 79ad9e0bcff7..a325bd69fa94 100644
--- a/vcl/workben/xlsxfuzzer.cxx
+++ b/vcl/workben/xlsxfuzzer.cxx
@@ -25,10 +25,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
(void)TestImportXLSX(aStream);
- //fontconfigs alloc mechanism is too complicated for lsan/valgrind so
- //force the fontconfig options to be released now, they are demand loaded
- //so will be recreated if necessary
- FreetypeManager::get().ClearFontOptions();
return 0;
}