summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-02-07 22:07:02 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-02-07 23:27:30 +0200
commit3a251b1b9e753589dd12e25236e77275c9010566 (patch)
tree694e012d5ea4662ba57f32c12fa5e86a3df0f56b /indra
parent1924241f04699683e697f93388d634022d10aa32 (diff)
#3332 Switching screens can break text rendering
Diffstat (limited to 'indra')
-rw-r--r--indra/llrender/llfontgl.cpp1
-rw-r--r--indra/llrender/llfontgl.h1
-rw-r--r--indra/llrender/llfontvertexbuffer.cpp4
-rw-r--r--indra/llrender/llfontvertexbuffer.h1
-rw-r--r--indra/newview/llviewerwindow.cpp1
5 files changed, 7 insertions, 1 deletions
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 4c9a062246..4d4eaf1a9a 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -58,6 +58,7 @@ F32 LLFontGL::sVertDPI = 96.f;
F32 LLFontGL::sHorizDPI = 96.f;
F32 LLFontGL::sScaleX = 1.f;
F32 LLFontGL::sScaleY = 1.f;
+S32 LLFontGL::sResolutionGeneration = 0;
bool LLFontGL::sDisplayFont = true ;
std::string LLFontGL::sAppDir;
diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h
index 4bb6c55c65..9b63fc7c38 100644
--- a/indra/llrender/llfontgl.h
+++ b/indra/llrender/llfontgl.h
@@ -224,6 +224,7 @@ public:
static F32 sHorizDPI;
static F32 sScaleX;
static F32 sScaleY;
+ static S32 sResolutionGeneration;
static bool sDisplayFont ;
static std::string sAppDir; // For loading fonts
diff --git a/indra/llrender/llfontvertexbuffer.cpp b/indra/llrender/llfontvertexbuffer.cpp
index 5bd1ca5eed..17b23c420d 100644
--- a/indra/llrender/llfontvertexbuffer.cpp
+++ b/indra/llrender/llfontvertexbuffer.cpp
@@ -146,7 +146,8 @@ S32 LLFontVertexBuffer::render(
|| mLastScaleY != LLFontGL::sScaleY
|| mLastVertDPI != LLFontGL::sVertDPI
|| mLastHorizDPI != LLFontGL::sHorizDPI
- || mLastOrigin != LLFontGL::sCurOrigin)
+ || mLastOrigin != LLFontGL::sCurOrigin
+ || mLastResGeneration != LLFontGL::sResolutionGeneration)
{
genBuffers(fontp, text, begin_offset, x, y, color, halign, valign,
style, shadow, max_chars, max_pixels, right_x, use_ellipses, use_color);
@@ -201,6 +202,7 @@ void LLFontVertexBuffer::genBuffers(
mLastVertDPI = LLFontGL::sVertDPI;
mLastHorizDPI = LLFontGL::sHorizDPI;
mLastOrigin = LLFontGL::sCurOrigin;
+ mLastResGeneration = LLFontGL::sResolutionGeneration;
if (right_x)
{
diff --git a/indra/llrender/llfontvertexbuffer.h b/indra/llrender/llfontvertexbuffer.h
index af195dfff9..f244e7fefa 100644
--- a/indra/llrender/llfontvertexbuffer.h
+++ b/indra/llrender/llfontvertexbuffer.h
@@ -117,6 +117,7 @@ private:
F32 mLastScaleY = 1.f;
F32 mLastVertDPI = 0.f;
F32 mLastHorizDPI = 0.f;
+ S32 mLastResGeneration = 0;
LLCoordGL mLastOrigin;
static bool sEnableBufferCollection;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 8a5aac9b8b..8915e68298 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1750,6 +1750,7 @@ bool LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32
{
LLViewerWindow::reshape(window_width, window_height);
mResDirty = true;
+ LLFontGL::sResolutionGeneration++;
return true;
}
else