aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llrender
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llrender/llfont.cpp37
-rw-r--r--linden/indra/llrender/llimagegl.cpp3
-rw-r--r--linden/indra/llrender/llimagegl.h1
3 files changed, 33 insertions, 8 deletions
diff --git a/linden/indra/llrender/llfont.cpp b/linden/indra/llrender/llfont.cpp
index ed787e0..b07d0d6 100644
--- a/linden/indra/llrender/llfont.cpp
+++ b/linden/indra/llrender/llfont.cpp
@@ -31,10 +31,11 @@
31#include "llfont.h" 31#include "llfont.h"
32 32
33// Freetype stuff 33// Freetype stuff
34#if LL_LINUX // I had to do some work to avoid the system-installed FreeType headers... --ryan. 34#if !defined(LL_LINUX) || defined(LL_STANDALONE)
35#include "llfreetype2/freetype/ft2build.h" 35# include <ft2build.h>
36#else 36#else
37#include <ft2build.h> 37// I had to do some work to avoid the system-installed FreeType headers... --ryan.
38# include "llfreetype2/freetype/ft2build.h"
38#endif 39#endif
39 40
40// For some reason, this won't work if it's not wrapped in the ifdef 41// For some reason, this won't work if it's not wrapped in the ifdef
@@ -178,11 +179,20 @@ F32 LLFont::getDescenderHeight() const
178 179
179BOOL LLFont::loadFace(const std::string& filename, const F32 point_size, const F32 vert_dpi, const F32 horz_dpi, const S32 components, BOOL is_fallback) 180BOOL LLFont::loadFace(const std::string& filename, const F32 point_size, const F32 vert_dpi, const F32 horz_dpi, const S32 components, BOOL is_fallback)
180{ 181{
182 // Don't leak face objects. This is also needed to deal with
183 // changed font file names.
184 if (mFTFace)
185 {
186 FT_Done_Face(mFTFace);
187 mFTFace = NULL;
188 }
189
181 int error; 190 int error;
191
182 error = FT_New_Face( gFTLibrary, 192 error = FT_New_Face( gFTLibrary,
183 filename.c_str(), 193 filename.c_str(),
184 0, 194 0,
185 &mFTFace ); 195 &mFTFace );
186 196
187 if (error) 197 if (error)
188 { 198 {
@@ -326,6 +336,9 @@ BOOL LLFont::hasGlyph(const llwchar wch) const
326 336
327BOOL LLFont::addChar(const llwchar wch) 337BOOL LLFont::addChar(const llwchar wch)
328{ 338{
339 if (mFTFace == NULL)
340 return FALSE;
341
329 llassert(!mIsFallback); 342 llassert(!mIsFallback);
330 //lldebugs << "Adding new glyph for " << wch << " to font" << llendl; 343 //lldebugs << "Adding new glyph for " << wch << " to font" << llendl;
331 344
@@ -378,6 +391,9 @@ void LLFont::insertGlyphInfo(llwchar wch, LLFontGlyphInfo* gi) const
378 391
379BOOL LLFont::addGlyphFromFont(LLFont *fontp, const llwchar wch, const U32 glyph_index) 392BOOL LLFont::addGlyphFromFont(LLFont *fontp, const llwchar wch, const U32 glyph_index)
380{ 393{
394 if (mFTFace == NULL)
395 return FALSE;
396
381 llassert(!mIsFallback); 397 llassert(!mIsFallback);
382 fontp->renderGlyph(glyph_index); 398 fontp->renderGlyph(glyph_index);
383 S32 width = fontp->mFTFace->glyph->bitmap.width; 399 S32 width = fontp->mFTFace->glyph->bitmap.width;
@@ -501,6 +517,9 @@ BOOL LLFont::addGlyph(const llwchar wch, const U32 glyph_index)
501 517
502F32 LLFont::getXAdvance(const llwchar wch) const 518F32 LLFont::getXAdvance(const llwchar wch) const
503{ 519{
520 if (mFTFace == NULL)
521 return 0.0;
522
504 llassert(!mIsFallback); 523 llassert(!mIsFallback);
505 U32 glyph_index; 524 U32 glyph_index;
506 525
@@ -569,6 +588,9 @@ F32 LLFont::getXAdvance(const llwchar wch) const
569 588
570void LLFont::renderGlyph(const U32 glyph_index) 589void LLFont::renderGlyph(const U32 glyph_index)
571{ 590{
591 if (mFTFace == NULL)
592 return;
593
572 int error = FT_Load_Glyph(mFTFace, glyph_index, FT_LOAD_DEFAULT ); 594 int error = FT_Load_Glyph(mFTFace, glyph_index, FT_LOAD_DEFAULT );
573 llassert(!error); 595 llassert(!error);
574 596
@@ -579,6 +601,9 @@ void LLFont::renderGlyph(const U32 glyph_index)
579 601
580F32 LLFont::getXKerning(const llwchar char_left, const llwchar char_right) const 602F32 LLFont::getXKerning(const llwchar char_left, const llwchar char_right) const
581{ 603{
604 if (mFTFace == NULL)
605 return 0.0;
606
582 llassert(!mIsFallback); 607 llassert(!mIsFallback);
583 LLFontGlyphInfo* left_glyph_info = get_if_there(mCharGlyphInfoMap, char_left, (LLFontGlyphInfo*)NULL); 608 LLFontGlyphInfo* left_glyph_info = get_if_there(mCharGlyphInfoMap, char_left, (LLFontGlyphInfo*)NULL);
584 U32 left_glyph = left_glyph_info ? left_glyph_info->mGlyphIndex : 0; 609 U32 left_glyph = left_glyph_info ? left_glyph_info->mGlyphIndex : 0;
diff --git a/linden/indra/llrender/llimagegl.cpp b/linden/indra/llrender/llimagegl.cpp
index e2c4a59..a2e5abc 100644
--- a/linden/indra/llrender/llimagegl.cpp
+++ b/linden/indra/llrender/llimagegl.cpp
@@ -963,7 +963,8 @@ BOOL LLImageGL::setDiscardLevel(S32 discard_level)
963 } 963 }
964 else 964 else
965 { 965 {
966#ifndef LL_LINUX // *FIX: This should not be skipped for the linux client. 966#if !LL_LINUX && !LL_SOLARIS
967 // *FIX: This should not be skipped for the linux client.
967 llerrs << "LLImageGL::setDiscardLevel() called on image without mipmaps" << llendl; 968 llerrs << "LLImageGL::setDiscardLevel() called on image without mipmaps" << llendl;
968#endif 969#endif
969 return FALSE; 970 return FALSE;
diff --git a/linden/indra/llrender/llimagegl.h b/linden/indra/llrender/llimagegl.h
index 16315ee..3bdd1c9 100644
--- a/linden/indra/llrender/llimagegl.h
+++ b/linden/indra/llrender/llimagegl.h
@@ -136,7 +136,6 @@ public:
136 // Various GL/Rendering options 136 // Various GL/Rendering options
137 S32 mTextureMemory; 137 S32 mTextureMemory;
138 mutable F32 mLastBindTime; // last time this was bound, by discard level 138 mutable F32 mLastBindTime; // last time this was bound, by discard level
139 mutable F32 mLastBindAttempt; // last time bindTexture was called on this texture
140 139
141private: 140private:
142 LLPointer<LLImageRaw> mSaveData; // used for destroyGL/restoreGL 141 LLPointer<LLImageRaw> mSaveData; // used for destroyGL/restoreGL