diff options
author | McCabe Maxsted | 2009-11-18 23:03:38 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-11-18 23:03:38 -0700 |
commit | 1fde9651c1266edcfd9513bfd758986ebca0f6b2 (patch) | |
tree | 55454b21ae759bc9d8fbe7cb2d802cffa48fadff /linden/indra | |
parent | Removed old unused reference to gProductName in windows updater (diff) | |
parent | Merge remote branch 'mccabe/next' into next (diff) | |
download | meta-impy-1fde9651c1266edcfd9513bfd758986ebca0f6b2.zip meta-impy-1fde9651c1266edcfd9513bfd758986ebca0f6b2.tar.gz meta-impy-1fde9651c1266edcfd9513bfd758986ebca0f6b2.tar.bz2 meta-impy-1fde9651c1266edcfd9513bfd758986ebca0f6b2.tar.xz |
Merge commit 'jacek/next' into next
Diffstat (limited to 'linden/indra')
-rw-r--r-- | linden/indra/llcommon/llfasttimer.cpp | 35 | ||||
-rw-r--r-- | linden/indra/llcommon/llfasttimer.h | 1 | ||||
-rw-r--r-- | linden/indra/newview/llviewermenu.cpp | 1 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml | 10 |
4 files changed, 35 insertions, 12 deletions
diff --git a/linden/indra/llcommon/llfasttimer.cpp b/linden/indra/llcommon/llfasttimer.cpp index 3304528..9253f2b 100644 --- a/linden/indra/llcommon/llfasttimer.cpp +++ b/linden/indra/llcommon/llfasttimer.cpp | |||
@@ -63,6 +63,12 @@ int LLFastTimer::sResetHistory = 0; | |||
63 | 63 | ||
64 | F64 LLFastTimer::sCPUClockFrequency = 0.0; | 64 | F64 LLFastTimer::sCPUClockFrequency = 0.0; |
65 | 65 | ||
66 | #if LL_LINUX || LL_SOLARIS | ||
67 | U64 LLFastTimer::sClockResolution = 1e9; // Nanosecond resolution | ||
68 | #else | ||
69 | U64 LLFastTimer::sClockResolution = 1e6; // Microsecond resolution | ||
70 | #endif | ||
71 | |||
66 | ////////////////////////////////////////////////////////////////////////////// | 72 | ////////////////////////////////////////////////////////////////////////////// |
67 | 73 | ||
68 | // | 74 | // |
@@ -90,17 +96,26 @@ U64 get_cpu_clock_count() | |||
90 | 96 | ||
91 | #endif // LL_WINDOWS | 97 | #endif // LL_WINDOWS |
92 | 98 | ||
93 | 99 | #if LL_LINUX || LL_SOLARIS | |
94 | #if (LL_LINUX || LL_SOLARIS) && (defined(__i386__) || defined(__amd64__)) | 100 | // Try to use the MONOTONIC clock if available, this is a constant time counter |
101 | // with nanosecond resolution (but not necessarily accuracy) and attempts are made | ||
102 | // to synchronize this value between cores at kernel start. It should not be effected | ||
103 | // by CPU frequency. If not available use the REALTIME clock, but this may be effected by | ||
104 | // NTP adjustments or other user activity effecting the system time. | ||
95 | U64 get_cpu_clock_count() | 105 | U64 get_cpu_clock_count() |
96 | { | 106 | { |
97 | U64 x; | 107 | struct timespec tp; |
98 | __asm__ volatile (".byte 0x0f, 0x31" : "=A" (x)); | 108 | |
99 | return x; | 109 | #ifdef CLOCK_MONOTONIC |
100 | } | 110 | clock_gettime(CLOCK_MONOTONIC,&tp); |
111 | #else | ||
112 | clock_gettime(CLOCK_REALTIME,&tp); | ||
101 | #endif | 113 | #endif |
114 | return (tp.tv_sec*LLFastTimer::sClockResolution)+tp.tv_nsec; | ||
115 | } | ||
116 | #endif // (LL_LINUX || LL_SOLARIS)) | ||
102 | 117 | ||
103 | #if LL_DARWIN || (LL_SOLARIS && defined(__sparc__)) | 118 | #if LL_DARWIN |
104 | // | 119 | // |
105 | // Mac implementation of CPU clock | 120 | // Mac implementation of CPU clock |
106 | // | 121 | // |
@@ -115,13 +130,13 @@ U64 get_cpu_clock_count() | |||
115 | ////////////////////////////////////////////////////////////////////////////// | 130 | ////////////////////////////////////////////////////////////////////////////// |
116 | 131 | ||
117 | //static | 132 | //static |
118 | #if LL_LINUX || LL_DARWIN || LL_SOLARIS | 133 | #if LL_DARWIN || LL_LINUX || LL_SOLARIS |
119 | // Both Linux and Mac use gettimeofday for accurate time | 134 | // Both Linux and Mac use gettimeofday for accurate time |
120 | U64 LLFastTimer::countsPerSecond() | 135 | U64 LLFastTimer::countsPerSecond() |
121 | { | 136 | { |
122 | return 1000000; // microseconds, so 1 Mhz. | 137 | return sClockResolution; // microseconds, so 1 Mhz. |
123 | } | 138 | } |
124 | #else | 139 | #else |
125 | U64 LLFastTimer::countsPerSecond() | 140 | U64 LLFastTimer::countsPerSecond() |
126 | { | 141 | { |
127 | if (!sCPUClockFrequency) | 142 | if (!sCPUClockFrequency) |
diff --git a/linden/indra/llcommon/llfasttimer.h b/linden/indra/llcommon/llfasttimer.h index a32da18..2e66496 100644 --- a/linden/indra/llcommon/llfasttimer.h +++ b/linden/indra/llcommon/llfasttimer.h | |||
@@ -238,6 +238,7 @@ public: | |||
238 | static int sPauseHistory; | 238 | static int sPauseHistory; |
239 | static int sResetHistory; | 239 | static int sResetHistory; |
240 | static F64 sCPUClockFrequency; | 240 | static F64 sCPUClockFrequency; |
241 | static U64 sClockResolution; | ||
241 | 242 | ||
242 | private: | 243 | private: |
243 | EFastTimerType mType; | 244 | EFastTimerType mType; |
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index ecf6fcb..895f488 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp | |||
@@ -676,6 +676,7 @@ void init_menus() | |||
676 | gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", upload_cost); | 676 | gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", upload_cost); |
677 | gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", upload_cost); | 677 | gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", upload_cost); |
678 | gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", upload_cost); | 678 | gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", upload_cost); |
679 | gMenuHolder->childSetLabelArg("ImportUpload", "[COST]", upload_cost); | ||
679 | 680 | ||
680 | gAFKMenu = gMenuBarView->getChild<LLMenuItemCallGL>("Set Away", TRUE); | 681 | gAFKMenu = gMenuBarView->getChild<LLMenuItemCallGL>("Set Away", TRUE); |
681 | gBusyMenu = gMenuBarView->getChild<LLMenuItemCallGL>("Set Busy", TRUE); | 682 | gBusyMenu = gMenuBarView->getChild<LLMenuItemCallGL>("Set Busy", TRUE); |
diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml index 1b36bca..078fb56 100644 --- a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml +++ b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml | |||
@@ -29,15 +29,21 @@ | |||
29 | <on_click function="File.UploadBulk" userdata="" /> | 29 | <on_click function="File.UploadBulk" userdata="" /> |
30 | </menu_item_call> | 30 | </menu_item_call> |
31 | <menu_item_separator /> | 31 | <menu_item_separator /> |
32 | <menu_item_call name="Import" label="Import" enabled="false"> | 32 | <menu_item_call name="Import" label="Import Object..." enabled="false"> |
33 | <on_click function="Object.Import" /> | 33 | <on_click function="Object.Import" /> |
34 | <on_enable function="Object.EnableImport" /> | 34 | <on_enable function="Object.EnableImport" /> |
35 | </menu_item_call> | 35 | </menu_item_call> |
36 | <menu_item_call name="Upload + Import" label="Upload + Import" | 36 | <menu_item_call name="ImportUpload" |
37 | label="Import + Upload... (L$[COST] per texture)" | ||
37 | enabled="false"> | 38 | enabled="false"> |
38 | <on_click function="Object.ImportUpload" /> | 39 | <on_click function="Object.ImportUpload" /> |
39 | <on_enable function="Object.EnableImport" /> | 40 | <on_enable function="Object.EnableImport" /> |
40 | </menu_item_call> | 41 | </menu_item_call> |
42 | <menu_item_call name="Export" label="Export Selected Objects..." | ||
43 | enabled="false"> | ||
44 | <on_click function="Object.Export" /> | ||
45 | <on_enable function="Object.EnableExport" /> | ||
46 | </menu_item_call> | ||
41 | <menu_item_separator /> | 47 | <menu_item_separator /> |
42 | <menu_item_call name="Close Window" | 48 | <menu_item_call name="Close Window" |
43 | label="Close Window" | 49 | label="Close Window" |