diff --git a/Sources/libewol/ewol/ResourceManager.cpp b/Sources/libewol/ewol/ResourceManager.cpp index 7bad4c42..3e3a1e82 100644 --- a/Sources/libewol/ewol/ResourceManager.cpp +++ b/Sources/libewol/ewol/ResourceManager.cpp @@ -306,21 +306,41 @@ bool ewol::resource::Keep(ewol::Texture*& object) return true; } + +/** + * @brief get the next power 2 if the input + * @param[in] value Value that we want the next power of 2 + * @return result value + */ +static int32_t nextP2(int32_t value) +{ + int32_t val=1; + for (int32_t iii=1; iii<31; iii++) { + if (value <= val) { + return val; + } + val *=2; + } + EWOL_CRITICAL("impossible CASE...."); + return val; +} + bool ewol::resource::Keep(etk::UString& filename, ewol::TextureFile*& object, Vector2D size) { + Vector2D size2(nextP2(size.x), nextP2(size.y)); etk::UString TmpFilename = filename; TmpFilename += ":"; - TmpFilename += size.x; + TmpFilename += size2.x; TmpFilename += "x"; - TmpFilename += size.y; + TmpFilename += size2.y; - EWOL_VERBOSE("KEEP : TectureFile : file : \"" << TmpFilename << "\""); + EWOL_INFO("KEEP : TectureFile : file : \"" << TmpFilename << "\" basic size=" << size); object = static_cast(LocalKeep(TmpFilename)); if (NULL != object) { return true; } // need to crate a new one ... - object = new ewol::TextureFile(TmpFilename, filename, size); + object = new ewol::TextureFile(TmpFilename, filename, size2); if (NULL == object) { EWOL_ERROR("allocation error of a resource : " << filename); return false; diff --git a/Sources/libparsersvg b/Sources/libparsersvg index ec38558a..8f07ec9b 160000 --- a/Sources/libparsersvg +++ b/Sources/libparsersvg @@ -1 +1 @@ -Subproject commit ec38558a103d10d6b3116dc34237201fb2934e16 +Subproject commit 8f07ec9b7c9720c55743128a6e1ed97f81242770