From 3758618949684641fc94b5c9478d9002706213cc Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 17 Apr 2024 02:49:18 +0300 Subject: viewer#1260 Fix thumbnail preview being blury 1. Switched 'inspect' to thumbnails to minimalize differences 2. Reporting larger area to bump priority 3. Change scaling behavior. Old mechanics worked fine for icons that were scaled down from large images to ~32, but for thumbnails it can result in 256 image scaling down to ~200 before being scaled up to UI's scale (scale factor), causing extra loss of quality. --- indra/newview/llthumbnailctrl.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'indra/newview/llthumbnailctrl.cpp') diff --git a/indra/newview/llthumbnailctrl.cpp b/indra/newview/llthumbnailctrl.cpp index b558c249cb..1cabb62f77 100644 --- a/indra/newview/llthumbnailctrl.cpp +++ b/indra/newview/llthumbnailctrl.cpp @@ -110,8 +110,10 @@ void LLThumbnailCtrl::draw() } gl_draw_scaled_image( draw_rect.mLeft, draw_rect.mBottom, draw_rect.getWidth(), draw_rect.getHeight(), mTexturep, UI_VERTEX_COLOR % alpha); - - mTexturep->setKnownDrawSize(draw_rect.getWidth(), draw_rect.getHeight()); + + // Thumbnails are usually 256x256 or smaller, either report that or + // some high value to get image with higher priority + mTexturep->setKnownDrawSize(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE); } else if( mImagep.notNull() ) { @@ -238,12 +240,8 @@ void LLThumbnailCtrl::initImage() { // Should it support baked textures? mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, MIPMAP_YES, LLGLTexture::BOOST_THUMBNAIL); - mTexturep->forceToSaveRawImage(0); - - S32 desired_draw_width = MAX_IMAGE_SIZE; - S32 desired_draw_height = MAX_IMAGE_SIZE; - mTexturep->setKnownDrawSize(desired_draw_width, desired_draw_height); + mTexturep->setKnownDrawSize(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE); } } else if (tvalue.isString()) -- cgit v1.2.3