From cd468364a77ca184133f8c49c9042cefae5c6ce1 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 7 Mar 2012 17:26:43 -0600
Subject: [PATCH] MAINT-708 Don't compress UI textures.  Use GL_NICEST as
 compression hint to avoid artifacts.

---
 indra/llrender/llgl.cpp               | 2 +-
 indra/newview/llviewertexture.h       | 2 ++
 indra/newview/llviewertexturelist.cpp | 3 +++
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index b99465ee472..fdb674c433e 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -578,7 +578,7 @@ bool LLGLManager::initGL()
 
 	if (mGLVersion >= 3.f && LLImageGL::sCompressTextures)
 	{ //use texture compression
-		glHint(GL_TEXTURE_COMPRESSION_HINT, GL_FASTEST);
+		glHint(GL_TEXTURE_COMPRESSION_HINT, GL_NICEST);
 	}
 	else
 	{ //GL version is < 3.0, always disable texture compression
diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h
index 6b1654ae875..af8afef2031 100644
--- a/indra/newview/llviewertexture.h
+++ b/indra/newview/llviewertexture.h
@@ -264,6 +264,8 @@ class LLViewerTexture : public LLTexture
 	void setTexelsPerImage();
 private:
 	friend class LLBumpImageList;
+	friend class LLUIImageList;
+
 	//note: do not make this function public.
 	/*virtual*/ LLImageGL* getGLTexture() const ;
 	virtual void switchToCachedImage();
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 089f45ca899..f1555388a29 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -1432,6 +1432,9 @@ LLUIImagePtr LLUIImageList::loadUIImage(LLViewerFetchedTexture* imagep, const st
 
 	imagep->setAddressMode(LLTexUnit::TAM_CLAMP);
 
+	//don't compress UI images
+	imagep->getGLTexture()->setAllowCompression(false);
+
 	//all UI images are non-deletable
 	imagep->setNoDelete();
 
-- 
GitLab