summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Quirk <q@lindenlab.com>2010-11-09 15:18:41 -0500
committerKent Quirk <q@lindenlab.com>2010-11-09 15:18:41 -0500
commitdc59b268dc8f462b2b47de9cc6e2fa4473f7eeb9 (patch)
treeeef23b1baf835851fb95606f54eddca4f43af6ac
parent451d115c1009ded2b2d74efefbe0611c62343eed (diff)
SH-412 -- fix the way that redraws happen to eliminate flickering on resize -- patch from davep and seraph, I'm just applying it.
-rw-r--r--indra/newview/llviewerdisplay.cpp32
-rw-r--r--indra/newview/llviewerdisplay.h1
-rw-r--r--indra/newview/llviewerwindow.cpp3
3 files changed, 17 insertions, 19 deletions
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 40583f05bf..dbb3f9a7d0 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -95,6 +95,7 @@ BOOL gForceRenderLandFence = FALSE;
BOOL gDisplaySwapBuffers = FALSE;
BOOL gDepthDirty = FALSE;
BOOL gResizeScreenTexture = FALSE;
+BOOL gWindowResized = FALSE;
BOOL gSnapshot = FALSE;
U32 gRecentFrameCount = 0; // number of 'recent' frames
@@ -218,22 +219,15 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
LLMemType mt_render(LLMemType::MTYPE_RENDER);
LLFastTimer t(FTM_RENDER);
- if (gResizeScreenTexture)
- { //skip render on frames where screen texture is resizing
+ if (gWindowResized)
+ { //skip render on frames where window has been resized
gGL.flush();
- if (!for_snapshot)
- {
- glClear(GL_COLOR_BUFFER_BIT);
- gViewerWindow->mWindow->swapBuffers();
- }
-
- gResizeScreenTexture = FALSE;
+ glClear(GL_COLOR_BUFFER_BIT);
+ gViewerWindow->mWindow->swapBuffers();
gPipeline.resizeScreenTexture();
-
- if (!for_snapshot)
- {
- return;
- }
+ gResizeScreenTexture = FALSE;
+ gWindowResized = FALSE;
+ return;
}
if (LLPipeline::sRenderDeferred)
@@ -665,11 +659,11 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
LLVertexBuffer::clientCopy(0.016);
}
- //if (gResizeScreenTexture)
- //{
- // gResizeScreenTexture = FALSE;
- // gPipeline.resizeScreenTexture();
- //}
+ if (gResizeScreenTexture)
+ {
+ gResizeScreenTexture = FALSE;
+ gPipeline.resizeScreenTexture();
+ }
gGL.setColorMask(true, true);
glClearColor(0,0,0,0);
diff --git a/indra/newview/llviewerdisplay.h b/indra/newview/llviewerdisplay.h
index c6e86751e8..f6467d7f93 100644
--- a/indra/newview/llviewerdisplay.h
+++ b/indra/newview/llviewerdisplay.h
@@ -40,5 +40,6 @@ extern BOOL gTeleportDisplay;
extern LLFrameTimer gTeleportDisplayTimer;
extern BOOL gForceRenderLandFence;
extern BOOL gResizeScreenTexture;
+extern BOOL gWindowResized;
#endif // LL_LLVIEWERDISPLAY_H
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index ebcb6e3738..761df557f5 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1839,6 +1839,8 @@ void LLViewerWindow::reshape(S32 width, S32 height)
return;
}
+ gWindowResized = TRUE;
+
// update our window rectangle
mWindowRectRaw.mRight = mWindowRectRaw.mLeft + width;
mWindowRectRaw.mTop = mWindowRectRaw.mBottom + height;
@@ -4415,6 +4417,7 @@ void LLViewerWindow::restoreGL(const std::string& progress_message)
LLVOAvatar::restoreGL();
gResizeScreenTexture = TRUE;
+ gWindowResized = TRUE;
if (isAgentAvatarValid() && !gAgentAvatarp->isUsingBakedTextures())
{