diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llviewerdisplay.cpp | 68 |
1 files changed, 15 insertions, 53 deletions
diff --git a/linden/indra/newview/llviewerdisplay.cpp b/linden/indra/newview/llviewerdisplay.cpp index 4db26a0..40bb83c 100644 --- a/linden/indra/newview/llviewerdisplay.cpp +++ b/linden/indra/newview/llviewerdisplay.cpp | |||
@@ -113,7 +113,6 @@ void render_ui_3d(); | |||
113 | void render_ui_2d(); | 113 | void render_ui_2d(); |
114 | void render_disconnected_background(); | 114 | void render_disconnected_background(); |
115 | void render_hud_elements(); | 115 | void render_hud_elements(); |
116 | void process_keystrokes_async(); | ||
117 | 116 | ||
118 | void display_startup() | 117 | void display_startup() |
119 | { | 118 | { |
@@ -684,7 +683,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) | |||
684 | glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); | 683 | glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); |
685 | } | 684 | } |
686 | 685 | ||
687 | LLAppViewer::instance()->pingMainloopTimeout("Display:Render"); | 686 | LLAppViewer::instance()->pingMainloopTimeout("Display:RenderStart"); |
688 | 687 | ||
689 | //// render frontmost floater opaque for occlusion culling purposes | 688 | //// render frontmost floater opaque for occlusion culling purposes |
690 | //LLFloater* frontmost_floaterp = gFloaterView->getFrontmost(); | 689 | //LLFloater* frontmost_floaterp = gFloaterView->getFrontmost(); |
@@ -730,10 +729,13 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) | |||
730 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); | 729 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); |
731 | gGL.setColorMask(true, false); | 730 | gGL.setColorMask(true, false); |
732 | } | 731 | } |
733 | 732 | ||
733 | LLAppViewer::instance()->pingMainloopTimeout("Display:RenderGeom"); | ||
734 | |||
734 | if (!(LLAppViewer::instance()->logoutRequestSent() && LLAppViewer::instance()->hasSavedFinalSnapshot()) | 735 | if (!(LLAppViewer::instance()->logoutRequestSent() && LLAppViewer::instance()->hasSavedFinalSnapshot()) |
735 | && !gRestoreGL) | 736 | && !gRestoreGL) |
736 | { | 737 | { |
738 | |||
737 | gGL.setColorMask(true, false); | 739 | gGL.setColorMask(true, false); |
738 | LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE; | 740 | LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE; |
739 | gPipeline.renderGeom(*LLViewerCamera::getInstance(), TRUE); | 741 | gPipeline.renderGeom(*LLViewerCamera::getInstance(), TRUE); |
@@ -748,9 +750,12 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) | |||
748 | } | 750 | } |
749 | stop_glerror(); | 751 | stop_glerror(); |
750 | } | 752 | } |
753 | |||
754 | LLAppViewer::instance()->pingMainloopTimeout("Display:RenderFlush"); | ||
751 | 755 | ||
752 | if (to_texture) | 756 | if (to_texture) |
753 | { | 757 | { |
758 | |||
754 | gPipeline.mScreen.flush(); | 759 | gPipeline.mScreen.flush(); |
755 | } | 760 | } |
756 | 761 | ||
@@ -759,23 +764,20 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) | |||
759 | /// Using render to texture would be faster/better, but I don't have a | 764 | /// Using render to texture would be faster/better, but I don't have a |
760 | /// grasp of their full display stack just yet. | 765 | /// grasp of their full display stack just yet. |
761 | // gPostProcess->apply(gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight()); | 766 | // gPostProcess->apply(gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight()); |
762 | 767 | ||
768 | LLAppViewer::instance()->pingMainloopTimeout("Display:RenderUI"); | ||
769 | |||
763 | if (!for_snapshot) | 770 | if (!for_snapshot) |
764 | { | 771 | { |
772 | gFrameStats.start(LLFrameStats::RENDER_UI); | ||
765 | render_ui(); | 773 | render_ui(); |
766 | } | 774 | } |
767 | 775 | ||
768 | LLSpatialGroup::sNoDelete = FALSE; | 776 | LLSpatialGroup::sNoDelete = FALSE; |
769 | } | 777 | } |
770 | gFrameStats.start(LLFrameStats::RENDER_UI); | 778 | |
771 | 779 | LLAppViewer::instance()->pingMainloopTimeout("Display:FrameStats"); | |
772 | if (gHandleKeysAsync) | 780 | |
773 | { | ||
774 | LLAppViewer::instance()->pingMainloopTimeout("Display:Keystrokes"); | ||
775 | process_keystrokes_async(); | ||
776 | stop_glerror(); | ||
777 | } | ||
778 | |||
779 | gFrameStats.start(LLFrameStats::MISC_END); | 781 | gFrameStats.start(LLFrameStats::MISC_END); |
780 | stop_glerror(); | 782 | stop_glerror(); |
781 | 783 | ||
@@ -1231,43 +1233,3 @@ void display_cleanup() | |||
1231 | { | 1233 | { |
1232 | gDisconnectedImagep = NULL; | 1234 | gDisconnectedImagep = NULL; |
1233 | } | 1235 | } |
1234 | |||
1235 | void process_keystrokes_async() | ||
1236 | { | ||
1237 | #if LL_WINDOWS | ||
1238 | MSG msg; | ||
1239 | // look through all input messages, leaving them in the event queue | ||
1240 | while( PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE | PM_NOYIELD)) | ||
1241 | { | ||
1242 | // on first mouse message, break out | ||
1243 | if (msg.message >= WM_MOUSEFIRST && | ||
1244 | msg.message <= WM_MOUSELAST || | ||
1245 | msg.message == WM_QUIT) | ||
1246 | { | ||
1247 | break; | ||
1248 | } | ||
1249 | |||
1250 | // this is a message we want to handle now, so remove it from the event queue | ||
1251 | PeekMessage(&msg, NULL, msg.message, msg.message, PM_REMOVE | PM_NOYIELD); | ||
1252 | // if (msg.message == WM_KEYDOWN) | ||
1253 | // { | ||
1254 | // llinfos << "Process async key down " << (U32)msg.wParam << llendl; | ||
1255 | // } | ||
1256 | TranslateMessage(&msg); | ||
1257 | DispatchMessage(&msg); | ||
1258 | } | ||
1259 | |||
1260 | // Scan keyboard for movement keys. Command keys and typing | ||
1261 | // are handled by windows callbacks. Don't do this until we're | ||
1262 | // done initializing. JC | ||
1263 | if (gViewerWindow->mWindow->getVisible() | ||
1264 | && gViewerWindow->getActive() | ||
1265 | && !gViewerWindow->mWindow->getMinimized() | ||
1266 | && LLStartUp::getStartupState() == STATE_STARTED | ||
1267 | && !gViewerWindow->getShowProgress() | ||
1268 | && !gFocusMgr.focusLocked()) | ||
1269 | { | ||
1270 | gKeyboard->scanKeyboard(); | ||
1271 | } | ||
1272 | #endif | ||
1273 | } | ||