summaryrefslogtreecommitdiff
path: root/src/drivers/Android/Fl_Android_Graphics_Font.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2018-03-31 21:29:33 +0000
committerMatthias Melcher <fltk@matthiasm.com>2018-03-31 21:29:33 +0000
commit936fbd096f3cf1df506bf98a7dd9bece5391b624 (patch)
treefe873e6e4c3fd1a5304971be6ec8847dd2a48199 /src/drivers/Android/Fl_Android_Graphics_Font.cxx
parente4916d617e989faefa8f8c1004e20174a0efcbdb (diff)
Android: Drawing RGB image data (and probaly rgba and grayscale as well). Testing unsing test/color_chooser.cxx
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12817 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Android/Fl_Android_Graphics_Font.cxx')
-rw-r--r--src/drivers/Android/Fl_Android_Graphics_Font.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/drivers/Android/Fl_Android_Graphics_Font.cxx b/src/drivers/Android/Fl_Android_Graphics_Font.cxx
index 18ad02e2c..f15a0c585 100644
--- a/src/drivers/Android/Fl_Android_Graphics_Font.cxx
+++ b/src/drivers/Android/Fl_Android_Graphics_Font.cxx
@@ -476,10 +476,16 @@ Fl_Android_Font_Descriptor::Fl_Android_Font_Descriptor(const char *fname, Fl_And
*/
Fl_Android_Font_Descriptor::~Fl_Android_Font_Descriptor()
{
+#ifdef FL_ALLOW_STL
// Life is easy in C++11.
for (auto &i: pBytemapTable) {
delete i.second; i.second = nullptr;
}
+#else
+ for (int i=0; i<256; i++) {
+ if (pBytemapTable[i]) delete pBytemapTable[i];
+ }
+#endif
}
/*
@@ -508,6 +514,7 @@ float Fl_Android_Font_Descriptor::get_advance(uint32_t c)
Fl_Android_Bytemap *Fl_Android_Font_Descriptor::get_bytemap(uint32_t c)
{
Fl_Android_Bytemap *bm = 0;
+#ifdef FL_ALLOW_STL
auto it = pBytemapTable.find(c);
if (it==pBytemapTable.end()) {
bm = pFontSource->get_bytemap(c, size);
@@ -516,6 +523,17 @@ Fl_Android_Bytemap *Fl_Android_Font_Descriptor::get_bytemap(uint32_t c)
} else {
bm = it->second;
}
+#else
+ if (c<256) {
+ if (pBytemapTable[c]) {
+ bm = pBytemapTable[c];
+ } else {
+ bm = pFontSource->get_bytemap(c, size);
+ if (bm)
+ pBytemapTable[c] = bm;
+ }
+ }
+#endif
return bm;
}