diff options
author | Kitty Barnett <develop@catznip.com> | 2023-02-08 14:52:16 +0100 |
---|---|---|
committer | Kitty Barnett <develop@catznip.com> | 2023-02-08 14:52:16 +0100 |
commit | 5805bbd8104e66fb9ae7ed3c22e374e377b2f2e1 (patch) | |
tree | aeea23255f4717f57012d5d42075659ecff6c76a /indra/llrender | |
parent | da0335c864477036ba996fbab4db2194535466d7 (diff) | |
parent | b2f890408e2dc63a0f842273c41c0efed770cb9a (diff) |
Merge branch 'DRTVWR-489-emoji' of https://github.com/secondlife/viewer into DRTVWR-489-emoji
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llfontbitmapcache.cpp | 14 | ||||
-rw-r--r-- | indra/llrender/llfontfreetype.cpp | 4 |
2 files changed, 16 insertions, 2 deletions
diff --git a/indra/llrender/llfontbitmapcache.cpp b/indra/llrender/llfontbitmapcache.cpp index 8809f9f475..42b0045cf3 100644 --- a/indra/llrender/llfontbitmapcache.cpp +++ b/indra/llrender/llfontbitmapcache.cpp @@ -92,6 +92,20 @@ BOOL LLFontBitmapCache::nextOpenPos(S32 width, S32& pos_x, S32& pos_y, EFontGlyp { // We're out of space in the current image, or no image // has been allocated yet. Make a new one. + + S32 image_width = mMaxCharWidth * 20; + S32 pow_iw = 2; + while (pow_iw < image_width) + { + pow_iw *= 2; + } + image_width = pow_iw; + image_width = llmin(512, image_width); // Don't make bigger than 512x512, ever. + S32 image_height = image_width; + + mBitmapWidth = image_width; + mBitmapHeight = image_height; + S32 num_components = getNumComponents(bitmap_type); mImageRawVec[bitmap_idx].push_back(new LLImageRaw(mBitmapWidth, mBitmapHeight, num_components)); bitmap_num = mImageRawVec[bitmap_idx].size() - 1; diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index 5535c07615..e4010579b3 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -798,11 +798,11 @@ void LLFontFreetype::setSubImageLuminanceAlpha(U32 x, U32 y, U32 bitmap_num, U32 llassert(!mIsFallback); llassert(image_raw && (image_raw->getComponents() == 2)); - U8 *target = image_raw->getData(); + llassert(target); - if (!data) + if (!data || !target) { return; } |