From 936fbd096f3cf1df506bf98a7dd9bece5391b624 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sat, 31 Mar 2018 21:29:33 +0000 Subject: 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 --- src/drivers/Android/Fl_Android_Graphics_Font.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/drivers/Android/Fl_Android_Graphics_Font.cxx') 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; } -- cgit v1.2.3