aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llrender/llfontgl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llrender/llfontgl.cpp')
-rw-r--r--linden/indra/llrender/llfontgl.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/linden/indra/llrender/llfontgl.cpp b/linden/indra/llrender/llfontgl.cpp
index a328196..526f1a9 100644
--- a/linden/indra/llrender/llfontgl.cpp
+++ b/linden/indra/llrender/llfontgl.cpp
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$ 5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2001-2008, Linden Research, Inc. 7 * Copyright (c) 2001-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -148,7 +148,7 @@ void LLFontGL::init()
148 { 148 {
149 mImageGLp = new LLImageGL(FALSE); 149 mImageGLp = new LLImageGL(FALSE);
150 //RN: use nearest mipmap filtering to obviate the need to do pixel-accurate positioning 150 //RN: use nearest mipmap filtering to obviate the need to do pixel-accurate positioning
151 mImageGLp->bind(); 151 gGL.getTexUnit(0)->bind(mImageGLp);
152 // we allow bilinear filtering to get sub-pixel positioning for drop shadows 152 // we allow bilinear filtering to get sub-pixel positioning for drop shadows
153 //mImageGLp->setMipFilterNearest(TRUE, TRUE); 153 //mImageGLp->setMipFilterNearest(TRUE, TRUE);
154 } 154 }
@@ -533,7 +533,7 @@ BOOL LLFontGL::loadFace(const std::string& filename,
533 return FALSE; 533 return FALSE;
534 } 534 }
535 mImageGLp->createGLTexture(0, mRawImageGLp); 535 mImageGLp->createGLTexture(0, mRawImageGLp);
536 mImageGLp->bind(); 536 gGL.getTexUnit(0)->bind(mImageGLp);
537 mImageGLp->setMipFilterNearest(TRUE, TRUE); 537 mImageGLp->setMipFilterNearest(TRUE, TRUE);
538 return TRUE; 538 return TRUE;
539} 539}
@@ -547,7 +547,7 @@ BOOL LLFontGL::addChar(const llwchar wch)
547 547
548 stop_glerror(); 548 stop_glerror();
549 mImageGLp->setSubImage(mRawImageGLp, 0, 0, mImageGLp->getWidth(), mImageGLp->getHeight()); 549 mImageGLp->setSubImage(mRawImageGLp, 0, 0, mImageGLp->getWidth(), mImageGLp->getHeight());
550 mImageGLp->bind(); 550 gGL.getTexUnit(0)->bind(mImageGLp);
551 mImageGLp->setMipFilterNearest(TRUE, TRUE); 551 mImageGLp->setMipFilterNearest(TRUE, TRUE);
552 stop_glerror(); 552 stop_glerror();
553 return TRUE; 553 return TRUE;
@@ -583,7 +583,7 @@ S32 LLFontGL::render(const LLWString &wstr,
583 return wstr.length() ; 583 return wstr.length() ;
584 } 584 }
585 585
586 LLGLEnable tex(GL_TEXTURE_2D); 586 gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
587 587
588 if (wstr.empty()) 588 if (wstr.empty())
589 { 589 {
@@ -663,7 +663,7 @@ S32 LLFontGL::render(const LLWString &wstr,
663 663
664 // Bind the font texture 664 // Bind the font texture
665 665
666 mImageGLp->bind(0); 666 gGL.getTexUnit(0)->bind(mImageGLp);
667 667
668 // Not guaranteed to be set correctly 668 // Not guaranteed to be set correctly
669 gGL.setSceneBlendType(LLRender::BT_ALPHA); 669 gGL.setSceneBlendType(LLRender::BT_ALPHA);
@@ -761,7 +761,7 @@ S32 LLFontGL::render(const LLWString &wstr,
761 break; 761 break;
762 } 762 }
763 763
764 ext_image->bind(); 764 gGL.getTexUnit(0)->bind(ext_image);
765 const F32 ext_x = cur_render_x + (EXT_X_BEARING * sScaleX); 765 const F32 ext_x = cur_render_x + (EXT_X_BEARING * sScaleX);
766 const F32 ext_y = cur_render_y + (EXT_Y_BEARING * sScaleY + mAscender - mLineHeight); 766 const F32 ext_y = cur_render_y + (EXT_Y_BEARING * sScaleY + mAscender - mLineHeight);
767 767
@@ -795,7 +795,7 @@ S32 LLFontGL::render(const LLWString &wstr,
795 cur_render_x = cur_x; 795 cur_render_x = cur_x;
796 796
797 // Bind the font texture 797 // Bind the font texture
798 mImageGLp->bind(); 798 gGL.getTexUnit(0)->bind(mImageGLp);
799 } 799 }
800 else 800 else
801 { 801 {
@@ -863,8 +863,8 @@ S32 LLFontGL::render(const LLWString &wstr,
863 863
864 if (style & UNDERLINE) 864 if (style & UNDERLINE)
865 { 865 {
866 LLGLSNoTexture no_texture; 866 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
867 gGL.begin(LLVertexBuffer::LINES); 867 gGL.begin(LLRender::LINES);
868 gGL.vertex2f(start_x, cur_y - (mDescender)); 868 gGL.vertex2f(start_x, cur_y - (mDescender));
869 gGL.vertex2f(cur_x, cur_y - (mDescender)); 869 gGL.vertex2f(cur_x, cur_y - (mDescender));
870 gGL.end(); 870 gGL.end();
@@ -1359,7 +1359,7 @@ void LLFontGL::drawGlyph(const LLRectf& screen_rect, const LLRectf& uv_rect, con
1359 F32 slant_offset; 1359 F32 slant_offset;
1360 slant_offset = ((style & ITALIC) ? ( -mAscender * 0.2f) : 0.f); 1360 slant_offset = ((style & ITALIC) ? ( -mAscender * 0.2f) : 0.f);
1361 1361
1362 gGL.begin(LLVertexBuffer::QUADS); 1362 gGL.begin(LLRender::QUADS);
1363 { 1363 {
1364 //FIXME: bold and drop shadow are mutually exclusive only for convenience 1364 //FIXME: bold and drop shadow are mutually exclusive only for convenience
1365 //Allow both when we need them. 1365 //Allow both when we need them.