diff options
author | Jacek Antonelli | 2009-04-30 13:04:20 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-04-30 13:07:16 -0500 |
commit | ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch) | |
tree | 8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/newview/llfasttimerview.cpp | |
parent | Second Life viewer sources 1.22.11 (diff) | |
download | meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2 meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz |
Second Life viewer sources 1.23.0-RC
Diffstat (limited to 'linden/indra/newview/llfasttimerview.cpp')
-rw-r--r-- | linden/indra/newview/llfasttimerview.cpp | 61 |
1 files changed, 34 insertions, 27 deletions
diff --git a/linden/indra/newview/llfasttimerview.cpp b/linden/indra/newview/llfasttimerview.cpp index 16abbe3..c9037d0 100644 --- a/linden/indra/newview/llfasttimerview.cpp +++ b/linden/indra/newview/llfasttimerview.cpp | |||
@@ -17,7 +17,8 @@ | |||
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | 20 | * online at |
21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | 22 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 23 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 24 | * that you have read and understood your obligations described above, |
@@ -161,8 +162,14 @@ static struct ft_display_info ft_display_table[] = | |||
161 | // { LLFastTimer::FTM_REBUILD_TREE_VB, " Tree", &LLColor4::cyan1, 0 }, | 162 | // { LLFastTimer::FTM_REBUILD_TREE_VB, " Tree", &LLColor4::cyan1, 0 }, |
162 | { LLFastTimer::FTM_REBUILD_PARTICLE_VB, " Particle", &LLColor4::cyan2, 0 }, | 163 | { LLFastTimer::FTM_REBUILD_PARTICLE_VB, " Particle", &LLColor4::cyan2, 0 }, |
163 | // { LLFastTimer::FTM_REBUILD_CLOUD_VB, " Cloud", &LLColor4::cyan3, 0 }, | 164 | // { LLFastTimer::FTM_REBUILD_CLOUD_VB, " Cloud", &LLColor4::cyan3, 0 }, |
164 | // { LLFastTimer::FTM_REBUILD_GRASS_VB, " Grass", &LLColor4::cyan4, 0 }, | 165 | { LLFastTimer::FTM_REBUILD_GRASS_VB, " Grass", &LLColor4::cyan4, 0 }, |
165 | { LLFastTimer::FTM_RENDER_GEOMETRY, " Geometry", &LLColor4::green2, 1 }, | 166 | { LLFastTimer::FTM_SHADOW_RENDER, " Shadow", &LLColor4::green5, 1 }, |
167 | { LLFastTimer::FTM_SHADOW_SIMPLE, " Simple", &LLColor4::yellow2, 1 }, | ||
168 | { LLFastTimer::FTM_SHADOW_ALPHA, " Alpha", &LLColor4::yellow6, 1 }, | ||
169 | { LLFastTimer::FTM_SHADOW_TERRAIN, " Terrain", &LLColor4::green6, 1 }, | ||
170 | { LLFastTimer::FTM_SHADOW_AVATAR, " Avatar", &LLColor4::yellow1, 1 }, | ||
171 | { LLFastTimer::FTM_SHADOW_TREE, " Tree", &LLColor4::yellow8, 1 }, | ||
172 | { LLFastTimer::FTM_RENDER_GEOMETRY, " Geometry", &LLColor4::green2, 1 }, | ||
166 | { LLFastTimer::FTM_POOLS, " Pools", &LLColor4::green3, 1 }, | 173 | { LLFastTimer::FTM_POOLS, " Pools", &LLColor4::green3, 1 }, |
167 | { LLFastTimer::FTM_POOLRENDER, " RenderPool", &LLColor4::green4, 1 }, | 174 | { LLFastTimer::FTM_POOLRENDER, " RenderPool", &LLColor4::green4, 1 }, |
168 | { LLFastTimer::FTM_RENDER_TERRAIN, " Terrain", &LLColor4::green6, 0 }, | 175 | { LLFastTimer::FTM_RENDER_TERRAIN, " Terrain", &LLColor4::green6, 0 }, |
@@ -204,7 +211,7 @@ static struct ft_display_info ft_display_table[] = | |||
204 | { LLFastTimer::FTM_OTHER, " Other", &red0 } | 211 | { LLFastTimer::FTM_OTHER, " Other", &red0 } |
205 | }; | 212 | }; |
206 | static int ft_display_didcalc = 0; | 213 | static int ft_display_didcalc = 0; |
207 | static const int FTV_DISPLAY_NUM = (sizeof(ft_display_table)/sizeof(ft_display_table[0])); | 214 | static const int FTV_DISPLAY_NUM = LL_ARRAY_SIZE(ft_display_table); |
208 | 215 | ||
209 | S32 ft_display_idx[FTV_DISPLAY_NUM]; // line of table entry for display purposes (for collapse) | 216 | S32 ft_display_idx[FTV_DISPLAY_NUM]; // line of table entry for display purposes (for collapse) |
210 | 217 | ||
@@ -285,7 +292,7 @@ BOOL LLFastTimerView::handleRightMouseDown(S32 x, S32 y, MASK mask) | |||
285 | 292 | ||
286 | S32 LLFastTimerView::getLegendIndex(S32 y) | 293 | S32 LLFastTimerView::getLegendIndex(S32 y) |
287 | { | 294 | { |
288 | S32 idx = (getRect().getHeight() - y) / ((S32) LLFontGL::sMonospace->getLineHeight()+2) - 5; | 295 | S32 idx = (getRect().getHeight() - y) / ((S32) LLFontGL::getFontMonospace()->getLineHeight()+2) - 5; |
289 | if (idx >= 0 && idx < FTV_DISPLAY_NUM) | 296 | if (idx >= 0 && idx < FTV_DISPLAY_NUM) |
290 | { | 297 | { |
291 | return ft_display_idx[idx]; | 298 | return ft_display_idx[idx]; |
@@ -476,7 +483,7 @@ void LLFastTimerView::draw() | |||
476 | 483 | ||
477 | x = xleft; | 484 | x = xleft; |
478 | y = height - ytop; | 485 | y = height - ytop; |
479 | texth = (S32)LLFontGL::sMonospace->getLineHeight(); | 486 | texth = (S32)LLFontGL::getFontMonospace()->getLineHeight(); |
480 | 487 | ||
481 | char modedesc[][32] = { | 488 | char modedesc[][32] = { |
482 | "2 x Average ", | 489 | "2 x Average ", |
@@ -491,16 +498,16 @@ void LLFastTimerView::draw() | |||
491 | }; | 498 | }; |
492 | 499 | ||
493 | tdesc = llformat("Full bar = %s [Click to pause/reset] [SHIFT-Click to toggle]",modedesc[mDisplayMode]); | 500 | tdesc = llformat("Full bar = %s [Click to pause/reset] [SHIFT-Click to toggle]",modedesc[mDisplayMode]); |
494 | LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); | 501 | LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); |
495 | 502 | ||
496 | textw = LLFontGL::sMonospace->getWidth(tdesc); | 503 | textw = LLFontGL::getFontMonospace()->getWidth(tdesc); |
497 | 504 | ||
498 | x = xleft, y -= (texth + 2); | 505 | x = xleft, y -= (texth + 2); |
499 | tdesc = llformat("Justification = %s [CTRL-Click to toggle]",centerdesc[mDisplayCenter]); | 506 | tdesc = llformat("Justification = %s [CTRL-Click to toggle]",centerdesc[mDisplayCenter]); |
500 | LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); | 507 | LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); |
501 | y -= (texth + 2); | 508 | y -= (texth + 2); |
502 | 509 | ||
503 | LLFontGL::sMonospace->renderUTF8(std::string("[Right-Click log selected] [ALT-Click toggle counts] [ALT-SHIFT-Click sub hidden]"), | 510 | LLFontGL::getFontMonospace()->renderUTF8(std::string("[Right-Click log selected] [ALT-Click toggle counts] [ALT-SHIFT-Click sub hidden]"), |
504 | 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); | 511 | 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); |
505 | y -= (texth + 2); | 512 | y -= (texth + 2); |
506 | } | 513 | } |
@@ -625,15 +632,15 @@ void LLFastTimerView::draw() | |||
625 | 632 | ||
626 | if (is_child_of_hover_item) | 633 | if (is_child_of_hover_item) |
627 | { | 634 | { |
628 | LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, color, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::BOLD); | 635 | LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, color, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::BOLD); |
629 | } | 636 | } |
630 | else | 637 | else |
631 | { | 638 | { |
632 | LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, color, LLFontGL::LEFT, LLFontGL::TOP); | 639 | LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, color, LLFontGL::LEFT, LLFontGL::TOP); |
633 | } | 640 | } |
634 | y -= (texth + 2); | 641 | y -= (texth + 2); |
635 | 642 | ||
636 | textw = dx + LLFontGL::sMonospace->getWidth(std::string(ft_display_table[i].desc)) + 40; | 643 | textw = dx + LLFontGL::getFontMonospace()->getWidth(std::string(ft_display_table[i].desc)) + 40; |
637 | if (textw > legendwidth) | 644 | if (textw > legendwidth) |
638 | legendwidth = textw; | 645 | legendwidth = textw; |
639 | } | 646 | } |
@@ -647,7 +654,7 @@ void LLFastTimerView::draw() | |||
647 | // update rectangle that includes timer bars | 654 | // update rectangle that includes timer bars |
648 | mBarRect.mLeft = xleft; | 655 | mBarRect.mLeft = xleft; |
649 | mBarRect.mRight = getRect().mRight - xleft; | 656 | mBarRect.mRight = getRect().mRight - xleft; |
650 | mBarRect.mTop = ytop - ((S32)LLFontGL::sMonospace->getLineHeight() + 4); | 657 | mBarRect.mTop = ytop - ((S32)LLFontGL::getFontMonospace()->getLineHeight() + 4); |
651 | mBarRect.mBottom = margin + LINE_GRAPH_HEIGHT; | 658 | mBarRect.mBottom = margin + LINE_GRAPH_HEIGHT; |
652 | 659 | ||
653 | y = ytop; | 660 | y = ytop; |
@@ -733,23 +740,23 @@ void LLFastTimerView::draw() | |||
733 | U32 ms = (U32)((F64)totalticks * iclock_freq) ; | 740 | U32 ms = (U32)((F64)totalticks * iclock_freq) ; |
734 | 741 | ||
735 | tdesc = llformat("%.1f ms |", (F32)ms*.25f); | 742 | tdesc = llformat("%.1f ms |", (F32)ms*.25f); |
736 | x = xleft + barw/4 - LLFontGL::sMonospace->getWidth(tdesc); | 743 | x = xleft + barw/4 - LLFontGL::getFontMonospace()->getWidth(tdesc); |
737 | LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, LLColor4::white, | 744 | LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, |
738 | LLFontGL::LEFT, LLFontGL::TOP); | 745 | LLFontGL::LEFT, LLFontGL::TOP); |
739 | 746 | ||
740 | tdesc = llformat("%.1f ms |", (F32)ms*.50f); | 747 | tdesc = llformat("%.1f ms |", (F32)ms*.50f); |
741 | x = xleft + barw/2 - LLFontGL::sMonospace->getWidth(tdesc); | 748 | x = xleft + barw/2 - LLFontGL::getFontMonospace()->getWidth(tdesc); |
742 | LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, LLColor4::white, | 749 | LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, |
743 | LLFontGL::LEFT, LLFontGL::TOP); | 750 | LLFontGL::LEFT, LLFontGL::TOP); |
744 | 751 | ||
745 | tdesc = llformat("%.1f ms |", (F32)ms*.75f); | 752 | tdesc = llformat("%.1f ms |", (F32)ms*.75f); |
746 | x = xleft + (barw*3)/4 - LLFontGL::sMonospace->getWidth(tdesc); | 753 | x = xleft + (barw*3)/4 - LLFontGL::getFontMonospace()->getWidth(tdesc); |
747 | LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, LLColor4::white, | 754 | LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, |
748 | LLFontGL::LEFT, LLFontGL::TOP); | 755 | LLFontGL::LEFT, LLFontGL::TOP); |
749 | 756 | ||
750 | tdesc = llformat( "%d ms |", ms); | 757 | tdesc = llformat( "%d ms |", ms); |
751 | x = xleft + barw - LLFontGL::sMonospace->getWidth(tdesc); | 758 | x = xleft + barw - LLFontGL::getFontMonospace()->getWidth(tdesc); |
752 | LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, LLColor4::white, | 759 | LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, |
753 | LLFontGL::LEFT, LLFontGL::TOP); | 760 | LLFontGL::LEFT, LLFontGL::TOP); |
754 | } | 761 | } |
755 | 762 | ||
@@ -761,7 +768,7 @@ void LLFastTimerView::draw() | |||
761 | 768 | ||
762 | S32 by = y + 2; | 769 | S32 by = y + 2; |
763 | 770 | ||
764 | y -= ((S32)LLFontGL::sMonospace->getLineHeight() + 4); | 771 | y -= ((S32)LLFontGL::getFontMonospace()->getLineHeight() + 4); |
765 | 772 | ||
766 | //heading | 773 | //heading |
767 | gl_rect_2d(xleft-5, by, getRect().getWidth()-5, y+5, FALSE); | 774 | gl_rect_2d(xleft-5, by, getRect().getWidth()-5, y+5, FALSE); |
@@ -955,10 +962,10 @@ void LLFastTimerView::draw() | |||
955 | else | 962 | else |
956 | tdesc = llformat("%4.2f ms", ms); | 963 | tdesc = llformat("%4.2f ms", ms); |
957 | 964 | ||
958 | x = graph_rect.mRight - LLFontGL::sMonospace->getWidth(tdesc)-5; | 965 | x = graph_rect.mRight - LLFontGL::getFontMonospace()->getWidth(tdesc)-5; |
959 | y = graph_rect.mTop - ((S32)LLFontGL::sMonospace->getLineHeight()); | 966 | y = graph_rect.mTop - ((S32)LLFontGL::getFontMonospace()->getLineHeight()); |
960 | 967 | ||
961 | LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, LLColor4::white, | 968 | LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, |
962 | LLFontGL::LEFT, LLFontGL::TOP); | 969 | LLFontGL::LEFT, LLFontGL::TOP); |
963 | 970 | ||
964 | //highlight visible range | 971 | //highlight visible range |
@@ -1066,7 +1073,7 @@ void LLFastTimerView::draw() | |||
1066 | x = (graph_rect.mRight + graph_rect.mLeft)/2; | 1073 | x = (graph_rect.mRight + graph_rect.mLeft)/2; |
1067 | y = graph_rect.mBottom + 8; | 1074 | y = graph_rect.mBottom + 8; |
1068 | 1075 | ||
1069 | LLFontGL::sMonospace->renderUTF8(std::string(ft_display_table[mHoverIndex].desc), 0, x, y, LLColor4::white, | 1076 | LLFontGL::getFontMonospace()->renderUTF8(std::string(ft_display_table[mHoverIndex].desc), 0, x, y, LLColor4::white, |
1070 | LLFontGL::LEFT, LLFontGL::BOTTOM); | 1077 | LLFontGL::LEFT, LLFontGL::BOTTOM); |
1071 | } | 1078 | } |
1072 | } | 1079 | } |