Commits

Kent Quirk committed 6ad3d6f

SH-412 -- fix the way that redraws happen to eliminate flickering on resize -- patch from davep and seraph, I'm just applying it.

Comments (0)

Files changed (3)

indra/newview/llviewerdisplay.cpp

 BOOL gDisplaySwapBuffers = FALSE;
 BOOL gDepthDirty = FALSE;
 BOOL gResizeScreenTexture = FALSE;
+BOOL gWindowResized = FALSE;
 BOOL gSnapshot = FALSE;
 
 U32 gRecentFrameCount = 0; // number of 'recent' frames
 	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();
-		}
-	
+		glClear(GL_COLOR_BUFFER_BIT);
+		gViewerWindow->mWindow->swapBuffers();
+		gPipeline.resizeScreenTexture();
 		gResizeScreenTexture = FALSE;
-		gPipeline.resizeScreenTexture();
-
-		if (!for_snapshot)
-		{
-			return;
-		}
+		gWindowResized = FALSE;
+		return;
 	}
 
 	if (LLPipeline::sRenderDeferred)
 				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);

indra/newview/llviewerdisplay.h

 extern LLFrameTimer	gTeleportDisplayTimer;
 extern BOOL			gForceRenderLandFence;
 extern BOOL gResizeScreenTexture;
+extern BOOL gWindowResized;
 
 #endif // LL_LLVIEWERDISPLAY_H

indra/newview/llviewerwindow.cpp

 			return;
 		}
 
+		gWindowResized = TRUE;
+
 		// update our window rectangle
 		mWindowRectRaw.mRight = mWindowRectRaw.mLeft + width;
 		mWindowRectRaw.mTop = mWindowRectRaw.mBottom + height;
 		LLVOAvatar::restoreGL();
 		
 		gResizeScreenTexture = TRUE;
+		gWindowResized = TRUE;
 
 		if (isAgentAvatarValid() && !gAgentAvatarp->isUsingBakedTextures())
 		{
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.