Merge up to LL FUI

Arrehn 2011-10-28 02:00:09 -04:00
commit 7394730eaa
1027 changed files with 28210 additions and 49213 deletions

View File

@ -38,6 +38,7 @@ indra/newview/character
indra/newview/fmod.dll
indra/newview/mozilla-theme
indra/newview/mozilla-universal-darwin.tgz
indra/newview/res/ll_icon.*
indra/newview/res-sdl
indra/newview/vivox-runtime
indra/newview/English.lproj/InfoPlist.strings

68
.hgtags
View File

@ -182,29 +182,14 @@ e1ed60913230dd64269a7f7fc52cbc6004f6d52c 2.8.0-beta1
493d9127ee50e84ba08a736a65a23ca86f7a5b01 2.8.0-release
2c7e459e0c883f8e406b932e41e60097e9ee077e DRTVWR-73_2.8.1-beta1
2c7e459e0c883f8e406b932e41e60097e9ee077e 2.8.1-beta1
29e93d7e19991011bd12b5748142b11a5dcb4370 DRTVWR-72_2.8.1-release
29e93d7e19991011bd12b5748142b11a5dcb4370 2.8.1-release
4780e3bd2b3042f91be3426151f28c30d199bb3b DRTVWR-76_2.8.1-hotfix
4780e3bd2b3042f91be3426151f28c30d199bb3b 2.8.1-hotfix
54bc7823ad4e3a436fef79710f685a7372bbf795 2.8.2-start
493d9127ee50e84ba08a736a65a23ca86f7a5b01 2.8.0-release
29e93d7e19991011bd12b5748142b11a5dcb4370 DRTVWR-72_2.8.1-release
29e93d7e19991011bd12b5748142b11a5dcb4370 2.8.1-release
ac0f1a132d35c02a58861d37cca75b0429ac9137 2.8.3-start
4f777ffb99fefdc6497c61385c22688ff149c659 SL-2.0.0
668851b2ef0f8cf8df07a0fba429e4a6c1e70abb SL-2.0.1
b03065d018b8a2e28b7de85b293a4c992cb4c12d SL-2.1.0
bb38ff1a763738609e1b3cada6d15fa61e5e84b9 SL-2.1.1
1415e6538d54fd5d568ee88343424d57c6803c2c SL-2.2.0
6ad3d6fa35a4e320e9ce442fce2bf9c7fc852556 SL-2.3.0
1ed382c6a08ba3850b6ce9061bc551ddece0ea07 SL-2.4.0
b723921b5c711bd24dbe77dc76ef488b544dac78 SL-2.5.0
4dede9ae1ec74d41f6887719f6f1de7340d8578d SL-2.5.1
b53a0576eec80614d7767ed72b40ed67aeff27c9 SL-2.5.2
42f32494bac475d0737799346f6831558ae8bf5d SL-2.6.0
c9182ed77d427c759cfacf49a7b71a2e20d522aa SL-2.6.1
214180ad5714ce8392b82bbebcc92f4babd98300 SL-2.6.2
8f2da1701c81a62352df2b8d413d27fb2cade9a6 SL-2.6.3
dac76a711da5f1489a01c1fa62ec97d99c25736d SL-2.6.6
be2000b946f8cb3de5f44b2d419287d4c48ec4eb SL-2.6.8
77e5a08344c95738ab879f9671b7758cddd712a3 SL-2.6.9
a9abb9633a266c8d2fe62411cfd1c86d32da72bf SL-2.7.1
057f319dd8eccdf63a54d99686c68cdcb31b6abc SL-2.7.4
6866d9df6efbd441c66451debd376d21211de39c SL-2.7.5
493d9127ee50e84ba08a736a65a23ca86f7a5b01 SL-2-8-0
425f96b1e81e01644bf5e951961e7d1023bffb89 RLVa-1.2.0
fc0cbb86f5bd6e7737159e35aea2c4cf9f619b62 RLVa-1.2.1
@ -214,3 +199,44 @@ fc0cbb86f5bd6e7737159e35aea2c4cf9f619b62 RLVa-1.2.1
a563f7e215c7883c1cfd20908085687a0ed96284 RLVa-1.4.0
40644beae9c4a617504163d5c9f195dc7bfff1b4 RLVa-1.4.1
637901b23d335e4240c2c1763b45d1df71be84be FSmerge-2.8.3
599677276b227357140dda35bea4a2c18e2e67b5 DRTVWR-75_2.8.3-beta1
599677276b227357140dda35bea4a2c18e2e67b5 2.8.3-beta1
fb85792b84bf28428889c4cc966469d92e5dac4c DRTVWR-74_2.8.3-release
fb85792b84bf28428889c4cc966469d92e5dac4c 2.8.3-release
46a010f4885a9d223b511eac553ba5720284b1dc 3.0.0-start
b0be6ce3adfef3a014a2389d360539f8a86c5439 DRTVWR-78_3.0.0-beta1
b0be6ce3adfef3a014a2389d360539f8a86c5439 3.0.0-beta1
6b678ea52f90d5c14181661dcd2546e25bde483e 3.0.0-start
82a2079ffcb57ecb1b3849cb41376b443e1eb912 3.0.1-start
364fd63517fbacbbcb9129d096187171ba8c9e48 DRTVWR-81_3.0.1-beta1
364fd63517fbacbbcb9129d096187171ba8c9e48 3.0.1-beta1
f2412ecd6740803ea9452f1d17fd872e263a0df7 3.0.2-start
1778f26b6d0ae762dec3ca37140f66620f2485d9 DRTVWR-78_3.0.0-release
1778f26b6d0ae762dec3ca37140f66620f2485d9 3.0.0-release
42784bf50fa01974bada2a1af3892ee09c93fcda DRTVWR-83_3.0.2-beta1
42784bf50fa01974bada2a1af3892ee09c93fcda 3.0.2-beta1
e5c9af2d7980a99a71650be3a0cf7b2b3c3b897e DRTVWR-86_3.0.2-beta2
e5c9af2d7980a99a71650be3a0cf7b2b3c3b897e 3.0.2-beta2
b95ddac176ac944efdc85cbee94ac2e1eab44c79 3.0.3-start
1778f26b6d0ae762dec3ca37140f66620f2485d9 DRTVWR-78_3.0.0-release
0000000000000000000000000000000000000000 DRTVWR-78_3.0.0-release
1778f26b6d0ae762dec3ca37140f66620f2485d9 DRTVWR-77_3.0.0-release
6694f3f062aa45f64ab391d25a3eb3d5eb1b0871 DRTVWR-85_3.0.3-beta1
6694f3f062aa45f64ab391d25a3eb3d5eb1b0871 3.0.3-beta1
586907287be581817b2422b5137971b22d54ea48 3.0.4-start
61aa7974df089e8621fe9a4c69bcdefdb3cc208a DRTVWR-89_3.0.3-beta2
61aa7974df089e8621fe9a4c69bcdefdb3cc208a 3.0.3-beta2
0496d2f74043cf4e6058e76ac3db03d44cff42ce DRTVWR-84_3.0.3-release
0496d2f74043cf4e6058e76ac3db03d44cff42ce 3.0.3-release
92a3aa04775438226399b19deee12ac3b5a62838 3.0.5-start
c7282e59f374ee904bd793c3c444455e3399b0c5 3.1.0-start
2657fa785bbfac115852c41bd0adaff74c2ad5da DRTVWR-93_3.1.0-beta1
2657fa785bbfac115852c41bd0adaff74c2ad5da 3.1.0-beta1
dbaaef19266478a20654c46395300640163e98e3 DRTVWR-96_3.1.0-beta2
dbaaef19266478a20654c46395300640163e98e3 3.1.0-beta2
dbaaef19266478a20654c46395300640163e98e3 DRTVWR-96_3.1.0-beta2
bc01ee26fd0f1866e266429e85f76340523e91f1 DRTVWR-96_3.1.0-beta2
dbaaef19266478a20654c46395300640163e98e3 3.1.0-beta2
bc01ee26fd0f1866e266429e85f76340523e91f1 3.1.0-beta2
ae2de7b0b33c03dc5bdf3a7bfa54463b512221b2 DRTVWR-92_3.1.0-release
ae2de7b0b33c03dc5bdf3a7bfa54463b512221b2 3.1.0-release

24
BuildParams Executable file → Normal file
View File

@ -42,9 +42,17 @@ snowstorm_viewer-development.viewer_channel = "Second Life Development"
snowstorm_viewer-development.login_channel = "Second Life Development"
snowstorm_viewer-development.build_viewer_update_version_manager = false
snowstorm_viewer-development.email = viewer-development-builds@lists.secondlife.com
snowstorm_viewer-development.build_enforce_coding_policy = true
snowstorm_viewer-development.codeticket_add_context = true
Snowstorm_viewer-project-review.build_debug_release_separately = true
Snowstorm_viewer-project-review.codeticket_add_context = true
Snowstorm_viewer-project-review.viewer_channel = "Project Viewer - Snowstorm Team"
Snowstorm_viewer-project-review.login_channel = "Project Viewer - Snowstorm Team"
Snowstorm_viewer-project-review.codeticket_add_context = true
# ========================================
# Viewer Beta
# Viewer Beta (Owner: Dessie Linden)
# ========================================
viewer-beta.viewer_channel = "Second Life Beta Viewer"
viewer-beta.login_channel = "Second Life Beta Viewer"
@ -58,7 +66,7 @@ viewer-pre-beta.build_viewer_update_version_manager = true
# ========================================
# Viewer Release
# Viewer Release (Owner: Dessie Linden)
# ========================================
viewer-release.viewer_channel = "Second Life Release"
viewer-release.login_channel = "Second Life Release"
@ -69,7 +77,7 @@ viewer-pre-release.viewer_channel = "Second Life Release"
viewer-pre-release.login_channel = "Second Life Release"
viewer-pre-release.build_debug_release_separately = true
viewer-pre-release.build_viewer_update_version_manager = true
#viewer-pre-release.release-viewer.jira = DRTVWR-46
#viewer-pre-release.release-viewer.jira = DRTVWR-92
# ========================================
@ -140,12 +148,9 @@ cg_viewer-development_lenny.email = cg@lindenlab.com
# oz
# ================
snowstorm_project-windlight.build_debug_release_separately = true
snowstorm_project-windlight.viewer_channel = "Second Life Project Windlight Region"
snowstorm_project-windlight.login_channel = "Second Life Project Windlight Region"
oz_viewer-devreview.build_debug_release_separately = true
oz_viewer-devreview.codeticket_add_context = false
oz_viewer-devreview.build_enforce_coding_policy = true
oz_project-1.build_debug_release_separately = true
oz_project-1.codeticket_add_context = false
@ -158,9 +163,8 @@ oz_project-4.codeticket_add_context = false
oz_viewer-beta-review.build_debug_release_separately = true
oz_viewer-beta-review.codeticket_add_context = false
oz_viewer-poreview.build_debug_release_separately = true
oz_viewer-poreview.codeticket_add_context = false
oz_viewer-beta-review.viewer_channel = "Second Life Beta Viewer"
oz_viewer-beta-review.login_channel = "Second Life Beta Viewer"
# =================================================================
# asset delivery 2010 projects

View File

@ -1112,7 +1112,7 @@
<key>hash</key>
<string>362654a472ef7368d4c803ae3fb89d95</string>
<key>url</key>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/238959/arch/Darwin/installer/llconvexdecomposition-0.1-darwin-20110819.tar.bz2</string>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/238959/arch/Darwin/installer/llconvexdecomposition-0.1-darwin-20110819.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@ -1124,7 +1124,7 @@
<key>hash</key>
<string>c7801d899daec5338fbe95053255b7e7</string>
<key>url</key>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/238959/arch/Linux/installer/llconvexdecomposition-0.1-linux-20110819.tar.bz2</string>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/238959/arch/Linux/installer/llconvexdecomposition-0.1-linux-20110819.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@ -1136,7 +1136,7 @@
<key>hash</key>
<string>6ecf2f85f03c5ae87fe45769566a5660</string>
<key>url</key>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/238959/arch/CYGWIN/installer/llconvexdecomposition-0.1-windows-20110819.tar.bz2</string>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/238959/arch/CYGWIN/installer/llconvexdecomposition-0.1-windows-20110819.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@ -1160,7 +1160,7 @@
<key>hash</key>
<string>a5f53e09f67271fd50f1131ffdda9d27</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llconvexdecompositionstub/rev/238958/arch/Darwin/installer/llconvexdecompositionstub-0.3-darwin-20110819.tar.bz2</string>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llconvexdecompositionstub/rev/238958/arch/Darwin/installer/llconvexdecompositionstub-0.3-darwin-20110819.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@ -1172,7 +1172,7 @@
<key>hash</key>
<string>0006a964f1497f55a5f181b7042d2d22</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llconvexdecompositionstub/rev/238958/arch/Linux/installer/llconvexdecompositionstub-0.3-linux-20110819.tar.bz2</string>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llconvexdecompositionstub/rev/238958/arch/Linux/installer/llconvexdecompositionstub-0.3-linux-20110819.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@ -1184,7 +1184,7 @@
<key>hash</key>
<string>b859e7e3bb03ebb467f0309f46422995</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llconvexdecompositionstub/rev/238958/arch/CYGWIN/installer/llconvexdecompositionstub-0.3-windows-20110819.tar.bz2</string>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llconvexdecompositionstub/rev/238958/arch/CYGWIN/installer/llconvexdecompositionstub-0.3-windows-20110819.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@ -2069,12 +2069,12 @@
<map>
<key>build</key>
<map>
<key>command</key>
<string>xcodebuild</string>
<key>filters</key>
<array>
<string>setenv</string>
</array>
<key>command</key>
<string>xcodebuild</string>
<key>options</key>
<array>
<string>-configuration Debug</string>
@ -2123,12 +2123,12 @@
<map>
<key>build</key>
<map>
<key>command</key>
<string>xcodebuild</string>
<key>filters</key>
<array>
<string>setenv</string>
</array>
<key>command</key>
<string>xcodebuild</string>
<key>options</key>
<array>
<string>-configuration RelWithDebInfo</string>
@ -2179,12 +2179,12 @@
<map>
<key>build</key>
<map>
<key>command</key>
<string>xcodebuild</string>
<key>filters</key>
<array>
<string>setenv</string>
</array>
<key>command</key>
<string>xcodebuild</string>
<key>options</key>
<array>
<string>-configuration Release</string>

View File

@ -65,7 +65,7 @@ Aimee Trescothick
Alejandro Rosenthal
VWR-1184
Aleric Inglewood
SNOW-84
OPEN-38
SNOW-240
SNOW-477
SNOW-522
@ -575,6 +575,8 @@ Jonathan Yap
STORM-1567
STORM-1572
STORM-1574
STORM-1579
STORM-1639
Kadah Coba
STORM-1060
Jondan Lundquist
@ -622,6 +624,7 @@ Latif Khalifa
VWR-5370
leliel Mirihi
STORM-1100
STORM-1602
len Starship
Lisa Lowe
CT-218
@ -1032,6 +1035,9 @@ Synystyr Texan
Takeda Terrawyng
TankMaster Finesmith
STORM-1100
STORM-1602
STORM-1258
VWR-26622
Talamasca
Tali Rosca
Tayra Dagostino

View File

@ -1 +1 @@
VERSION_VIEWER=3.1.1
VERSION_VIEWER=3.2.1

View File

@ -75,7 +75,7 @@ if(WINDOWS)
if (MSVC80)
FIND_PATH(debug_msvc8_redist_path msvcr80d.dll
PATHS
${MSVC_DEBUG_REDIST_PATH}
${MSVC_DEBUG_REDIST_PATH}
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT
NO_DEFAULT_PATH
NO_DEFAULT_PATH
@ -100,7 +100,7 @@ if (MSVC80)
FIND_PATH(release_msvc8_redist_path msvcr80.dll
PATHS
${MSVC_REDIST_PATH}
${MSVC_REDIST_PATH}
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC80.CRT
NO_DEFAULT_PATH
NO_DEFAULT_PATH
@ -213,12 +213,12 @@ elseif(DARWIN)
libexpat.1.5.2.dylib
libexpat.dylib
libGLOD.dylib
libllqtwebkit.dylib
libminizip.a
libllqtwebkit.dylib
libminizip.a
libndofdev.dylib
libhunspell-1.3.dylib
libexception_handler.dylib
libcollada14dom.dylib
libcollada14dom.dylib
)
# fmod is statically linked on darwin
@ -254,19 +254,19 @@ elseif(LINUX)
libaprutil-1.so.0
libatk-1.0.so
libbreakpad_client.so.0
libcollada14dom.so
libcollada14dom.so
libcrypto.so.1.0.0
libdb-5.1.so
libexpat.so
libexpat.so.1
libglod.so
libglod.so
libgmock_main.so
libgmock.so.0
libgmodule-2.0.so
libgobject-2.0.so
libgtest_main.so
libgtest.so.0
libminizip.so
libminizip.so
libopenal.so
libopenjpeg.so
libssl.so

View File

@ -16,15 +16,15 @@ if (FMOD)
include(FindFMOD)
else (STANDALONE)
if (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
# If the path have been specified in the arguments, use that
# If the path have been specified in the arguments, use that
set(FMOD_LIBRARIES ${FMOD_LIBRARY})
MESSAGE(STATUS "Using FMOD path: ${FMOD_LIBRARIES}, ${FMOD_INCLUDE_DIR}")
MESSAGE(STATUS "Using FMOD path: ${FMOD_LIBRARIES}, ${FMOD_INCLUDE_DIR}")
else (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
# If not, we're going to try to get the package listed in autobuild.xml
# Note: if you're not using INSTALL_PROPRIETARY, the package URL should be local (file:/// URL)
# as accessing the private LL location will fail if you don't have the credential
include(Prebuilt)
use_prebuilt_binary(fmod)
# If not, we're going to try to get the package listed in autobuild.xml
# Note: if you're not using INSTALL_PROPRIETARY, the package URL should be local (file:/// URL)
# as accessing the private LL location will fail if you don't have the credential
include(Prebuilt)
use_prebuilt_binary(fmod)
if (WINDOWS)
set(FMOD_LIBRARY fmod)
elseif (DARWIN)

View File

@ -21,10 +21,10 @@ IF (NOT AUTOBUILD_EXECUTABLE)
AUTOBUILD_EXECUTABLE
NAMES ${AUTOBUILD_EXE_NAMES}
PATHS
ENV PATH
${CMAKE_SOURCE_DIR}/..
${CMAKE_SOURCE_DIR}/../..
${CMAKE_SOURCE_DIR}/../../..
ENV PATH
${CMAKE_SOURCE_DIR}/..
${CMAKE_SOURCE_DIR}/../..
${CMAKE_SOURCE_DIR}/../../..
PATH_SUFFIXES "/autobuild/bin/"
)
@ -33,7 +33,7 @@ IF (NOT AUTOBUILD_EXECUTABLE)
MESSAGE(STATUS "Using autobuild at: ${AUTOBUILD_EXECUTABLE}")
ELSE (AUTOBUILD_EXECUTABLE)
IF (AUTOBUILD_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find autobuild executable")
MESSAGE(FATAL_ERROR "Could not find autobuild executable")
ENDIF (AUTOBUILD_FIND_REQUIRED)
ENDIF (AUTOBUILD_EXECUTABLE)

30
indra/cmake/FindGLH.cmake Normal file
View File

@ -0,0 +1,30 @@
# -*- cmake -*-
# - Find GLH
# Find the Graphic Library Helper includes.
# This module defines
# GLH_INCLUDE_DIR, where to find glh/glh_linear.h.
# GLH_FOUND, If false, do not try to use GLH.
find_path(GLH_INCLUDE_DIR glh/glh_linear.h
NO_SYSTEM_ENVIRONMENT_PATH
)
if (GLH_INCLUDE_DIR)
set(GLH_FOUND "YES")
else (GLH_INCLUDE_DIR)
set(GLH_FOUND "NO")
endif (GLH_INCLUDE_DIR)
if (GLH_FOUND)
if (NOT GLH_FIND_QUIETLY)
message(STATUS "Found GLH: ${GLH_INCLUDE_DIR}")
set(GLH_FIND_QUIETLY TRUE) # Only alert us the first time
endif (NOT GLH_FIND_QUIETLY)
else (GLH_FOUND)
if (GLH_FIND_REQUIRED)
message(FATAL_ERROR "Could not find GLH")
endif (GLH_FIND_REQUIRED)
endif (GLH_FOUND)
mark_as_advanced(GLH_INCLUDE_DIR)

View File

@ -24,8 +24,8 @@ EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
# Try to find a library that was compiled with the same compiler version as we currently use.
SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson_linux-gcc-${_gcc_COMPILER_VERSION}_libmt.so)
IF (STANDALONE)
# On standalone, assume that the system installed library was compiled with the used compiler.
SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson.so)
# On standalone, assume that the system installed library was compiled with the used compiler.
SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson.so)
ENDIF (STANDALONE)
FIND_LIBRARY(JSONCPP_LIBRARY
NAMES ${JSONCPP_NAMES}

View File

@ -35,7 +35,7 @@ find_path(LLQTWEBKIT_INCLUDE_DIR llqtwebkit.h NO_SYSTEM_ENVIRONMENT_PATH HINTS $
find_library(LLQTWEBKIT_LIBRARY NAMES llqtwebkit NO_SYSTEM_ENVIRONMENT_PATH HINTS ${LLQTWEBKIT_LIBRARY_DIRS})
if (NOT PKG_CONFIG_FOUND OR NOT LLQTWEBKIT_FOUND) # If pkg-config couldn't find it, pretend we don't have pkg-config.
if (NOT PKG_CONFIG_FOUND OR NOT LLQTWEBKIT_FOUND) # If pkg-config couldn't find it, pretend we don't have pkg-config.
set(LLQTWEBKIT_LIBRARIES llqtwebkit)
get_filename_component(LLQTWEBKIT_LIBRARY_DIRS ${LLQTWEBKIT_LIBRARY} PATH)
endif (NOT PKG_CONFIG_FOUND OR NOT LLQTWEBKIT_FOUND)

View File

@ -30,12 +30,12 @@ endif (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
if (ZLIB_FOUND)
if (NOT ZLIB_FIND_QUIETLY)
message(STATUS "Found ZLIB: ${ZLIB_LIBRARIES}")
SET(ZLIB_FIND_QUIETLY TRUE)
message(STATUS "Found ZLIB: ${ZLIB_LIBRARIES}")
SET(ZLIB_FIND_QUIETLY TRUE)
endif (NOT ZLIB_FIND_QUIETLY)
else (ZLIB_FOUND)
if (ZLIB_FIND_REQUIRED)
message(FATAL_ERROR "Could not find ZLIB library")
message(FATAL_ERROR "Could not find ZLIB library")
endif (ZLIB_FIND_REQUIRED)
endif (ZLIB_FOUND)

11
indra/cmake/GLH.cmake Normal file
View File

@ -0,0 +1,11 @@
# -*- cmake -*-
include(Prebuilt)
set(GLH_FIND_REQUIRED TRUE)
set(GLH_FIND_QUIETLY TRUE)
if (STANDALONE)
include(FindGLH)
else (STANDALONE)
use_prebuilt_binary(glh_linear)
endif (STANDALONE)

View File

@ -8,7 +8,7 @@ set(GOOGLEMOCK_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include)
if (LINUX)
# VWR-24366: gmock is underlinked, it needs gtest.
# VWR-24366: gmock is underlinked, it needs gtest.
set(GOOGLEMOCK_LIBRARIES
gmock -Wl,--no-as-needed
gtest -Wl,--as-needed)

View File

@ -14,7 +14,7 @@ else (STANDALONE)
if (LINUX)
use_prebuilt_binary(tcmalloc)
set(TCMALLOC_LIBRARIES
tcmalloc)
tcmalloc)
set(PROFILER_LIBRARIES profiler)
set(GOOGLE_PERFTOOLS_INCLUDE_DIR
${LIBS_PREBUILT_DIR}/include)

View File

@ -8,7 +8,7 @@ set(LLPLUGIN_INCLUDE_DIRS
if (LINUX)
# In order to support using ld.gold on linux, we need to explicitely
# specify all libraries that llplugin uses.
set(LLPLUGIN_LIBRARIES llplugin pthread)
set(LLPLUGIN_LIBRARIES llplugin pthread)
else (LINUX)
set(LLPLUGIN_LIBRARIES llplugin)
set(LLPLUGIN_LIBRARIES llplugin)
endif (LINUX)

View File

@ -10,7 +10,7 @@ set(LLPRIMITIVE_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llprimitive
)
if (WINDOWS)
set(LLPRIMITIVE_LIBRARIES
set(LLPRIMITIVE_LIBRARIES
debug llprimitive
optimized llprimitive
debug libcollada14dom22-d

View File

@ -1,9 +1,11 @@
# -*- cmake -*-
include(FreeType)
include(GLH)
set(LLRENDER_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llrender
${GLH_INCLUDE_DIR}
)
if (SERVER AND LINUX)

View File

@ -38,18 +38,17 @@ endmacro(ll_deploy_sharedlibs_command)
# ll_stage_sharedlib
# Performs config and adds a copy command for a sharedlib target.
macro(ll_stage_sharedlib DSO_TARGET)
if(SHARED_LIB_STAGING_DIR)
# target gets written to the DLL staging directory.
# Also this directory is shared with RunBuildTest.cmake, y'know, for the tests.
set_target_properties(${DSO_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SHARED_LIB_STAGING_DIR})
if(NOT WINDOWS)
get_target_property(DSO_PATH ${DSO_TARGET} LOCATION)
get_filename_component(DSO_FILE ${DSO_PATH} NAME)
if(DARWIN)
set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources)
else(DARWIN)
set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
endif(DARWIN)
# target gets written to the DLL staging directory.
# Also this directory is shared with RunBuildTest.cmake, y'know, for the tests.
set_target_properties(${DSO_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SHARED_LIB_STAGING_DIR})
if(NOT WINDOWS)
get_target_property(DSO_PATH ${DSO_TARGET} LOCATION)
get_filename_component(DSO_FILE ${DSO_PATH} NAME)
if(DARWIN)
set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources)
else(DARWIN)
set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
endif(DARWIN)
# *TODO - maybe make this a symbolic link? -brad
add_custom_command(
@ -63,7 +62,6 @@ macro(ll_stage_sharedlib DSO_TARGET)
COMMENT "Copying llcommon to the staging folder."
)
endif(NOT WINDOWS)
endif(SHARED_LIB_STAGING_DIR)
if (DARWIN)
set_target_properties(${DSO_TARGET} PROPERTIES

View File

@ -13,4 +13,4 @@ set(LSCRIPT_LIBRARIES
lscript_library
)
set(LSCRIPT_EXECUTE_MONO_LIBRARIES lscript_execute_mono)
set(LSCRIPT_EXECUTE_MONO_LIBRARIES lscript_execute_mono)

View File

@ -2,22 +2,19 @@
include(Variables)
if (NOT STANDALONE)
set(ARCH_PREBUILT_DIRS ${AUTOBUILD_INSTALL_DIR}/lib)
set(ARCH_PREBUILT_DIRS_RELEASE ${AUTOBUILD_INSTALL_DIR}/lib/release)
set(ARCH_PREBUILT_DIRS_DEBUG ${AUTOBUILD_INSTALL_DIR}/lib/debug)
if (WINDOWS)
set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs)
set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs)
elseif (LINUX)
set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/lib)
set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/bin)
elseif (DARWIN)
set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs)
set(EXE_STAGING_DIR "${CMAKE_BINARY_DIR}/sharedlibs/\$(CONFIGURATION)")
endif (WINDOWS)
endif (NOT STANDALONE)
set(ARCH_PREBUILT_DIRS ${AUTOBUILD_INSTALL_DIR}/lib)
set(ARCH_PREBUILT_DIRS_RELEASE ${AUTOBUILD_INSTALL_DIR}/lib/release)
set(ARCH_PREBUILT_DIRS_DEBUG ${AUTOBUILD_INSTALL_DIR}/lib/debug)
if (WINDOWS)
set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs)
set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs)
elseif (LINUX)
set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/lib)
set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/bin)
elseif (DARWIN)
set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs)
set(EXE_STAGING_DIR "${CMAKE_BINARY_DIR}/sharedlibs/\$(CONFIGURATION)")
endif (WINDOWS)
# Autobuild packages must provide 'release' versions of libraries, but may provide versions for
# specific build types. AUTOBUILD_LIBS_INSTALL_DIRS lists first the build type directory and then

View File

@ -5,19 +5,19 @@ set(NDOF ON CACHE BOOL "Use NDOF space navigator joystick library.")
if (NDOF)
if (STANDALONE)
set(NDOF_FIND_REQUIRED ON)
include(FindNDOF)
set(NDOF_FIND_REQUIRED ON)
include(FindNDOF)
else (STANDALONE)
use_prebuilt_binary(ndofdev)
use_prebuilt_binary(ndofdev)
if (WINDOWS)
set(NDOF_LIBRARY libndofdev)
elseif (DARWIN OR LINUX)
set(NDOF_LIBRARY ndofdev)
endif (WINDOWS)
if (WINDOWS)
set(NDOF_LIBRARY libndofdev)
elseif (DARWIN OR LINUX)
set(NDOF_LIBRARY ndofdev)
endif (WINDOWS)
set(NDOF_INCLUDE_DIR ${ARCH_PREBUILT_DIRS}/include/ndofdev)
set(NDOF_FOUND 1)
set(NDOF_INCLUDE_DIR ${ARCH_PREBUILT_DIRS}/include/ndofdev)
set(NDOF_FOUND 1)
endif (STANDALONE)
endif (NDOF)

View File

@ -8,21 +8,21 @@ if (STANDALONE)
include(${QT_USE_FILE})
set(QTDIR $ENV{QTDIR})
if (QTDIR AND NOT "${QT_BINARY_DIR}" STREQUAL "${QTDIR}/bin")
message(FATAL_ERROR "\"${QT_BINARY_DIR}\" is unequal \"${QTDIR}/bin\"; "
"Qt is found by looking for qmake in your PATH. "
"Please set your PATH such that 'qmake' is found in \$QTDIR/bin, "
"or unset QTDIR if the found Qt is correct.")
endif (QTDIR AND NOT "${QT_BINARY_DIR}" STREQUAL "${QTDIR}/bin")
message(FATAL_ERROR "\"${QT_BINARY_DIR}\" is unequal \"${QTDIR}/bin\"; "
"Qt is found by looking for qmake in your PATH. "
"Please set your PATH such that 'qmake' is found in \$QTDIR/bin, "
"or unset QTDIR if the found Qt is correct.")
endif (QTDIR AND NOT "${QT_BINARY_DIR}" STREQUAL "${QTDIR}/bin")
find_package(LLQtWebkit REQUIRED QUIET)
# Add the plugins.
set(QT_PLUGIN_LIBRARIES)
foreach(qlibname qgif qjpeg)
find_library(QT_PLUGIN_${qlibname} ${qlibname} PATHS ${QT_PLUGINS_DIR}/imageformats NO_DEFAULT_PATH)
if (QT_PLUGIN_${qlibname})
list(APPEND QT_PLUGIN_LIBRARIES ${QT_PLUGIN_${qlibname}})
else (QT_PLUGIN_${qtlibname})
message(FATAL_ERROR "Could not find the Qt plugin ${qlibname} in \"${QT_PLUGINS_DIR}/imageformats\"!")
endif (QT_PLUGIN_${qlibname})
find_library(QT_PLUGIN_${qlibname} ${qlibname} PATHS ${QT_PLUGINS_DIR}/imageformats NO_DEFAULT_PATH)
if (QT_PLUGIN_${qlibname})
list(APPEND QT_PLUGIN_LIBRARIES ${QT_PLUGIN_${qlibname}})
else (QT_PLUGIN_${qtlibname})
message(FATAL_ERROR "Could not find the Qt plugin ${qlibname} in \"${QT_PLUGINS_DIR}/imageformats\"!")
endif (QT_PLUGIN_${qlibname})
endforeach(qlibname)
# qjpeg depends on libjpeg
list(APPEND QT_PLUGIN_LIBRARIES jpeg)

View File

@ -1,3 +1,26 @@
#!/usr/bin/env python
##
## $LicenseInfo:firstyear=2011&license=viewerlgpl$
## Second Life Viewer Source Code
## Copyright (C) 2011, Linden Research, Inc.
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation;
## version 2.1 of the License only.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
##
## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
## $/LicenseInfo$
import sys
import os
import glob

View File

@ -59,15 +59,15 @@ endif (DARWIN)
# Libraries on which this application depends on
# Sort by high-level to low-level
target_link_libraries(llimage_libtest
${LLCOMMON_LIBRARIES}
${LLVFS_LIBRARIES}
${LLCOMMON_LIBRARIES}
${LLVFS_LIBRARIES}
${LLIMAGE_LIBRARIES}
${LLKDU_LIBRARIES}
${KDU_LIBRARY}
${LLIMAGEJ2COJ_LIBRARIES}
${OS_LIBRARIES}
)
if (DARWIN)
# Path inside the app bundle where we'll need to copy libraries
set(LLIMAGE_LIBTEST_DESTINATION_DIR

View File

@ -1,3 +1,25 @@
#!/usr/bin/python
##
## $LicenseInfo:firstyear=2011&license=viewerlgpl$
## Second Life Viewer Source Code
## Copyright (C) 2011, Linden Research, Inc.
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation;
## version 2.1 of the License only.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
##
## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
## $/LicenseInfo$
from indra.base import llsd, lluuid
from datetime import datetime
import cllsd

View File

@ -163,7 +163,7 @@ class UUID(object):
def setFromMemoryDump(self, gdb_string):
"""
We expect to get gdb_string as four hex units. eg:
0x147d54db 0xc34b3f1b 0x714f989b 0x0a892fd2
0x147d54db 0xc34b3f1b 0x714f989b 0x0a892fd2
Which will be translated to:
db547d14-1b3f4bc3-9b984f71-d22f890a
Returns self.
@ -187,7 +187,7 @@ class UUID(object):
def getAsString(self):
"""
Return a different string representation of the form
AAAAAAAA-AAAABBBB-BBBBBBBB-BBCCCCCC (a 128-bit number in hex)
AAAAAAAA-AAAABBBB-BBBBBBBB-BBCCCCCC (a 128-bit number in hex)
where A=network address, B=timestamp, C=random.
"""
i1 = _binstr2int(self._bits[0:4])
@ -233,7 +233,7 @@ NULL = UUID()
def printTranslatedMemory(four_hex_uints):
"""
We expect to get the string as four hex units. eg:
0x147d54db 0xc34b3f1b 0x714f989b 0x0a892fd2
0x147d54db 0xc34b3f1b 0x714f989b 0x0a892fd2
Which will be translated to:
db547d14-1b3f4bc3-9b984f71-d22f890a
"""

View File

@ -1,3 +1,24 @@
#!/usr/bin/python
## $LicenseInfo:firstyear=2011&license=viewerlgpl$
## Second Life Viewer Source Code
## Copyright (C) 2011, Linden Research, Inc.
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation;
## version 2.1 of the License only.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
##
## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
## $/LicenseInfo$
import warnings

View File

@ -110,7 +110,7 @@ def format(format_str, context):
def _find_sub_matches(format_str):
"""@brief Find all of the substitution matches.
@param format_str the RUSS conformant format string.
@param format_str the RUSS conformant format string.
@return Returns an array of depths of arrays of positional matches in input.
"""
depth = 0

View File

@ -1,3 +1,24 @@
#!/usr/bin/python
## $LicenseInfo:firstyear=2011&license=viewerlgpl$
## Second Life Viewer Source Code
## Copyright (C) 2011, Linden Research, Inc.
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation;
## version 2.1 of the License only.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
##
## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
## $/LicenseInfo$
from indra.base import llsd, lluuid
from indra.ipc import siesta
import datetime, math, unittest

View File

@ -1,3 +1,24 @@
#!/usr/bin/python
## $LicenseInfo:firstyear=2011&license=viewerlgpl$
## Second Life Viewer Source Code
## Copyright (C) 2011, Linden Research, Inc.
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation;
## version 2.1 of the License only.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
##
## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
## $/LicenseInfo$
r"""UUID objects (universally unique identifiers) according to RFC 4122.
This module provides immutable UUID objects (class UUID) and the functions

View File

@ -3,6 +3,7 @@
project(linux_crash_logger)
include(00-Common)
include(GLH)
include(LLCommon)
include(LLCrashLogger)
include(LLMath)

View File

@ -79,11 +79,11 @@ add_library (llcharacter ${llcharacter_SOURCE_FILES})
# Add tests
if (LL_TESTS)
include(LLAddBuildTest)
# UNIT TESTS
SET(llcharacter_TEST_SOURCE_FILES
lljoint.cpp
)
LL_ADD_PROJECT_UNIT_TESTS(llcharacter "${llcharacter_TEST_SOURCE_FILES}")
include(LLAddBuildTest)
# UNIT TESTS
SET(llcharacter_TEST_SOURCE_FILES
lljoint.cpp
)
LL_ADD_PROJECT_UNIT_TESTS(llcharacter "${llcharacter_TEST_SOURCE_FILES}")
endif (LL_TESTS)

View File

@ -115,7 +115,7 @@ set(llcommon_HEADER_FILES
indra_constants.h
linden_common.h
linked_lists.h
llaccountingquota.h
llaccountingcost.h
llallocator.h
llallocator_heap_profile.h
llagentconstants.h

View File

@ -1,5 +1,5 @@
/**
* @file llaccountingquota.h
* @file llaccountingcost.h
* @
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
@ -58,22 +58,28 @@ struct ParcelQuota
F32 mParcelCapacity;
};
struct SelectionQuota
//SelectionQuota atm does not require a id
struct SelectionCost
{
SelectionQuota( LLUUID localId, F32 renderCost, F32 physicsCost, F32 networkCost, F32 simulationCost )
: mLocalId( localId)
, mRenderCost( renderCost )
, mPhysicsCost( physicsCost )
SelectionCost( /*LLTransactionID transactionId, */ F32 physicsCost, F32 networkCost, F32 simulationCost )
//: mTransactionId( transactionId)
: mPhysicsCost( physicsCost )
, mNetworkCost( networkCost )
, mSimulationCost( simulationCost )
{
}
SelectionQuota() {}
SelectionCost()
: mPhysicsCost( 0.0f )
, mNetworkCost( 0.0f )
, mSimulationCost( 0.0f )
{}
F32 mRenderCost, mPhysicsCost, mNetworkCost, mSimulationCost;
LLUUID mLocalId;
F32 mPhysicsCost, mNetworkCost, mSimulationCost;
//LLTransactionID mTransactionId;
};
typedef enum { Roots = 0 , Prims } eSelectionType;
#endif

View File

@ -34,6 +34,7 @@
// std headers
// external library headers
// other Linden headers
#include "llerror.h"
LLEventAPI::LLEventAPI(const std::string& name, const std::string& desc, const std::string& field):
lbase(name, field),
@ -45,3 +46,32 @@ LLEventAPI::LLEventAPI(const std::string& name, const std::string& desc, const s
LLEventAPI::~LLEventAPI()
{
}
LLEventAPI::Response::Response(const LLSD& seed, const LLSD& request, const LLSD::String& replyKey):
mResp(seed),
mReq(request),
mKey(replyKey)
{}
LLEventAPI::Response::~Response()
{
// When you instantiate a stack Response object, if the original
// request requested a reply, send it when we leave this block, no
// matter how.
sendReply(mResp, mReq, mKey);
}
void LLEventAPI::Response::warn(const std::string& warning)
{
LL_WARNS("LLEventAPI::Response") << warning << LL_ENDL;
mResp["warnings"].append(warning);
}
void LLEventAPI::Response::error(const std::string& error)
{
// Use LL_WARNS rather than LL_ERROR: we don't want the viewer to shut
// down altogether.
LL_WARNS("LLEventAPI::Response") << error << LL_ENDL;
mResp["error"] = error;
}

View File

@ -76,6 +76,89 @@ public:
LLEventDispatcher::add(name, desc, callable, required);
}
/**
* Instantiate a Response object in any LLEventAPI subclass method that
* wants to guarantee a reply (if requested) will be sent on exit from the
* method. The reply will be sent if request.has(@a replyKey), default
* "reply". If specified, the value of request[replyKey] is the name of
* the LLEventPump on which to send the reply. Conventionally you might
* code something like:
*
* @code
* void MyEventAPI::someMethod(const LLSD& request)
* {
* // Send a reply event as long as request.has("reply")
* Response response(LLSD(), request);
* // ...
* // will be sent in reply event
* response["somekey"] = some_data;
* }
* @endcode
*/
class LL_COMMON_API Response
{
public:
/**
* Instantiating a Response object in an LLEventAPI subclass method
* ensures that, if desired, a reply event will be sent.
*
* @a seed is the initial reply LLSD that will be further decorated before
* being sent as the reply
*
* @a request is the incoming request LLSD; we particularly care about
* [replyKey] and ["reqid"]
*
* @a replyKey [default "reply"] is the string name of the LLEventPump
* on which the caller wants a reply. If <tt>(!
* request.has(replyKey))</tt>, no reply will be sent.
*/
Response(const LLSD& seed, const LLSD& request, const LLSD::String& replyKey="reply");
~Response();
/**
* @code
* if (some condition)
* {
* response.warn("warnings are logged and collected in [\"warnings\"]");
* }
* @endcode
*/
void warn(const std::string& warning);
/**
* @code
* if (some condition isn't met)
* {
* // In a function returning void, you can validly 'return
* // expression' if the expression is itself of type void. But
* // returning is up to you; response.error() has no effect on
* // flow of control.
* return response.error("error message, logged and also sent as [\"error\"]");
* }
* @endcode
*/
void error(const std::string& error);
/**
* set other keys...
*
* @code
* // set any attributes you want to be sent in the reply
* response["info"] = some_value;
* // ...
* response["ok"] = went_well;
* @endcode
*/
LLSD& operator[](const LLSD::String& key) { return mResp[key]; }
/**
* set the response to the given data
*/
void setResponse(LLSD const & response){ mResp = response; }
LLSD mResp, mReq;
LLSD::String mKey;
};
private:
std::string mDesc;
};

View File

@ -591,6 +591,17 @@ void LLReqID::stamp(LLSD& response) const
bool sendReply(const LLSD& reply, const LLSD& request, const std::string& replyKey)
{
// If the original request has no value for replyKey, it's pointless to
// construct or send a reply event: on which LLEventPump should we send
// it? Allow that to be optional: if the caller wants to require replyKey,
// it can so specify when registering the operation method.
if (! request.has(replyKey))
{
return false;
}
// Here the request definitely contains replyKey; reasonable to proceed.
// Copy 'reply' to modify it.
LLSD newreply(reply);
// Get the ["reqid"] element from request

View File

@ -309,14 +309,15 @@ LLFastTimer::NamedTimer::~NamedTimer()
std::string LLFastTimer::NamedTimer::getToolTip(S32 history_idx)
{
F64 ms_multiplier = 1000.0 / (F64)LLFastTimer::countsPerSecond();
if (history_idx < 0)
{
// by default, show average number of calls
return llformat("%s (%d calls)", getName().c_str(), (S32)getCallAverage());
// by default, show average number of call
return llformat("%s (%d ms, %d calls)", getName().c_str(), (S32)(getCountAverage() * ms_multiplier), (S32)getCallAverage());
}
else
{
return llformat("%s (%d calls)", getName().c_str(), (S32)getHistoricalCalls(history_idx));
return llformat("%s (%d ms, %d calls)", getName().c_str(), (S32)(getHistoricalCount(history_idx) * ms_multiplier), (S32)getHistoricalCalls(history_idx));
}
}
@ -699,17 +700,7 @@ void LLFastTimer::nextFrame()
llinfos << "Slow frame, fast timers inaccurate" << llendl;
}
if (sPauseHistory)
{
sResetHistory = true;
}
else if (sResetHistory)
{
sLastFrameIndex = 0;
sCurFrameIndex = 0;
sResetHistory = false;
}
else // not paused
if (!sPauseHistory)
{
NamedTimer::processTimes();
sLastFrameIndex = sCurFrameIndex++;

View File

@ -66,7 +66,7 @@ public:
public:
~NamedTimer();
enum { HISTORY_NUM = 60 };
enum { HISTORY_NUM = 300 };
const std::string& getName() const { return mName; }
NamedTimer* getParent() const { return mParent; }

View File

@ -35,26 +35,15 @@
//static
void * & LLInstanceTrackerBase::getInstances(std::type_info const & info)
{
// <ND> This is called a HUGE amount of times. Just use the name() ptr in a map instead of making expensive string compares each time
// static std::map<std::string, void *> instances;
//
// std::string k = info.name();
// if(instances.find(k) == instances.end())
// {
// instances[k] = NULL;
// }
//
// return instances[k];
static std::map<char const*, void *> instances;
std::map< char const *, void* >::iterator itr = instances.find( info.name() );
// std::string k = info.name();
if(itr == instances.end())
{
itr = instances.insert( std::make_pair( info.name(), (void*)0 ) ).first;
}
return itr->second;
// </ND>
typedef std::map<std::string, void *> InstancesMap;
static InstancesMap instances;
// std::map::insert() is just what we want here. You attempt to insert a
// (key, value) pair. If the specified key doesn't yet exist, it inserts
// the pair and returns a std::pair of (iterator, true). If the specified
// key DOES exist, insert() simply returns (iterator, false). One lookup
// handles both cases.
return instances.insert(InstancesMap::value_type(info.name(),
InstancesMap::mapped_type()))
.first->second;
}

View File

@ -29,6 +29,7 @@
#define LL_LLINSTANCETRACKER_H
#include <map>
#include <typeinfo>
#include "string_table.h"
#include <boost/utility.hpp>
@ -37,10 +38,40 @@
#include <boost/iterator/transform_iterator.hpp>
#include <boost/iterator/indirect_iterator.hpp>
/**
* Base class manages "class-static" data that must actually have singleton
* semantics: one instance per process, rather than one instance per module as
* sometimes happens with data simply declared static.
*/
class LL_COMMON_API LLInstanceTrackerBase : public boost::noncopyable
{
protected:
static void * & getInstances(std::type_info const & info);
protected:
/// Get a process-unique void* pointer slot for the specified type_info
static void * & getInstances(std::type_info const & info);
/// Find or create a STATICDATA instance for the specified TRACKED class.
/// STATICDATA must be default-constructible.
template<typename STATICDATA, class TRACKED>
static STATICDATA& getStatic()
{
void *& instances = getInstances(typeid(TRACKED));
if (! instances)
{
instances = new STATICDATA;
}
return *static_cast<STATICDATA*>(instances);
}
/// It's not essential to derive your STATICDATA (for use with
/// getStatic()) from StaticBase; it's just that both known
/// implementations do.
struct StaticBase
{
StaticBase():
sIterationNestDepth(0)
{}
S32 sIterationNestDepth;
};
};
/// This mix-in class adds support for tracking all instances of the specified class parameter T
@ -50,8 +81,15 @@ class LL_COMMON_API LLInstanceTrackerBase : public boost::noncopyable
template<typename T, typename KEY = T*>
class LLInstanceTracker : public LLInstanceTrackerBase
{
typedef typename std::map<KEY, T*> InstanceMap;
typedef LLInstanceTracker<T, KEY> MyT;
typedef typename std::map<KEY, T*> InstanceMap;
struct StaticData: public StaticBase
{
InstanceMap sMap;
};
static StaticData& getStatic() { return LLInstanceTrackerBase::getStatic<StaticData, MyT>(); }
static InstanceMap& getMap_() { return getStatic().sMap; }
public:
class instance_iter : public boost::iterator_facade<instance_iter, T, boost::forward_traversal_tag>
{
@ -61,12 +99,12 @@ public:
instance_iter(const typename InstanceMap::iterator& it)
: mIterator(it)
{
++sIterationNestDepth;
++getStatic().sIterationNestDepth;
}
~instance_iter()
{
--sIterationNestDepth;
--getStatic().sIterationNestDepth;
}
@ -92,21 +130,21 @@ public:
public:
typedef boost::iterator_facade<key_iter, KEY, boost::forward_traversal_tag> super_t;
key_iter(typename InstanceMap::iterator& it)
key_iter(typename InstanceMap::iterator it)
: mIterator(it)
{
++sIterationNestDepth;
++getStatic().sIterationNestDepth;
}
key_iter(const key_iter& other)
: mIterator(other.mIterator)
{
++sIterationNestDepth;
++getStatic().sIterationNestDepth;
}
~key_iter()
{
--sIterationNestDepth;
--getStatic().sIterationNestDepth;
}
@ -159,8 +197,8 @@ protected:
virtual ~LLInstanceTracker()
{
// it's unsafe to delete instances of this type while all instances are being iterated over.
llassert(sIterationNestDepth == 0);
remove_();
llassert_always(getStatic().sIterationNestDepth == 0);
remove_();
}
virtual void setKey(KEY key) { remove_(); add_(key); }
virtual const KEY& getKey() const { return mInstanceKey; }
@ -176,31 +214,24 @@ private:
getMap_().erase(mInstanceKey);
}
static InstanceMap& getMap_()
{
void * & instances = getInstances(typeid(MyT));
if (! instances)
{
instances = new InstanceMap;
}
return * static_cast<InstanceMap*>(instances);
}
private:
KEY mInstanceKey;
static S32 sIterationNestDepth;
};
template <typename T, typename KEY> S32 LLInstanceTracker<T, KEY>::sIterationNestDepth = 0;
/// explicit specialization for default case where KEY is T*
/// use a simple std::set<T*>
template<typename T>
class LLInstanceTracker<T, T*> : public LLInstanceTrackerBase
{
typedef typename std::set<T*> InstanceSet;
typedef LLInstanceTracker<T, T*> MyT;
typedef typename std::set<T*> InstanceSet;
struct StaticData: public StaticBase
{
InstanceSet sSet;
};
static StaticData& getStatic() { return LLInstanceTrackerBase::getStatic<StaticData, MyT>(); }
static InstanceSet& getSet_() { return getStatic().sSet; }
public:
/// for completeness of analogy with the generic implementation
@ -213,18 +244,18 @@ public:
instance_iter(const typename InstanceSet::iterator& it)
: mIterator(it)
{
++sIterationNestDepth;
++getStatic().sIterationNestDepth;
}
instance_iter(const instance_iter& other)
: mIterator(other.mIterator)
{
++sIterationNestDepth;
++getStatic().sIterationNestDepth;
}
~instance_iter()
{
--sIterationNestDepth;
--getStatic().sIterationNestDepth;
}
private:
@ -250,13 +281,13 @@ public:
protected:
LLInstanceTracker()
{
// it's safe but unpredictable to create instances of this type while all instances are being iterated over. I hate unpredictable. This assert will probably be turned on early in the next development cycle.
// it's safe but unpredictable to create instances of this type while all instances are being iterated over. I hate unpredictable. This assert will probably be turned on early in the next development cycle.
getSet_().insert(static_cast<T*>(this));
}
virtual ~LLInstanceTracker()
{
// it's unsafe to delete instances of this type while all instances are being iterated over.
llassert(sIterationNestDepth == 0);
llassert_always(getStatic().sIterationNestDepth == 0);
getSet_().erase(static_cast<T*>(this));
}
@ -264,20 +295,6 @@ protected:
{
getSet_().insert(static_cast<T*>(this));
}
static InstanceSet& getSet_()
{
void * & instances = getInstances(typeid(MyT));
if (! instances)
{
instances = new InstanceSet;
}
return * static_cast<InstanceSet *>(instances);
}
static S32 sIterationNestDepth;
};
template <typename T> S32 LLInstanceTracker<T, T*>::sIterationNestDepth = 0;
#endif

File diff suppressed because it is too large Load Diff

View File

@ -27,7 +27,6 @@
#define LLMEMORY_H
#include "llmemtype.h"
#if LL_DEBUG
inline void* ll_aligned_malloc( size_t size, int align )
{
@ -105,6 +104,10 @@ inline void ll_aligned_free_32(void *p)
#define ll_aligned_free_32 free
#endif // LL_DEBUG
#ifndef __DEBUG_PRIVATE_MEM__
#define __DEBUG_PRIVATE_MEM__ 0
#endif
class LL_COMMON_API LLMemory
{
public:
@ -115,8 +118,24 @@ public:
// Return value is zero if not known.
static U64 getCurrentRSS();
static U32 getWorkingSetSize();
static void* tryToAlloc(void* address, U32 size);
static void initMaxHeapSizeGB(F32 max_heap_size_gb, BOOL prevent_heap_failure);
static void updateMemoryInfo() ;
static void logMemoryInfo(BOOL update = FALSE);
static bool isMemoryPoolLow();
static U32 getAvailableMemKB() ;
static U32 getMaxMemKB() ;
static U32 getAllocatedMemKB() ;
private:
static char* reserveMem;
static U32 sAvailPhysicalMemInKB ;
static U32 sMaxPhysicalMemInKB ;
static U32 sAllocatedMemInKB;
static U32 sAllocatedPageSizeInKB ;
static U32 sMaxHeapSizeInKB;
static BOOL sEnableMemoryFailurePrevention;
};
//----------------------------------------------------------------------------
@ -163,6 +182,328 @@ private:
//----------------------------------------------------------------------------
//
//class LLPrivateMemoryPool defines a private memory pool for an application to use, so the application does not
//need to access the heap directly fro each memory allocation. Throught this, the allocation speed is faster,
//and reduces virtaul address space gragmentation problem.
//Note: this class is thread-safe by passing true to the constructor function. However, you do not need to do this unless
//you are sure the memory allocation and de-allocation will happen in different threads. To make the pool thread safe
//increases allocation and deallocation cost.
//
class LL_COMMON_API LLPrivateMemoryPool
{
friend class LLPrivateMemoryPoolManager ;
public:
class LL_COMMON_API LLMemoryBlock //each block is devided into slots uniformly
{
public:
LLMemoryBlock() ;
~LLMemoryBlock() ;
void init(char* buffer, U32 buffer_size, U32 slot_size) ;
void setBuffer(char* buffer, U32 buffer_size) ;
char* allocate() ;
void freeMem(void* addr) ;
bool empty() {return !mAllocatedSlots;}
bool isFull() {return mAllocatedSlots == mTotalSlots;}
bool isFree() {return !mTotalSlots;}
U32 getSlotSize()const {return mSlotSize;}
U32 getTotalSlots()const {return mTotalSlots;}
U32 getBufferSize()const {return mBufferSize;}
char* getBuffer() const {return mBuffer;}
//debug use
void resetBitMap() ;
private:
char* mBuffer;
U32 mSlotSize ; //when the block is not initialized, it is the buffer size.
U32 mBufferSize ;
U32 mUsageBits ;
U8 mTotalSlots ;
U8 mAllocatedSlots ;
U8 mDummySize ; //size of extra bytes reserved for mUsageBits.
public:
LLMemoryBlock* mPrev ;
LLMemoryBlock* mNext ;
LLMemoryBlock* mSelf ;
struct CompareAddress
{
bool operator()(const LLMemoryBlock* const& lhs, const LLMemoryBlock* const& rhs)
{
return (U32)lhs->getBuffer() < (U32)rhs->getBuffer();
}
};
};
class LL_COMMON_API LLMemoryChunk //is divided into memory blocks.
{
public:
LLMemoryChunk() ;
~LLMemoryChunk() ;
void init(char* buffer, U32 buffer_size, U32 min_slot_size, U32 max_slot_size, U32 min_block_size, U32 max_block_size) ;
void setBuffer(char* buffer, U32 buffer_size) ;
bool empty() ;
char* allocate(U32 size) ;
void freeMem(void* addr) ;
char* getBuffer() const {return mBuffer;}
U32 getBufferSize() const {return mBufferSize;}
U32 getAllocatedSize() const {return mAlloatedSize;}
bool containsAddress(const char* addr) const;
static U32 getMaxOverhead(U32 data_buffer_size, U32 min_slot_size,
U32 max_slot_size, U32 min_block_size, U32 max_block_size) ;
void dump() ;
private:
U32 getPageIndex(U32 addr) ;
U32 getBlockLevel(U32 size) ;
U16 getPageLevel(U32 size) ;
LLMemoryBlock* addBlock(U32 blk_idx) ;
void popAvailBlockList(U32 blk_idx) ;
void addToFreeSpace(LLMemoryBlock* blk) ;
void removeFromFreeSpace(LLMemoryBlock* blk) ;
void removeBlock(LLMemoryBlock* blk) ;
void addToAvailBlockList(LLMemoryBlock* blk) ;
U32 calcBlockSize(U32 slot_size);
LLMemoryBlock* createNewBlock(LLMemoryBlock* blk, U32 buffer_size, U32 slot_size, U32 blk_idx) ;
private:
LLMemoryBlock** mAvailBlockList ;//256 by mMinSlotSize
LLMemoryBlock** mFreeSpaceList;
LLMemoryBlock* mBlocks ; //index of blocks by address.
char* mBuffer ;
U32 mBufferSize ;
char* mDataBuffer ;
char* mMetaBuffer ;
U32 mMinBlockSize ;
U32 mMinSlotSize ;
U32 mMaxSlotSize ;
U32 mAlloatedSize ;
U16 mBlockLevels;
U16 mPartitionLevels;
public:
//form a linked list
LLMemoryChunk* mNext ;
LLMemoryChunk* mPrev ;
} ;
private:
LLPrivateMemoryPool(S32 type, U32 max_pool_size) ;
~LLPrivateMemoryPool() ;
char *allocate(U32 size) ;
void freeMem(void* addr) ;
void dump() ;
U32 getTotalAllocatedSize() ;
U32 getTotalReservedSize() {return mReservedPoolSize;}
S32 getType() const {return mType; }
bool isEmpty() const {return !mNumOfChunks; }
private:
void lock() ;
void unlock() ;
S32 getChunkIndex(U32 size) ;
LLMemoryChunk* addChunk(S32 chunk_index) ;
bool checkSize(U32 asked_size) ;
void removeChunk(LLMemoryChunk* chunk) ;
U16 findHashKey(const char* addr);
void addToHashTable(LLMemoryChunk* chunk) ;
void removeFromHashTable(LLMemoryChunk* chunk) ;
void rehash() ;
bool fillHashTable(U16 start, U16 end, LLMemoryChunk* chunk) ;
LLMemoryChunk* findChunk(const char* addr) ;
void destroyPool() ;
public:
enum
{
SMALL_ALLOCATION = 0, //from 8 bytes to 2KB(exclusive), page size 2KB, max chunk size is 4MB.
MEDIUM_ALLOCATION, //from 2KB to 512KB(exclusive), page size 32KB, max chunk size 4MB
LARGE_ALLOCATION, //from 512KB to 4MB(inclusive), page size 64KB, max chunk size 16MB
SUPER_ALLOCATION //allocation larger than 4MB.
};
enum
{
STATIC = 0 , //static pool(each alllocation stays for a long time) without threading support
VOLATILE, //Volatile pool(each allocation stays for a very short time) without threading support
STATIC_THREADED, //static pool with threading support
VOLATILE_THREADED, //volatile pool with threading support
MAX_TYPES
}; //pool types
private:
LLMutex* mMutexp ;
U32 mMaxPoolSize;
U32 mReservedPoolSize ;
LLMemoryChunk* mChunkList[SUPER_ALLOCATION] ; //all memory chunks reserved by this pool, sorted by address
U16 mNumOfChunks ;
U16 mHashFactor ;
S32 mType ;
class LLChunkHashElement
{
public:
LLChunkHashElement() {mFirst = NULL ; mSecond = NULL ;}
bool add(LLMemoryChunk* chunk) ;
void remove(LLMemoryChunk* chunk) ;
LLMemoryChunk* findChunk(const char* addr) ;
bool empty() {return !mFirst && !mSecond; }
bool full() {return mFirst && mSecond; }
bool hasElement(LLMemoryChunk* chunk) {return mFirst == chunk || mSecond == chunk;}
private:
LLMemoryChunk* mFirst ;
LLMemoryChunk* mSecond ;
};
std::vector<LLChunkHashElement> mChunkHashList ;
};
class LL_COMMON_API LLPrivateMemoryPoolManager
{
private:
LLPrivateMemoryPoolManager(BOOL enabled, U32 max_pool_size) ;
~LLPrivateMemoryPoolManager() ;
public:
static LLPrivateMemoryPoolManager* getInstance() ;
static void initClass(BOOL enabled, U32 pool_size) ;
static void destroyClass() ;
LLPrivateMemoryPool* newPool(S32 type) ;
void deletePool(LLPrivateMemoryPool* pool) ;
private:
static LLPrivateMemoryPoolManager* sInstance ;
std::vector<LLPrivateMemoryPool*> mPoolList ;
BOOL mPrivatePoolEnabled;
U32 mMaxPrivatePoolSize;
static std::vector<LLPrivateMemoryPool*> sDanglingPoolList ;
public:
//debug and statistics info.
void updateStatistics() ;
U32 mTotalReservedSize ;
U32 mTotalAllocatedSize ;
public:
#if __DEBUG_PRIVATE_MEM__
static char* allocate(LLPrivateMemoryPool* poolp, U32 size, const char* function, const int line) ;
typedef std::map<char*, std::string> mem_allocation_info_t ;
static mem_allocation_info_t sMemAllocationTracker;
#else
static char* allocate(LLPrivateMemoryPool* poolp, U32 size) ;
#endif
static void freeMem(LLPrivateMemoryPool* poolp, void* addr) ;
};
//-------------------------------------------------------------------------------------
#if __DEBUG_PRIVATE_MEM__
#define ALLOCATE_MEM(poolp, size) LLPrivateMemoryPoolManager::allocate((poolp), (size), __FUNCTION__, __LINE__)
#else
#define ALLOCATE_MEM(poolp, size) LLPrivateMemoryPoolManager::allocate((poolp), (size))
#endif
#define FREE_MEM(poolp, addr) LLPrivateMemoryPoolManager::freeMem((poolp), (addr))
//-------------------------------------------------------------------------------------
//
//the below singleton is used to test the private memory pool.
//
#if 0
class LL_COMMON_API LLPrivateMemoryPoolTester
{
private:
LLPrivateMemoryPoolTester() ;
~LLPrivateMemoryPoolTester() ;
public:
static LLPrivateMemoryPoolTester* getInstance() ;
static void destroy() ;
void run(S32 type) ;
private:
void correctnessTest() ;
void performanceTest() ;
void fragmentationtest() ;
void test(U32 min_size, U32 max_size, U32 stride, U32 times, bool random_deletion, bool output_statistics) ;
void testAndTime(U32 size, U32 times) ;
#if 0
public:
void* operator new(size_t size)
{
return (void*)sPool->allocate(size) ;
}
void operator delete(void* addr)
{
sPool->freeMem(addr) ;
}
void* operator new[](size_t size)
{
return (void*)sPool->allocate(size) ;
}
void operator delete[](void* addr)
{
sPool->freeMem(addr) ;
}
#endif
private:
static LLPrivateMemoryPoolTester* sInstance;
static LLPrivateMemoryPool* sPool ;
static LLPrivateMemoryPool* sThreadedPool ;
};
#if 0
//static
void* LLPrivateMemoryPoolTester::operator new(size_t size)
{
return (void*)sPool->allocate(size) ;
}
//static
void LLPrivateMemoryPoolTester::operator delete(void* addr)
{
sPool->free(addr) ;
}
//static
void* LLPrivateMemoryPoolTester::operator new[](size_t size)
{
return (void*)sPool->allocate(size) ;
}
//static
void LLPrivateMemoryPoolTester::operator delete[](void* addr)
{
sPool->free(addr) ;
}
#endif
#endif
// LLRefCount moved to llrefcount.h
// LLPointer moved to llpointer.h

View File

@ -32,7 +32,7 @@
//============================================================================
// MAIN THREAD
LLQueuedThread::LLQueuedThread(const std::string& name, bool threaded) :
LLQueuedThread::LLQueuedThread(const std::string& name, bool threaded, bool should_pause) :
LLThread(name),
mThreaded(threaded),
mIdleThread(TRUE),
@ -41,6 +41,11 @@ LLQueuedThread::LLQueuedThread(const std::string& name, bool threaded) :
{
if (mThreaded)
{
if(should_pause)
{
pause() ; //call this before start the thread.
}
start();
}
}

View File

@ -149,7 +149,7 @@ public:
static handle_t nullHandle() { return handle_t(0); }
public:
LLQueuedThread(const std::string& name, bool threaded = true);
LLQueuedThread(const std::string& name, bool threaded = true, bool should_pause = false);
virtual ~LLQueuedThread();
virtual void shutdown();

View File

@ -375,10 +375,13 @@ S32 LLSDXMLParser::Impl::parse(std::istream& input, LLSD& data)
{
break;
}
count = get_till_eol(input, (char *)buffer, BUFFER_SIZE);
if (!count)
{
break;
count = get_till_eol(input, (char *)buffer, BUFFER_SIZE);
if (!count)
{
break;
}
}
status = XML_ParseBuffer(mParser, count, false);
@ -742,6 +745,7 @@ void LLSDXMLParser::Impl::endElementHandler(const XML_Char* name)
case ELEMENT_INTEGER:
{
S32 i;
// sscanf okay here with different locales - ints don't change for different locale settings like floats do.
if ( sscanf(mCurrentContent.c_str(), "%d", &i ) == 1 )
{ // See if sscanf works - it's faster
value = i;
@ -756,15 +760,20 @@ void LLSDXMLParser::Impl::endElementHandler(const XML_Char* name)
case ELEMENT_REAL:
{
// SA: it seems sscanf does not always give expected result (for instance 0.009999999776482582092285156 is decoded as 0 under Linux)
/* F64 r;
if ( sscanf(mCurrentContent.c_str(), "%lf", &r ) == 1 )
{ // See if sscanf works - it's faster
value = r;
}
else*/
{
value = LLSD(mCurrentContent).asReal();
}
value = LLSD(mCurrentContent).asReal();
// removed since this breaks when locale has decimal separator that isn't '.'
// investigated changing local to something compatible each time but deemed higher
// risk that just using LLSD.asReal() each time.
//F64 r;
//if ( sscanf(mCurrentContent.c_str(), "%lf", &r ) == 1 )
//{ // See if sscanf works - it's faster
// value = r;
//}
//else
//{
// value = LLSD(mCurrentContent).asReal();
//}
}
break;

View File

@ -936,13 +936,18 @@ LLStringUtil::size_type LLStringUtil::getSubstitution(const std::string& instr,
{
const std::string delims (",");
// Find the first ]
size_type pos2 = instr.find(']', start);
// Find the first [
size_type pos1 = instr.find('[', start);
if (pos1 == std::string::npos)
return std::string::npos;
//Find the first ] after the initial [
size_type pos2 = instr.find(']', pos1);
if (pos2 == std::string::npos)
return std::string::npos;
// Find the last [ before ]
size_type pos1 = instr.find_last_of('[', pos2-1);
// Find the last [ before ] in case of nested [[]]
pos1 = instr.find_last_of('[', pos2-1);
if (pos1 == std::string::npos || pos1 < start)
return std::string::npos;

View File

@ -995,90 +995,89 @@ LLSD LLMemoryInfo::loadStatsMap()
stats.add("PrivateUsage KB", pmem.PrivateUsage/1024);
#elif LL_DARWIN
const vm_size_t pagekb(vm_page_size / 1024);
//
// Collect the vm_stat's
//
{
vm_statistics_data_t vmstat;
mach_msg_type_number_t vmstatCount = HOST_VM_INFO_COUNT;
{
vm_statistics_data_t vmstat;
mach_msg_type_number_t vmstatCount = HOST_VM_INFO_COUNT;
if (host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t) &vmstat, &vmstatCount) != KERN_SUCCESS)
{
LL_WARNS("LLMemoryInfo") << "Unable to collect memory information" << LL_ENDL;
}
else
{
stats.add("Pages free KB", pagekb * vmstat.free_count);
stats.add("Pages active KB", pagekb * vmstat.active_count);
stats.add("Pages inactive KB", pagekb * vmstat.inactive_count);
stats.add("Pages wired KB", pagekb * vmstat.wire_count);
if (host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t) &vmstat, &vmstatCount) != KERN_SUCCESS)
{
LL_WARNS("LLMemoryInfo") << "Unable to collect memory information" << LL_ENDL;
}
else
{
stats.add("Pages free KB", pagekb * vmstat.free_count);
stats.add("Pages active KB", pagekb * vmstat.active_count);
stats.add("Pages inactive KB", pagekb * vmstat.inactive_count);
stats.add("Pages wired KB", pagekb * vmstat.wire_count);
stats.add("Pages zero fill", vmstat.zero_fill_count);
stats.add("Page reactivations", vmstat.reactivations);
stats.add("Page-ins", vmstat.pageins);
stats.add("Page-outs", vmstat.pageouts);
stats.add("Faults", vmstat.faults);
stats.add("Faults copy-on-write", vmstat.cow_faults);
stats.add("Cache lookups", vmstat.lookups);
stats.add("Cache hits", vmstat.hits);
stats.add("Page purgeable count", vmstat.purgeable_count);
stats.add("Page purges", vmstat.purges);
stats.add("Page speculative reads", vmstat.speculative_count);
}
}
//
// Collect the misc task info
//
stats.add("Pages zero fill", vmstat.zero_fill_count);
stats.add("Page reactivations", vmstat.reactivations);
stats.add("Page-ins", vmstat.pageins);
stats.add("Page-outs", vmstat.pageouts);
{
task_events_info_data_t taskinfo;
unsigned taskinfoSize = sizeof(taskinfo);
if (task_info(mach_task_self(), TASK_EVENTS_INFO, (task_info_t) &taskinfo, &taskinfoSize) != KERN_SUCCESS)
{
LL_WARNS("LLMemoryInfo") << "Unable to collect task information" << LL_ENDL;
}
else
{
stats.add("Task page-ins", taskinfo.pageins);
stats.add("Task copy-on-write faults", taskinfo.cow_faults);
stats.add("Task messages sent", taskinfo.messages_sent);
stats.add("Task messages received", taskinfo.messages_received);
stats.add("Task mach system call count", taskinfo.syscalls_mach);
stats.add("Task unix system call count", taskinfo.syscalls_unix);
stats.add("Task context switch count", taskinfo.csw);
}
}
//
// Collect the basic task info
//
stats.add("Faults", vmstat.faults);
stats.add("Faults copy-on-write", vmstat.cow_faults);
stats.add("Cache lookups", vmstat.lookups);
stats.add("Cache hits", vmstat.hits);
stats.add("Page purgeable count", vmstat.purgeable_count);
stats.add("Page purges", vmstat.purges);
stats.add("Page speculative reads", vmstat.speculative_count);
}
}
//
// Collect the misc task info
//
{
task_events_info_data_t taskinfo;
unsigned taskinfoSize = sizeof(taskinfo);
if (task_info(mach_task_self(), TASK_EVENTS_INFO, (task_info_t) &taskinfo, &taskinfoSize) != KERN_SUCCESS)
{
LL_WARNS("LLMemoryInfo") << "Unable to collect task information" << LL_ENDL;
}
else
{
stats.add("Task page-ins", taskinfo.pageins);
stats.add("Task copy-on-write faults", taskinfo.cow_faults);
stats.add("Task messages sent", taskinfo.messages_sent);
stats.add("Task messages received", taskinfo.messages_received);
stats.add("Task mach system call count", taskinfo.syscalls_mach);
stats.add("Task unix system call count", taskinfo.syscalls_unix);
stats.add("Task context switch count", taskinfo.csw);
}
}
//
// Collect the basic task info
//
{
task_basic_info_64_data_t taskinfo;
unsigned taskinfoSize = sizeof(taskinfo);
if (task_info(mach_task_self(), TASK_BASIC_INFO_64, (task_info_t) &taskinfo, &taskinfoSize) != KERN_SUCCESS)
{
LL_WARNS("LLMemoryInfo") << "Unable to collect task information" << LL_ENDL;
}
else
{
stats.add("Basic suspend count", taskinfo.suspend_count);
stats.add("Basic virtual memory KB", taskinfo.virtual_size / 1024);
stats.add("Basic resident memory KB", taskinfo.resident_size / 1024);
stats.add("Basic new thread policy", taskinfo.policy);
}
}
{
task_basic_info_64_data_t taskinfo;
unsigned taskinfoSize = sizeof(taskinfo);
if (task_info(mach_task_self(), TASK_BASIC_INFO_64, (task_info_t) &taskinfo, &taskinfoSize) != KERN_SUCCESS)
{
LL_WARNS("LLMemoryInfo") << "Unable to collect task information" << LL_ENDL;
}
else
{
stats.add("Basic suspend count", taskinfo.suspend_count);
stats.add("Basic virtual memory KB", taskinfo.virtual_size / 1024);
stats.add("Basic resident memory KB", taskinfo.resident_size / 1024);
stats.add("Basic new thread policy", taskinfo.policy);
}
}
#elif LL_SOLARIS
U64 phys = 0;

View File

@ -28,7 +28,7 @@
#define LL_LLVERSIONVIEWER_H
const S32 LL_VERSION_MAJOR = 3;
const S32 LL_VERSION_MINOR = 0;
const S32 LL_VERSION_MINOR = 2;
const S32 LL_VERSION_PATCH = 1;
const S32 LL_VERSION_BUILD = 0;

View File

@ -34,8 +34,8 @@
//============================================================================
// Run on MAIN thread
LLWorkerThread::LLWorkerThread(const std::string& name, bool threaded) :
LLQueuedThread(name, threaded)
LLWorkerThread::LLWorkerThread(const std::string& name, bool threaded, bool should_pause) :
LLQueuedThread(name, threaded, should_pause)
{
mDeleteMutex = new LLMutex(NULL);

View File

@ -83,7 +83,7 @@ private:
LLMutex* mDeleteMutex;
public:
LLWorkerThread(const std::string& name, bool threaded = true);
LLWorkerThread(const std::string& name, bool threaded = true, bool should_pause = false);
~LLWorkerThread();
/*virtual*/ S32 update(U32 max_time_ms);

View File

@ -40,6 +40,7 @@
#include <boost/scoped_ptr.hpp>
// other Linden headers
#include "../test/lltut.h"
#include "wrapllerrs.h"
struct Keyed: public LLInstanceTracker<Keyed, std::string>
{
@ -90,79 +91,142 @@ namespace tut
ensure_equals(Keyed::instanceCount(), 0);
}
// template<> template<>
// void object::test<2>()
// {
// ensure_equals(Unkeyed::instanceCount(), 0);
// {
// Unkeyed one;
// ensure_equals(Unkeyed::instanceCount(), 1);
// Unkeyed* found = Unkeyed::getInstance(&one);
// ensure_equals(found, &one);
// {
// boost::scoped_ptr<Unkeyed> two(new Unkeyed);
// ensure_equals(Unkeyed::instanceCount(), 2);
// Unkeyed* found = Unkeyed::getInstance(two.get());
// ensure_equals(found, two.get());
// }
// ensure_equals(Unkeyed::instanceCount(), 1);
// }
// ensure_equals(Unkeyed::instanceCount(), 0);
// }
template<> template<>
void object::test<2>()
{
ensure_equals(Unkeyed::instanceCount(), 0);
{
Unkeyed one;
ensure_equals(Unkeyed::instanceCount(), 1);
Unkeyed* found = Unkeyed::getInstance(&one);
ensure_equals(found, &one);
{
boost::scoped_ptr<Unkeyed> two(new Unkeyed);
ensure_equals(Unkeyed::instanceCount(), 2);
Unkeyed* found = Unkeyed::getInstance(two.get());
ensure_equals(found, two.get());
}
ensure_equals(Unkeyed::instanceCount(), 1);
}
ensure_equals(Unkeyed::instanceCount(), 0);
}
// template<> template<>
// void object::test<3>()
// {
// Keyed one("one"), two("two"), three("three");
// // We don't want to rely on the underlying container delivering keys
// // in any particular order. That allows us the flexibility to
// // reimplement LLInstanceTracker using, say, a hash map instead of a
// // std::map. We DO insist that every key appear exactly once.
// typedef std::vector<std::string> StringVector;
// StringVector keys(Keyed::beginKeys(), Keyed::endKeys());
// std::sort(keys.begin(), keys.end());
// StringVector::const_iterator ki(keys.begin());
// ensure_equals(*ki++, "one");
// ensure_equals(*ki++, "three");
// ensure_equals(*ki++, "two");
// // Use ensure() here because ensure_equals would want to display
// // mismatched values, and frankly that wouldn't help much.
// ensure("didn't reach end", ki == keys.end());
template<> template<>
void object::test<3>()
{
Keyed one("one"), two("two"), three("three");
// We don't want to rely on the underlying container delivering keys
// in any particular order. That allows us the flexibility to
// reimplement LLInstanceTracker using, say, a hash map instead of a
// std::map. We DO insist that every key appear exactly once.
typedef std::vector<std::string> StringVector;
StringVector keys(Keyed::beginKeys(), Keyed::endKeys());
std::sort(keys.begin(), keys.end());
StringVector::const_iterator ki(keys.begin());
ensure_equals(*ki++, "one");
ensure_equals(*ki++, "three");
ensure_equals(*ki++, "two");
// Use ensure() here because ensure_equals would want to display
// mismatched values, and frankly that wouldn't help much.
ensure("didn't reach end", ki == keys.end());
// // Use a somewhat different approach to order independence with
// // beginInstances(): explicitly capture the instances we know in a
// // set, and delete them as we iterate through.
// typedef std::set<Keyed*> InstanceSet;
// InstanceSet instances;
// instances.insert(&one);
// instances.insert(&two);
// instances.insert(&three);
// for (Keyed::instance_iter ii(Keyed::beginInstances()), iend(Keyed::endInstances());
// ii != iend; ++ii)
// {
// Keyed& ref = *ii;
// ensure_equals("spurious instance", instances.erase(&ref), 1);
// }
// ensure_equals("unreported instance", instances.size(), 0);
// }
// Use a somewhat different approach to order independence with
// beginInstances(): explicitly capture the instances we know in a
// set, and delete them as we iterate through.
typedef std::set<Keyed*> InstanceSet;
InstanceSet instances;
instances.insert(&one);
instances.insert(&two);
instances.insert(&three);
for (Keyed::instance_iter ii(Keyed::beginInstances()), iend(Keyed::endInstances());
ii != iend; ++ii)
{
Keyed& ref = *ii;
ensure_equals("spurious instance", instances.erase(&ref), 1);
}
ensure_equals("unreported instance", instances.size(), 0);
}
// template<> template<>
// void object::test<4>()
// {
// Unkeyed one, two, three;
// typedef std::set<Unkeyed*> KeySet;
//
// KeySet instances;
// instances.insert(&one);
// instances.insert(&two);
// instances.insert(&three);
//for (Unkeyed::instance_iter ii(Unkeyed::beginInstances()), iend(Unkeyed::endInstances()); ii != iend; ++ii)
//{
// Unkeyed& ref = *ii;
// ensure_equals("spurious instance", instances.erase(&ref), 1);
//}
// ensure_equals("unreported instance", instances.size(), 0);
// }
template<> template<>
void object::test<4>()
{
Unkeyed one, two, three;
typedef std::set<Unkeyed*> KeySet;
KeySet instances;
instances.insert(&one);
instances.insert(&two);
instances.insert(&three);
for (Unkeyed::instance_iter ii(Unkeyed::beginInstances()), iend(Unkeyed::endInstances()); ii != iend; ++ii)
{
Unkeyed& ref = *ii;
ensure_equals("spurious instance", instances.erase(&ref), 1);
}
ensure_equals("unreported instance", instances.size(), 0);
}
template<> template<>
void object::test<5>()
{
set_test_name("delete Keyed with outstanding instance_iter");
std::string what;
Keyed* keyed = new Keyed("one");
{
WrapLL_ERRS wrapper;
Keyed::instance_iter i(Keyed::beginInstances());
try
{
delete keyed;
}
catch (const WrapLL_ERRS::FatalException& e)
{
what = e.what();
}
}
ensure(! what.empty());
}
template<> template<>
void object::test<6>()
{
set_test_name("delete Keyed with outstanding key_iter");
std::string what;
Keyed* keyed = new Keyed("one");
{
WrapLL_ERRS wrapper;
Keyed::key_iter i(Keyed::beginKeys());
try
{
delete keyed;
}
catch (const WrapLL_ERRS::FatalException& e)
{
what = e.what();
}
}
ensure(! what.empty());
}
template<> template<>
void object::test<7>()
{
set_test_name("delete Unkeyed with outstanding instance_iter");
std::string what;
Unkeyed* unkeyed = new Unkeyed;
{
WrapLL_ERRS wrapper;
Unkeyed::instance_iter i(Unkeyed::beginInstances());
try
{
delete unkeyed;
}
catch (const WrapLL_ERRS::FatalException& e)
{
what = e.what();
}
}
ensure(! what.empty());
}
} // namespace tut

View File

@ -1,10 +1,11 @@
/**
* @file llprocessor_test.cpp
* @date 2010-06-01
* @file llsingleton_test.cpp
* @date 2011-08-11
* @brief Unit test for the LLSingleton class
*
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public

View File

@ -624,6 +624,14 @@ namespace tut
subcount = LLStringUtil::format(s, fmt_map);
ensure_equals("LLStringUtil::format: Assorted Test2 result", s, "?Am I not a long string?short[A]bbbaaaba[A]");
ensure_equals("LLStringUtil::format: Assorted Test2 result count", 9, subcount);
// Test on nested brackets
std::string srcs6 = "[[TRICK1]][[A]][[B]][[AAA]][[BBB]][[TRICK2]][[KEYLONGER]][[KEYSHORTER]]?[[DELETE]]";
s = srcs6;
subcount = LLStringUtil::format(s, fmt_map);
ensure_equals("LLStringUtil::format: Assorted Test2 result", s, "[[A]][a][b][aaa][bbb][[A]][short][Am I not a long string?]?[]");
ensure_equals("LLStringUtil::format: Assorted Test2 result count", 9, subcount);
// Test an assorted substitution
std::string srcs8 = "foo[DELETE]bar?";

View File

@ -39,6 +39,7 @@
#include "llimagepng.h"
#include "llimagedxt.h"
#include "llimageworker.h"
#include "llmemory.h"
//---------------------------------------------------------------------------
// LLImage
@ -47,11 +48,14 @@
//static
std::string LLImage::sLastErrorMessage;
LLMutex* LLImage::sMutex = NULL;
LLPrivateMemoryPool* LLImageBase::sPrivatePoolp = NULL ;
//static
void LLImage::initClass()
{
sMutex = new LLMutex(NULL);
LLImageBase::createPrivatePool() ;
}
//static
@ -59,6 +63,8 @@ void LLImage::cleanupClass()
{
delete sMutex;
sMutex = NULL;
LLImageBase::destroyPrivatePool() ;
}
//static
@ -97,6 +103,25 @@ LLImageBase::~LLImageBase()
deleteData(); // virtual
}
//static
void LLImageBase::createPrivatePool()
{
if(!sPrivatePoolp)
{
sPrivatePoolp = LLPrivateMemoryPoolManager::getInstance()->newPool(LLPrivateMemoryPool::STATIC_THREADED) ;
}
}
//static
void LLImageBase::destroyPrivatePool()
{
if(sPrivatePoolp)
{
LLPrivateMemoryPoolManager::getInstance()->deletePool(sPrivatePoolp) ;
sPrivatePoolp = NULL ;
}
}
// virtual
void LLImageBase::dump()
{
@ -130,7 +155,7 @@ void LLImageBase::sanityCheck()
// virtual
void LLImageBase::deleteData()
{
delete[] mData;
FREE_MEM(sPrivatePoolp, mData) ;
mData = NULL;
mDataSize = 0;
}
@ -167,7 +192,7 @@ U8* LLImageBase::allocateData(S32 size)
{
deleteData(); // virtual
mBadBufferAllocation = false ;
mData = new U8[size];
mData = (U8*)ALLOCATE_MEM(sPrivatePoolp, size);
if (!mData)
{
llwarns << "allocate image data: " << size << llendl;
@ -185,7 +210,7 @@ U8* LLImageBase::allocateData(S32 size)
U8* LLImageBase::reallocateData(S32 size)
{
LLMemType mt1(mMemType);
U8 *new_datap = new U8[size];
U8 *new_datap = (U8*)ALLOCATE_MEM(sPrivatePoolp, size);
if (!new_datap)
{
llwarns << "Out of memory in LLImageBase::reallocateData" << llendl;
@ -195,7 +220,7 @@ U8* LLImageBase::reallocateData(S32 size)
{
S32 bytes = llmin(mDataSize, size);
memcpy(new_datap, mData, bytes); /* Flawfinder: ignore */
delete[] mData;
FREE_MEM(sPrivatePoolp, mData) ;
}
mData = new_datap;
mDataSize = size;
@ -341,6 +366,7 @@ BOOL LLImageRaw::resize(U16 width, U16 height, S8 components)
return TRUE;
}
#if 0
U8 * LLImageRaw::getSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height) const
{
LLMemType mt1(mMemType);
@ -361,6 +387,7 @@ U8 * LLImageRaw::getSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height) const
}
return data;
}
#endif
BOOL LLImageRaw::setSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height,
const U8 *data, U32 stride, BOOL reverse_y)
@ -830,6 +857,7 @@ void LLImageRaw::copyScaled( LLImageRaw* src )
}
}
#if 0
//scale down image by not blending a pixel with its neighbors.
BOOL LLImageRaw::scaleDownWithoutBlending( S32 new_width, S32 new_height)
{
@ -853,7 +881,7 @@ BOOL LLImageRaw::scaleDownWithoutBlending( S32 new_width, S32 new_height)
ratio_x -= 1.0f ;
ratio_y -= 1.0f ;
U8* new_data = new U8[new_data_size] ;
U8* new_data = allocateMemory(new_data_size) ;
llassert_always(new_data != NULL) ;
U8* old_data = getData() ;
@ -875,6 +903,7 @@ BOOL LLImageRaw::scaleDownWithoutBlending( S32 new_width, S32 new_height)
return TRUE ;
}
#endif
BOOL LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data )
{
@ -1506,6 +1535,7 @@ void LLImageFormatted::setData(U8 *data, S32 size)
{
deleteData();
setDataAndSize(data, size); // Access private LLImageBase members
sGlobalFormattedMemory += getDataSize();
}
}
@ -1524,7 +1554,7 @@ void LLImageFormatted::appendData(U8 *data, S32 size)
S32 newsize = cursize + size;
reallocateData(newsize);
memcpy(getData() + cursize, data, size);
delete[] data;
FREE_MEM(LLImageBase::getPrivatePool(), data);
}
}
}

View File

@ -29,7 +29,6 @@
#include "lluuid.h"
#include "llstring.h"
//#include "llmemory.h"
#include "llthread.h"
#include "llmemtype.h"
@ -69,6 +68,7 @@ const S32 MAX_IMG_PACKET_SIZE = 1000;
class LLImageFormatted;
class LLImageRaw;
class LLColor4U;
class LLPrivateMemoryPool;
typedef enum e_image_codec
{
@ -140,7 +140,7 @@ public:
protected:
// special accessor to allow direct setting of mData and mDataSize by LLImageFormatted
void setDataAndSize(U8 *data, S32 size) { mData = data; mDataSize = size; }
void setDataAndSize(U8 *data, S32 size) { mData = data; mDataSize = size; }
public:
static void generateMip(const U8 *indata, U8* mipdata, int width, int height, S32 nchannels);
@ -151,6 +151,10 @@ public:
static EImageCodec getCodecFromExtension(const std::string& exten);
static void createPrivatePool() ;
static void destroyPrivatePool() ;
static LLPrivateMemoryPool* getPrivatePool() {return sPrivatePoolp;}
private:
U8 *mData;
S32 mDataSize;
@ -162,6 +166,8 @@ private:
bool mBadBufferAllocation ;
bool mAllowOverSize ;
static LLPrivateMemoryPool* sPrivatePoolp ;
public:
LLMemType::DeclareMemType& mMemType; // debug
};
@ -185,7 +191,7 @@ public:
BOOL resize(U16 width, U16 height, S8 components);
U8 * getSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height) const;
//U8 * getSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height) const;
BOOL setSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height,
const U8 *data, U32 stride = 0, BOOL reverse_y = FALSE);
@ -197,7 +203,7 @@ public:
void contractToPowerOfTwo(S32 max_dim = MAX_IMAGE_SIZE, BOOL scale_image = TRUE);
void biasedScaleToPowerOfTwo(S32 max_dim = MAX_IMAGE_SIZE);
BOOL scale( S32 new_width, S32 new_height, BOOL scale_image = TRUE );
BOOL scaleDownWithoutBlending( S32 new_width, S32 new_height) ;
//BOOL scaleDownWithoutBlending( S32 new_width, S32 new_height) ;
// Fill the buffer with a constant color
void fill( const LLColor4U& color );

View File

@ -26,6 +26,7 @@
#include "linden_common.h"
#include "llimagedxt.h"
#include "llmemory.h"
//static
void LLImageDXT::checkMinWidthHeight(EFileFormat format, S32& width, S32& height)
@ -429,7 +430,7 @@ bool LLImageDXT::convertToDXR()
S32 nmips = calcNumMips(width,height);
S32 total_bytes = getDataSize();
U8* olddata = getData();
U8* newdata = new U8[total_bytes];
U8* newdata = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), total_bytes);
if (!newdata)
{
llerrs << "Out of memory in LLImageDXT::convertToDXR()" << llendl;

View File

@ -29,6 +29,7 @@
#include "llmemtype.h"
#include "lltimer.h"
#include "llmath.h"
#include "llmemory.h"
typedef LLImageJ2CImpl* (*CreateLLImageJ2CFunction)();
typedef void (*DestroyLLImageJ2CFunction)(LLImageJ2CImpl*);
@ -394,14 +395,14 @@ BOOL LLImageJ2C::loadAndValidate(const std::string &filename)
}
else
{
U8 *data = new U8[file_size];
U8 *data = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), file_size);
apr_size_t bytes_read = file_size;
apr_status_t s = apr_file_read(apr_file, data, &bytes_read); // modifies bytes_read
infile.close() ;
if (s != APR_SUCCESS || (S32)bytes_read != file_size)
{
delete[] data;
FREE_MEM(LLImageBase::getPrivatePool(), data);
setLastError("Unable to read entire file");
res = FALSE;
}

View File

@ -62,14 +62,14 @@ add_library (llinventory ${llinventory_SOURCE_FILES})
#add unit tests
if (LL_TESTS)
INCLUDE(LLAddBuildTest)
SET(llinventory_TEST_SOURCE_FILES
# no real unit tests yet!
)
LL_ADD_PROJECT_UNIT_TESTS(llinventory "${llinventory_TEST_SOURCE_FILES}")
INCLUDE(LLAddBuildTest)
SET(llinventory_TEST_SOURCE_FILES
# no real unit tests yet!
)
LL_ADD_PROJECT_UNIT_TESTS(llinventory "${llinventory_TEST_SOURCE_FILES}")
#set(TEST_DEBUG on)
set(test_libs llinventory ${LLMESSAGE_LIBRARIES} ${LLVFS_LIBRARIES} ${LLMATH_LIBRARIES} ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES})
LL_ADD_INTEGRATION_TEST(inventorymisc "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llparcel "" "${test_libs}")
#set(TEST_DEBUG on)
set(test_libs llinventory ${LLMESSAGE_LIBRARIES} ${LLVFS_LIBRARIES} ${LLMATH_LIBRARIES} ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES})
LL_ADD_INTEGRATION_TEST(inventorymisc "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llparcel "" "${test_libs}")
endif (LL_TESTS)

View File

@ -1138,8 +1138,11 @@ void LLInventoryItem::asLLSD( LLSD& sd ) const
sd[INV_CREATION_DATE_LABEL] = (S32) mCreationDate;
}
LLFastTimer::DeclareTimer FTM_INVENTORY_SD_DESERIALIZE("Inventory SD Deserialize");
bool LLInventoryItem::fromLLSD(const LLSD& sd)
{
LLFastTimer _(FTM_INVENTORY_SD_DESERIALIZE);
mInventoryType = LLInventoryType::IT_NONE;
mAssetUUID.setNull();
std::string w;

View File

@ -1373,12 +1373,3 @@ LLParcel::ECategory category_ui_string_to_category(const std::string& s)
// is a distinct option from "None" and "Other"
return LLParcel::C_ANY;
}
void LLParcel::updateQuota( const LLUUID& objectId, const ParcelQuota& quota )
{
if ( mID == objectId )
{
mQuota = quota;
}
}

View File

@ -34,7 +34,6 @@
#include "llpermissions.h"
#include "lltimer.h"
#include "v3math.h"
#include "llaccountingquota.h"
// Grid out of which parcels taken is stepped every 4 meters.
const F32 PARCEL_GRID_STEP_METERS = 4.f;
@ -603,9 +602,6 @@ public:
BOOL getSellWithObjects() const { return (mParcelFlags & PF_SELL_PARCEL_OBJECTS) ? TRUE : FALSE; }
void updateQuota( const LLUUID& objectId, const ParcelQuota& quota );
const ParcelQuota& getQuota( void ) { return mQuota; }
protected:
LLUUID mID;
LLUUID mOwnerID;
@ -681,7 +677,6 @@ protected:
BOOL mAllowGroupAVSounds;
BOOL mAllowAnyAVSounds;
ParcelQuota mQuota;
public:
// HACK, make private

View File

@ -30,7 +30,7 @@ set(llkdu_SOURCE_FILES
set(llkdu_HEADER_FILES
CMakeLists.txt
llimagej2ckdu.h
llkdumem.h
)

View File

@ -1,9 +1,26 @@
/*
* LLCalc.cpp
* SecondLife
*
* Created by Aimee Walton on 28/09/2008.
* Copyright 2008 Aimee Walton.
* Copyright 2008 Aimee Walton.
* $LicenseInfo:firstyear=2008&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2008, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*
*/

View File

@ -1,9 +1,26 @@
/*
* LLCalc.h
* SecondLife
*
* Created by Aimee Walton on 28/09/2008.
* Copyright 2008 Aimee Walton.
* $LicenseInfo:firstyear=2008&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2008, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*
*/

View File

@ -1,9 +1,26 @@
/*
* LLCalcParser.cpp
* SecondLife
*
* Created by Aimee Walton on 28/09/2008.
* Copyright 2008 Aimee Walton.
* $LicenseInfo:firstyear=2008&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2008, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*
*/

View File

@ -1,9 +1,26 @@
/*
* LLCalcParser.h
* SecondLife
*
* Created by Aimee Walton on 28/09/2008.
* Copyright 2008 Aimee Walton.
* $LicenseInfo:firstyear=2008&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2008, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*
*/

View File

@ -510,6 +510,13 @@ inline void ll_remove_outliers(std::vector<VEC_TYPE>& data, F32 k)
VEC_TYPE Q1 = data[data.size()/4];
VEC_TYPE Q3 = data[data.size()-data.size()/4-1];
if ((F32)(Q3-Q1) < 1.f)
{
// not enough variation to detect outliers
return;
}
VEC_TYPE min = (VEC_TYPE) ((F32) Q1-k * (F32) (Q3-Q1));
VEC_TYPE max = (VEC_TYPE) ((F32) Q3+k * (F32) (Q3-Q1));

179
indra/llmath/llvolume.cpp Executable file → Normal file
View File

@ -2086,7 +2086,7 @@ LLVolume::LLVolume(const LLVolumeParams &params, const F32 detail, const BOOL ge
mFaceMask = 0x0;
mDetail = detail;
mSculptLevel = -2;
mIsTetrahedron = FALSE;
mIsMeshAssetLoaded = FALSE;
mLODScaleBias.setVec(1,1,1);
mHullPoints = NULL;
mHullIndices = NULL;
@ -2108,7 +2108,7 @@ LLVolume::LLVolume(const LLVolumeParams &params, const F32 detail, const BOOL ge
generate();
if (mParams.getSculptID().isNull() && mParams.getSculptType() == LL_SCULPT_TYPE_NONE)
if (mParams.getSculptID().isNull() && mParams.getSculptType() == LL_SCULPT_TYPE_NONE || mParams.getSculptType() == LL_SCULPT_TYPE_MESH)
{
createVolumeFaces();
}
@ -2416,7 +2416,7 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size)
LLSD mdl;
if (!unzip_llsd(mdl, is, size))
{
llwarns << "not a valid mesh asset!" << llendl;
LL_DEBUGS("MeshStreaming") << "Failed to unzip LLSD blob for LoD, will probably fetch from sim again." << llendl;
return false;
}
@ -2714,173 +2714,21 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size)
return true;
}
void tetrahedron_set_normal(LLVolumeFace::VertexData* cv)
BOOL LLVolume::isMeshAssetLoaded()
{
LLVector4a v0;
v0.setSub(cv[1].getPosition(), cv[0].getNormal());
LLVector4a v1;
v1.setSub(cv[2].getNormal(), cv[0].getPosition());
cv[0].getNormal().setCross3(v0,v1);
cv[0].getNormal().normalize3fast();
cv[1].setNormal(cv[0].getNormal());
cv[2].setNormal(cv[1].getNormal());
return mIsMeshAssetLoaded;
}
BOOL LLVolume::isTetrahedron()
void LLVolume::setMeshAssetLoaded(BOOL loaded)
{
return mIsTetrahedron;
}
void LLVolume::makeTetrahedron()
{
mVolumeFaces.clear();
LLVolumeFace face;
F32 x = 0.25f;
LLVector4a p[] =
{ //unit tetrahedron corners
LLVector4a(x,x,x),
LLVector4a(-x,-x,x),
LLVector4a(-x,x,-x),
LLVector4a(x,-x,-x)
};
face.mExtents[0].splat(-x);
face.mExtents[1].splat(x);
LLVolumeFace::VertexData cv[3];
//set texture coordinates
cv[0].mTexCoord = LLVector2(0,0);
cv[1].mTexCoord = LLVector2(1,0);
cv[2].mTexCoord = LLVector2(0.5f, 0.5f*F_SQRT3);
//side 1
cv[0].setPosition(p[1]);
cv[1].setPosition(p[0]);
cv[2].setPosition(p[2]);
tetrahedron_set_normal(cv);
face.resizeVertices(12);
face.resizeIndices(12);
LLVector4a* v = (LLVector4a*) face.mPositions;
LLVector4a* n = (LLVector4a*) face.mNormals;
LLVector2* tc = (LLVector2*) face.mTexCoords;
v[0] = cv[0].getPosition();
v[1] = cv[1].getPosition();
v[2] = cv[2].getPosition();
v += 3;
n[0] = cv[0].getNormal();
n[1] = cv[1].getNormal();
n[2] = cv[2].getNormal();
n += 3;
if(tc)
{
tc[0] = cv[0].mTexCoord;
tc[1] = cv[1].mTexCoord;
tc[2] = cv[2].mTexCoord;
tc += 3;
}
//side 2
cv[0].setPosition(p[3]);
cv[1].setPosition(p[0]);
cv[2].setPosition(p[1]);
tetrahedron_set_normal(cv);
v[0] = cv[0].getPosition();
v[1] = cv[1].getPosition();
v[2] = cv[2].getPosition();
v += 3;
n[0] = cv[0].getNormal();
n[1] = cv[1].getNormal();
n[2] = cv[2].getNormal();
n += 3;
if(tc)
{
tc[0] = cv[0].mTexCoord;
tc[1] = cv[1].mTexCoord;
tc[2] = cv[2].mTexCoord;
tc += 3;
}
//side 3
cv[0].setPosition(p[3]);
cv[1].setPosition(p[1]);
cv[2].setPosition(p[2]);
tetrahedron_set_normal(cv);
v[0] = cv[0].getPosition();
v[1] = cv[1].getPosition();
v[2] = cv[2].getPosition();
v += 3;
n[0] = cv[0].getNormal();
n[1] = cv[1].getNormal();
n[2] = cv[2].getNormal();
n += 3;
if(tc)
{
tc[0] = cv[0].mTexCoord;
tc[1] = cv[1].mTexCoord;
tc[2] = cv[2].mTexCoord;
tc += 3;
}
//side 4
cv[0].setPosition(p[2]);
cv[1].setPosition(p[0]);
cv[2].setPosition(p[3]);
tetrahedron_set_normal(cv);
v[0] = cv[0].getPosition();
v[1] = cv[1].getPosition();
v[2] = cv[2].getPosition();
v += 3;
n[0] = cv[0].getNormal();
n[1] = cv[1].getNormal();
n[2] = cv[2].getNormal();
n += 3;
if(tc)
{
tc[0] = cv[0].mTexCoord;
tc[1] = cv[1].mTexCoord;
tc[2] = cv[2].mTexCoord;
tc += 3;
}
//set index buffer
for (U16 i = 0; i < 12; i++)
{
face.mIndices[i] = i;
}
mVolumeFaces.push_back(face);
mSculptLevel = 0;
mIsTetrahedron = TRUE;
mIsMeshAssetLoaded = loaded;
}
void LLVolume::copyVolumeFaces(const LLVolume* volume)
{
mVolumeFaces = volume->mVolumeFaces;
mSculptLevel = 0;
mIsTetrahedron = FALSE;
}
void LLVolume::cacheOptimize()
@ -2894,14 +2742,7 @@ void LLVolume::cacheOptimize()
S32 LLVolume::getNumFaces() const
{
U8 sculpt_type = (mParams.getSculptType() & LL_SCULPT_TYPE_MASK);
if (sculpt_type == LL_SCULPT_TYPE_MESH)
{
return LL_SCULPT_MESH_MAX_FACES;
}
return (S32)mProfilep->mFaces.size();
return mIsMeshAssetLoaded ? getNumVolumeFaces() : (S32)mProfilep->mFaces.size();
}
@ -7277,7 +7118,7 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build)
resizeVertices(num_vertices);
resizeIndices(num_indices);
if ((volume->getParams().getSculptType() & LL_SCULPT_TYPE_MASK) != LL_SCULPT_TYPE_MESH)
if (!volume->isMeshAssetLoaded())
{
mEdge.resize(num_indices);
}

View File

@ -1063,14 +1063,14 @@ protected:
public:
virtual bool unpackVolumeFaces(std::istream& is, S32 size);
virtual void makeTetrahedron();
virtual BOOL isTetrahedron();
virtual void setMeshAssetLoaded(BOOL loaded);
virtual BOOL isMeshAssetLoaded();
protected:
BOOL mUnique;
F32 mDetail;
S32 mSculptLevel;
BOOL mIsTetrahedron;
BOOL mIsMeshAssetLoaded;
LLVolumeParams mParams;
LLPath *mPathp;

View File

@ -564,4 +564,22 @@ namespace tut
z1 = U8_to_F32(F32_to_U8(z, lowerz, upperz), lowerz, upperz);
ensure("2:quantize8: Fail ", is_approx_equal(x1, vec3a.mV[VX]) && is_approx_equal(y1, vec3a.mV[VY]) && is_approx_equal(z1, vec3a.mV[VZ]));
}
template<> template<>
void v3math_object::test<35>()
{
LLSD sd = LLSD::emptyArray();
sd[0] = 1.f;
LLVector3 parsed_1(sd);
ensure("1:LLSD parse: Fail ", is_approx_equal(parsed_1.mV[VX], 1.f) && is_approx_equal(parsed_1.mV[VY], 0.f) && is_approx_equal(parsed_1.mV[VZ], 0.f));
sd[1] = 2.f;
LLVector3 parsed_2(sd);
ensure("2:LLSD parse: Fail ", is_approx_equal(parsed_2.mV[VX], 1.f) && is_approx_equal(parsed_2.mV[VY], 2.f) && is_approx_equal(parsed_2.mV[VZ], 0.f));
sd[2] = 3.f;
LLVector3 parsed_3(sd);
ensure("3:LLSD parse: Fail ", is_approx_equal(parsed_3.mV[VX], 1.f) && is_approx_equal(parsed_3.mV[VY], 2.f) && is_approx_equal(parsed_3.mV[VZ], 3.f));
}
}

View File

@ -222,7 +222,7 @@ namespace boost
std::set<CURL*> LLCurl::Easy::sFreeHandles;
std::set<CURL*> LLCurl::Easy::sActiveHandles;
LLMutex* LLCurl::Easy::sHandleMutex = NULL;
LLMutex* LLCurl::Easy::sMultiMutex = NULL;
//static
CURL* LLCurl::Easy::allocEasyHandle()
@ -553,6 +553,11 @@ LLCurl::Multi::~Multi()
{
llassert(isStopped());
if (LLCurl::sMultiThreaded)
{
LLCurl::Easy::sMultiMutex->lock();
}
delete mSignal;
mSignal = NULL;
@ -573,6 +578,11 @@ LLCurl::Multi::~Multi()
check_curl_multi_code(curl_multi_cleanup(mCurlMultiHandle));
--gCurlMultiCount;
if (LLCurl::sMultiThreaded)
{
LLCurl::Easy::sMultiMutex->unlock();
}
}
CURLMsg* LLCurl::Multi::info_read(S32* msgs_in_queue)
@ -606,6 +616,7 @@ void LLCurl::Multi::run()
mPerformState = PERFORM_STATE_PERFORMING;
if (!mQuitting)
{
LLMutexLock lock(LLCurl::Easy::sMultiMutex);
doPerform();
}
}
@ -1179,6 +1190,7 @@ void LLCurl::initClass(bool multi_threaded)
check_curl_code(code);
Easy::sHandleMutex = new LLMutex(NULL);
Easy::sMultiMutex = new LLMutex(NULL);
#if SAFE_SSL
S32 mutex_count = CRYPTO_num_locks();
@ -1200,6 +1212,8 @@ void LLCurl::cleanupClass()
delete Easy::sHandleMutex;
Easy::sHandleMutex = NULL;
delete Easy::sMultiMutex;
Easy::sMultiMutex = NULL;
for (std::set<CURL*>::iterator iter = Easy::sFreeHandles.begin(); iter != Easy::sFreeHandles.end(); ++iter)
{

2
indra/llmessage/llcurl.h Normal file → Executable file
View File

@ -232,6 +232,7 @@ public:
private:
friend class LLCurl;
friend class LLCurl::Multi;
CURL* mCurlEasyHandle;
struct curl_slist* mHeaders;
@ -251,6 +252,7 @@ private:
static std::set<CURL*> sFreeHandles;
static std::set<CURL*> sActiveHandles;
static LLMutex* sHandleMutex;
static LLMutex* sMultiMutex;
};
class LLCurl::Multi : public LLThread

View File

@ -157,7 +157,6 @@ public:
*/
void setNonBlocking();
protected:
/**
* @brief Protected constructor since should only make sockets

View File

@ -44,12 +44,12 @@ bool LLProxy::sUDPProxyEnabled = false;
// Some helpful TCP static functions.
static apr_status_t tcp_blocking_handshake(LLSocket::ptr_t handle, char * dataout, apr_size_t outlen, char * datain, apr_size_t maxinlen); // Do a TCP data handshake
static LLSocket::ptr_t tcp_open_channel(apr_pool_t* pool, LLHost host); // Open a TCP channel to a given host
static LLSocket::ptr_t tcp_open_channel(LLHost host); // Open a TCP channel to a given host
static void tcp_close_channel(LLSocket::ptr_t* handle_ptr); // Close an open TCP channel
LLProxy::LLProxy():
mHTTPProxyEnabled(false),
mProxyMutex(0),
mProxyMutex(NULL),
mUDPProxy(),
mTCPProxy(),
mHTTPProxy(),
@ -180,7 +180,6 @@ S32 LLProxy::proxyHandshake(LLHost proxy)
mUDPProxy.setAddress(proxy.getAddress());
// The connection was successful. We now have the UDP port to send requests that need forwarding to.
LL_INFOS("Proxy") << "SOCKS 5 UDP proxy connected on " << mUDPProxy << LL_ENDL;
sUDPProxyEnabled = true;
return SOCKS_OK;
}
@ -210,7 +209,7 @@ S32 LLProxy::startSOCKSProxy(LLHost host)
// Close any running SOCKS connection.
stopSOCKSProxy();
mProxyControlChannel = tcp_open_channel(gAPRPoolp, mTCPProxy);
mProxyControlChannel = tcp_open_channel(mTCPProxy);
if (!mProxyControlChannel)
{
return SOCKS_HOST_CONNECT_FAILED;
@ -223,6 +222,11 @@ S32 LLProxy::startSOCKSProxy(LLHost host)
// Shut down the proxy if any of the above steps failed.
stopSOCKSProxy();
}
else
{
// Connection was successful.
sUDPProxyEnabled = true;
}
return status;
}
@ -515,13 +519,12 @@ static apr_status_t tcp_blocking_handshake(LLSocket::ptr_t handle, char * dataou
*
* Checks for a successful connection, and makes sure the connection is closed if it fails.
*
* @param pool APR pool to pass into the LLSocket.
* @param host The host to open the connection to.
* @return The created socket. Will evaluate as NULL if the connection is unsuccessful.
*/
static LLSocket::ptr_t tcp_open_channel(apr_pool_t* pool, LLHost host)
static LLSocket::ptr_t tcp_open_channel(LLHost host)
{
LLSocket::ptr_t socket = LLSocket::create(pool, LLSocket::STREAM_TCP);
LLSocket::ptr_t socket = LLSocket::create(NULL, LLSocket::STREAM_TCP);
bool connected = socket->blockingConnect(host);
if (!connected)
{

View File

@ -68,18 +68,18 @@ add_subdirectory(slplugin)
# Add tests
if (LL_TESTS)
include(LLAddBuildTest)
# UNIT TESTS
SET(llplugin_TEST_SOURCE_FILES
llplugincookiestore.cpp
)
include(LLAddBuildTest)
# UNIT TESTS
SET(llplugin_TEST_SOURCE_FILES
llplugincookiestore.cpp
)
# llplugincookiestore has a dependency on curl, so we need to link the curl library into the test.
set_source_files_properties(
llplugincookiestore.cpp
PROPERTIES
LL_TEST_ADDITIONAL_LIBRARIES "${CURL_LIBRARIES}"
)
# llplugincookiestore has a dependency on curl, so we need to link the curl library into the test.
set_source_files_properties(
llplugincookiestore.cpp
PROPERTIES
LL_TEST_ADDITIONAL_LIBRARIES "${CURL_LIBRARIES}"
)
LL_ADD_PROJECT_UNIT_TESTS(llplugin "${llplugin_TEST_SOURCE_FILES}")
LL_ADD_PROJECT_UNIT_TESTS(llplugin "${llplugin_TEST_SOURCE_FILES}")
endif (LL_TESTS)

File diff suppressed because it is too large Load Diff

View File

@ -44,7 +44,7 @@ public:
~LLPluginClassMedia();
// local initialization, called by the media manager when creating a source
bool init(const std::string &launcher_filename,
bool init(const std::string &launcher_filename,
const std::string &plugin_dir,
const std::string &plugin_filename,
bool debug);
@ -212,7 +212,7 @@ public:
void browse_forward();
void browse_back();
void setBrowserUserAgent(const std::string& user_agent);
void showWebInspector( bool show );
void showWebInspector( bool show );
void proxyWindowOpened(const std::string &target, const std::string &uuid);
void proxyWindowClosed(const std::string &uuid);
void ignore_ssl_cert_errors(bool ignore);
@ -247,9 +247,9 @@ public:
// This is valid during MEDIA_EVENT_CLICK_LINK_HREF and MEDIA_EVENT_GEOMETRY_CHANGE
std::string getClickUUID() const { return mClickUUID; };
// These are valid during MEDIA_EVENT_DEBUG_MESSAGE
std::string getDebugMessageText() const { return mDebugMessageText; };
// These are valid during MEDIA_EVENT_DEBUG_MESSAGE
std::string getDebugMessageText() const { return mDebugMessageText; };
std::string getDebugMessageLevel() const { return mDebugMessageLevel; };
// This is valid after MEDIA_EVENT_NAVIGATE_ERROR_PAGE
@ -403,7 +403,7 @@ protected:
std::string mClickNavType;
std::string mClickTarget;
std::string mClickUUID;
std::string mDebugMessageText;
std::string mDebugMessageText;
std::string mDebugMessageLevel;
S32 mGeometryX;
S32 mGeometryY;

View File

@ -410,7 +410,7 @@ void LLPluginProcessChild::receiveMessageRaw(const std::string &message)
}
else if(message_name == "sleep_time")
{
mSleepTime = parsed.getValueReal("time");
mSleepTime = llmax(parsed.getValueReal("time"), 1.0 / 100.0); // clamp to maximum of 100Hz
}
else if(message_name == "crash")
{

View File

@ -927,6 +927,7 @@ void LLPluginProcessParent::receiveMessage(const LLPluginMessage &message)
}
// Send initial sleep time
llassert_always(mSleepTime != 0.f);
setSleepTime(mSleepTime, true);
setState(STATE_RUNNING);

View File

@ -59,9 +59,9 @@ add_library (llprimitive ${llprimitive_SOURCE_FILES})
#add unit tests
if (LL_TESTS)
INCLUDE(LLAddBuildTest)
SET(llprimitive_TEST_SOURCE_FILES
llmediaentry.cpp
)
LL_ADD_PROJECT_UNIT_TESTS(llprimitive "${llprimitive_TEST_SOURCE_FILES}")
INCLUDE(LLAddBuildTest)
SET(llprimitive_TEST_SOURCE_FILES
llmediaentry.cpp
)
LL_ADD_PROJECT_UNIT_TESTS(llprimitive "${llprimitive_TEST_SOURCE_FILES}")
endif (LL_TESTS)

View File

@ -1679,6 +1679,19 @@ LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, BOOL nowrite, BO
LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos)
{
//1. If a vertex has been weighted then we'll find it via pos and return it's weight list
weight_map::iterator iterPos = mSkinWeights.begin();
weight_map::iterator iterEnd = mSkinWeights.end();
for ( ; iterPos!=iterEnd; ++iterPos )
{
if ( jointPositionalLookup( iterPos->first, pos ) )
{
return iterPos->second;
}
}
//2. Otherwise we'll use the older implementation
weight_map::iterator iter = mSkinWeights.find(pos);
if (iter != mSkinWeights.end())
@ -1692,13 +1705,13 @@ LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos)
}
else
{ //no exact match found, get closest point
const F32 epsilon = 2.f/65536;
const F32 epsilon = 1e-5f;
weight_map::iterator iter_up = mSkinWeights.lower_bound(pos);
weight_map::iterator iter_down = ++iter_up;
weight_map::iterator best = iter_up;
F32 min_dist = (iter->first - pos).magVecSquared();
F32 min_dist = (iter->first - pos).magVec();
bool done = false;
while (!done)
@ -1709,7 +1722,7 @@ LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos)
if (iter_up != mSkinWeights.end() && ++iter_up != mSkinWeights.end())
{
done = false;
F32 dist = (iter_up->first - pos).magVecSquared();
F32 dist = (iter_up->first - pos).magVec();
if (dist < epsilon)
{
@ -1727,7 +1740,7 @@ LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos)
{
done = false;
F32 dist = (iter_down->first - pos).magVecSquared();
F32 dist = (iter_down->first - pos).magVec();
if (dist < epsilon)
{
@ -1890,14 +1903,71 @@ bool LLModel::loadModel(std::istream& is)
}
void LLModel::matchMaterialOrder(LLModel* ref)
bool LLModel::isMaterialListSubset( LLModel* ref )
{
llassert(ref->mMaterialList.size() == mMaterialList.size());
int refCnt = ref->mMaterialList.size();
int modelCnt = mMaterialList.size();
for (U32 src = 0; src < modelCnt; ++src)
{
bool foundRef = false;
for (U32 dst = 0; dst < refCnt; ++dst)
{
//llinfos<<mMaterialList[src]<<" "<<ref->mMaterialList[dst]<<llendl;
foundRef = mMaterialList[src] == ref->mMaterialList[dst];
if ( foundRef )
{
break;
}
}
if (!foundRef)
{
return false;
}
}
return true;
}
bool LLModel::needToAddFaces( LLModel* ref, int& refFaceCnt, int& modelFaceCnt )
{
bool changed = false;
if ( refFaceCnt< modelFaceCnt )
{
refFaceCnt += modelFaceCnt - refFaceCnt;
changed = true;
}
else
if ( modelFaceCnt < refFaceCnt )
{
modelFaceCnt += refFaceCnt - modelFaceCnt;
changed = true;
}
return changed;
}
bool LLModel::matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCnt )
{
//Is this a subset?
//LODs cannot currently add new materials, e.g.
//1. ref = a,b,c lod1 = d,e => This is not permitted
//2. ref = a,b,c lod1 = c => This would be permitted
bool isASubset = isMaterialListSubset( ref );
if ( !isASubset )
{
llinfos<<"Material of model is not a subset of reference."<<llendl;
return false;
}
std::map<std::string, U32> index_map;
//build a map of material slot names to face indexes
bool reorder = false;
std::set<std::string> base_mat;
std::set<std::string> cur_mat;
@ -1939,6 +2009,7 @@ void LLModel::matchMaterialOrder(LLModel* ref)
//override material list with reference model ordering
mMaterialList = ref->mMaterialList;
return true;
}
@ -2329,8 +2400,6 @@ LLSD LLModel::Decomposition::asLLSD() const
for (U32 k = 0; k < 3; k++)
{
llassert(v[k] <= 0.51f && v[k] >= -0.51f);
//convert to 16-bit normalized across domain
U16 val = (U16) (((v[k]-min.mV[k])/range.mV[k])*65535);

View File

@ -148,6 +148,7 @@ public:
static LLModel* loadModelFromDomMesh(domMesh* mesh);
static std::string getElementLabel(daeElement* element);
std::string getName() const;
std::string getMetric() const {return mMetric;}
EModelStatus getStatus() const {return mStatus;}
static std::string getStatusString(U32 status) ;
@ -175,8 +176,10 @@ public:
//reorder face list based on mMaterialList in this and reference so
//order matches that of reference (material ordering touchup)
void matchMaterialOrder(LLModel* reference);
bool matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCnt );
bool isMaterialListSubset( LLModel* ref );
bool needToAddFaces( LLModel* ref, int& refFaceCnt, int& modelFaceCnt );
std::vector<std::string> mMaterialList;
//data used for skin weights
@ -217,6 +220,19 @@ public:
}
};
//Are the doubles the same w/in epsilon specified tolerance
bool areEqual( double a, double b )
{
const float epsilon = 1e-5f;
return (fabs((a - b)) < epsilon) ? true : false ;
}
//Make sure that we return false for any values that are within the tolerance for equivalence
bool jointPositionalLookup( const LLVector3& a, const LLVector3& b )
{
return ( areEqual( a[0],b[0]) && areEqual( a[1],b[1] ) && areEqual( a[2],b[2]) ) ? true : false;
}
//copy of position array for this model -- mPosition[idx].mV[X,Y,Z]
std::vector<LLVector3> mPosition;
@ -234,6 +250,8 @@ public:
std::string mRequestedLabel; // name requested in UI, if any.
std::string mLabel; // name computed from dae.
std::string mMetric; // user-supplied metric data for upload
LLVector3 mNormalizedScale;
LLVector3 mNormalizedTranslation;

0
indra/llprimitive/llprimitive.h Executable file → Normal file
View File

View File

@ -190,6 +190,8 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
origin.mV[VY] -= llround((F32)sCurOrigin.mY) - (sCurOrigin.mY);
// don't forget to do the depth translation, too. -Zi
// Depth translation, so that floating text appears 'inworld'
// and is correclty occluded.
gGL.translatef(0.f,0.f,sCurOrigin.mZ);
S32 chars_drawn = 0;

View File

@ -927,13 +927,7 @@ LLRender::LLRender()
mMode(LLRender::TRIANGLES),
mCurrTextureUnitIndex(0),
mMaxAnisotropy(0.f)
{
mBuffer = new LLVertexBuffer(immediate_mask, 0);
mBuffer->allocateBuffer(4096, 0, TRUE);
mBuffer->getVertexStrider(mVerticesp);
mBuffer->getTexCoord0Strider(mTexcoordsp);
mBuffer->getColorStrider(mColorsp);
{
mTexUnits.reserve(LL_NUM_TEXTURE_LAYERS);
for (U32 i = 0; i < LL_NUM_TEXTURE_LAYERS; i++)
{
@ -964,6 +958,17 @@ LLRender::~LLRender()
shutdown();
}
void LLRender::init()
{
llassert_always(mBuffer.isNull()) ;
mBuffer = new LLVertexBuffer(immediate_mask, 0);
mBuffer->allocateBuffer(4096, 0, TRUE);
mBuffer->getVertexStrider(mVerticesp);
mBuffer->getTexCoord0Strider(mTexcoordsp);
mBuffer->getColorStrider(mColorsp);
}
void LLRender::shutdown()
{
for (U32 i = 0; i < mTexUnits.size(); i++)
@ -979,6 +984,7 @@ void LLRender::shutdown()
delete mLightState[i];
}
mLightState.clear();
mBuffer = NULL ;
}
void LLRender::refreshState(void)

View File

@ -310,6 +310,7 @@ public:
LLRender();
~LLRender();
void init() ;
void shutdown();
// Refreshes renderer state to the cached values

View File

@ -25,7 +25,6 @@
*/
#include "linden_common.h"
#include "llmemory.h"
#include <boost/static_assert.hpp>
#include "llsys.h"
@ -36,6 +35,7 @@
#include "llrender.h"
#include "llvector4a.h"
#include "llglslshader.h"
#include "llmemory.h"
//============================================================================
@ -46,6 +46,7 @@ LLVBOPool LLVertexBuffer::sDynamicVBOPool;
LLVBOPool LLVertexBuffer::sStreamIBOPool;
LLVBOPool LLVertexBuffer::sDynamicIBOPool;
LLPrivateMemoryPool* LLVertexBuffer::sPrivatePoolp = NULL ;
U32 LLVertexBuffer::sBindCount = 0;
U32 LLVertexBuffer::sSetCount = 0;
S32 LLVertexBuffer::sCount = 0;
@ -443,6 +444,11 @@ void LLVertexBuffer::initClass(bool use_vbo, bool no_vbo_mapping)
}
sDisableVBOMapping = sEnableVBOs && no_vbo_mapping ;
if(!sPrivatePoolp)
{
sPrivatePoolp = LLPrivateMemoryPoolManager::getInstance()->newPool(LLPrivateMemoryPool::STATIC) ;
}
}
//static
@ -472,7 +478,11 @@ void LLVertexBuffer::cleanupClass()
unbind();
clientCopy(); // deletes GL buffers
//llassert_always(!sCount) ;
if(sPrivatePoolp)
{
LLPrivateMemoryPoolManager::getInstance()->deletePool(sPrivatePoolp) ;
sPrivatePoolp = NULL ;
}
}
void LLVertexBuffer::clientCopy(F64 max_time)
@ -722,7 +732,7 @@ void LLVertexBuffer::createGLBuffer()
{
static int gl_buffer_idx = 0;
mGLBuffer = ++gl_buffer_idx;
mMappedData = (U8*) ll_aligned_malloc_16(size);
mMappedData = (U8*)ALLOCATE_MEM(sPrivatePoolp, size);
}
}
@ -756,7 +766,7 @@ void LLVertexBuffer::createGLIndices()
}
else
{
mMappedIndexData = (U8*) ll_aligned_malloc_16(size);
mMappedIndexData = (U8*)ALLOCATE_MEM(sPrivatePoolp, size);
static int gl_buffer_idx = 0;
mGLIndices = ++gl_buffer_idx;
}
@ -779,7 +789,7 @@ void LLVertexBuffer::destroyGLBuffer()
}
else
{
ll_aligned_free_16(mMappedData);
FREE_MEM(sPrivatePoolp, mMappedData) ;
mMappedData = NULL;
mEmpty = TRUE;
}
@ -808,7 +818,7 @@ void LLVertexBuffer::destroyGLIndices()
}
else
{
ll_aligned_free_16(mMappedIndexData);
FREE_MEM(sPrivatePoolp, mMappedIndexData) ;
mMappedIndexData = NULL;
mEmpty = TRUE;
}
@ -941,8 +951,8 @@ void LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices)
{
if (!useVBOs())
{
ll_aligned_free_16(mMappedData);
mMappedData = (U8*) ll_aligned_malloc_16(newsize);
FREE_MEM(sPrivatePoolp, mMappedData);
mMappedData = (U8*)ALLOCATE_MEM(sPrivatePoolp, newsize);
}
mResized = TRUE;
}
@ -962,8 +972,8 @@ void LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices)
{
if (!useVBOs())
{
ll_aligned_free_16(mMappedIndexData);
mMappedIndexData = (U8*) ll_aligned_malloc_16(new_index_size);
FREE_MEM(sPrivatePoolp, mMappedIndexData) ;
mMappedIndexData = (U8*)ALLOCATE_MEM(sPrivatePoolp, new_index_size);
}
mResized = TRUE;
}
@ -998,8 +1008,8 @@ void LLVertexBuffer::freeClientBuffer()
{
if(useVBOs() && sDisableVBOMapping && (mMappedData || mMappedIndexData))
{
ll_aligned_free_16(mMappedData) ;
ll_aligned_free_16(mMappedIndexData) ;
FREE_MEM(sPrivatePoolp, mMappedData) ;
FREE_MEM(sPrivatePoolp, mMappedIndexData) ;
mMappedData = NULL ;
mMappedIndexData = NULL ;
}
@ -1009,7 +1019,7 @@ void LLVertexBuffer::allocateClientVertexBuffer()
{
if(!mMappedData)
{
mMappedData = (U8*)ll_aligned_malloc_16(getSize());
mMappedData = (U8*)ALLOCATE_MEM(sPrivatePoolp, getSize());
}
}
@ -1017,7 +1027,7 @@ void LLVertexBuffer::allocateClientIndexBuffer()
{
if(!mMappedIndexData)
{
mMappedIndexData = (U8*)ll_aligned_malloc_16(getIndicesSize());
mMappedIndexData = (U8*)ALLOCATE_MEM(sPrivatePoolp, getIndicesSize());
}
}
@ -1159,12 +1169,9 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran
{
log_glerror();
//check the availability of memory
U32 avail_phy_mem, avail_vir_mem;
LLMemoryInfo::getAvailableMemoryKB(avail_phy_mem, avail_vir_mem) ;
llinfos << "Available physical mwmory(KB): " << avail_phy_mem << llendl ;
llinfos << "Available virtual memory(KB): " << avail_vir_mem << llendl;
//check the availability of memory
LLMemory::logMemoryInfo(TRUE) ;
if(!sDisableVBOMapping)
{
//--------------------
@ -1324,6 +1331,7 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range)
if (!mMappedIndexData)
{
log_glerror();
LLMemory::logMemoryInfo(TRUE) ;
if(!sDisableVBOMapping)
{

View File

@ -79,7 +79,7 @@ public:
//============================================================================
// base class
class LLPrivateMemoryPool ;
class LLVertexBuffer : public LLRefCount
{
public:
@ -282,6 +282,9 @@ protected:
void waitFence() const;
private:
static LLPrivateMemoryPool* sPrivatePoolp ;
public:
static S32 sCount;
static S32 sGLCount;

View File

@ -29,7 +29,7 @@ set(llui_SOURCE_FILES
llaccordionctrl.cpp
llaccordionctrltab.cpp
llbadge.cpp
llbadgeholder.cpp
llbadgeholder.cpp
llbadgeowner.cpp
llbutton.cpp
llcheckboxctrl.cpp
@ -113,6 +113,7 @@ set(llui_SOURCE_FILES
llurlmatch.cpp
llurlregistry.cpp
llviewborder.cpp
llviewinject.cpp
llviewmodel.cpp
llview.cpp
llviewquery.cpp
@ -125,7 +126,7 @@ set(llui_HEADER_FILES
llaccordionctrl.h
llaccordionctrltab.h
llbadge.h
llbadgeholder.h
llbadgeholder.h
llbadgeowner.h
llbutton.h
llcallbackmap.h
@ -169,7 +170,7 @@ set(llui_HEADER_FILES
llnotificationslistener.h
llnotificationsutil.h
llnotificationtemplate.h
llnotificationvisibilityrule.h
llnotificationvisibilityrule.h
llpanel.h
llprogressbar.h
llradiogroup.h
@ -219,6 +220,7 @@ set(llui_HEADER_FILES
llurlmatch.h
llurlregistry.h
llviewborder.h
llviewinject.h
llviewmodel.h
llview.h
llviewquery.h

View File

@ -339,7 +339,7 @@ LLAccordionCtrlTab::Params::Params()
,fit_panel("fit_panel",true)
,selection_enabled("selection_enabled", false)
{
mouse_opaque(false);
changeDefault(mouse_opaque, false);
}
LLAccordionCtrlTab::LLAccordionCtrlTab(const LLAccordionCtrlTab::Params&p)

View File

@ -27,11 +27,14 @@
#define LLBADGE_CPP
#include "llbadge.h"
#include "llscrollcontainer.h"
#include "lluictrlfactory.h"
static LLDefaultChildRegistry::Register<LLBadge> r("badge");
static const S32 BADGE_OFFSET_NOT_SPECIFIED = 0x7FFFFFFF;
// Compiler optimization, generate extern template
template class LLBadge* LLView::getChild<class LLBadge>(const std::string& name, BOOL recurse) const;
@ -46,14 +49,13 @@ LLBadge::Params::Params()
, label_offset_horiz("label_offset_horiz")
, label_offset_vert("label_offset_vert")
, location("location", LLRelPos::TOP_LEFT)
, location_offset_hcenter("location_offset_hcenter")
, location_offset_vcenter("location_offset_vcenter")
, location_percent_hcenter("location_percent_hcenter")
, location_percent_vcenter("location_percent_vcenter")
, padding_horiz("padding_horiz")
, padding_vert("padding_vert")
{
// We set a name here so the name isn't necessary in any xml files that use badges
name = "badge";
}
{}
bool LLBadge::Params::equals(const Params& a) const
{
@ -70,6 +72,8 @@ bool LLBadge::Params::equals(const Params& a) const
comp &= (label_offset_horiz() == a.label_offset_horiz());
comp &= (label_offset_vert() == a.label_offset_vert());
comp &= (location() == a.location());
comp &= (location_offset_hcenter() == a.location_offset_hcenter());
comp &= (location_offset_vcenter() == a.location_offset_vcenter());
comp &= (location_percent_hcenter() == a.location_percent_hcenter());
comp &= (location_percent_vcenter() == a.location_percent_vcenter());
comp &= (padding_horiz() == a.padding_horiz());
@ -91,16 +95,29 @@ LLBadge::LLBadge(const LLBadge::Params& p)
, mLabelOffsetHoriz(p.label_offset_horiz)
, mLabelOffsetVert(p.label_offset_vert)
, mLocation(p.location)
, mLocationOffsetHCenter(BADGE_OFFSET_NOT_SPECIFIED)
, mLocationOffsetVCenter(BADGE_OFFSET_NOT_SPECIFIED)
, mLocationPercentHCenter(0.5f)
, mLocationPercentVCenter(0.5f)
, mPaddingHoriz(p.padding_horiz)
, mPaddingVert(p.padding_vert)
, mParentScroller(NULL)
{
if (mImage.isNull())
{
llwarns << "Badge: " << getName() << " with no image!" << llendl;
}
if (p.location_offset_hcenter.isProvided())
{
mLocationOffsetHCenter = p.location_offset_hcenter();
}
if (p.location_offset_vcenter.isProvided())
{
mLocationOffsetVCenter = p.location_offset_vcenter();
}
//
// The following logic is to set the mLocationPercentHCenter and mLocationPercentVCenter
// based on the Location enum and our horizontal and vertical location percentages. The
@ -144,6 +161,15 @@ bool LLBadge::addToView(LLView * view)
if (child_added)
{
setShape(view->getLocalRect());
// Find a parent scroll container, if there is one in case we need it for positioning
LLView * parent = mOwner.get();
while ((parent != NULL) && ((mParentScroller = dynamic_cast<LLScrollContainer *>(parent)) == NULL))
{
parent = parent->getParent();
}
}
return child_added;
@ -200,22 +226,12 @@ void LLBadge::draw()
if (owner_view)
{
//
// Calculate badge position based on owner
//
LLRect owner_rect;
owner_view->localRectToOtherView(owner_view->getLocalRect(), & owner_rect, this);
F32 badge_center_x = owner_rect.mLeft + owner_rect.getWidth() * mLocationPercentHCenter;
F32 badge_center_y = owner_rect.mBottom + owner_rect.getHeight() * mLocationPercentVCenter;
//
// Calculate badge size based on label text
//
LLWString badge_label_wstring = mLabel;
S32 badge_label_begin_offset = 0;
S32 badge_char_length = S32_MAX;
S32 badge_pixel_length = S32_MAX;
@ -227,6 +243,77 @@ void LLBadge::draw()
F32 badge_height = (2.0f * mPaddingVert) + mGLFont->getLineHeight();
//
// Calculate badge position based on owner
//
LLRect owner_rect;
owner_view->localRectToOtherView(owner_view->getLocalRect(), & owner_rect, this);
S32 location_offset_horiz = mLocationOffsetHCenter;
S32 location_offset_vert = mLocationOffsetVCenter;
// If we're in a scroll container, do some math to keep us in the same place on screen if applicable
if (mParentScroller != NULL)
{
LLRect visibleRect = mParentScroller->getVisibleContentRect();
if (mLocationOffsetHCenter != BADGE_OFFSET_NOT_SPECIFIED)
{
if (LLRelPos::IsRight(mLocation))
{
location_offset_horiz += visibleRect.mRight;
}
else if (LLRelPos::IsLeft(mLocation))
{
location_offset_horiz += visibleRect.mLeft;
}
else // center
{
location_offset_horiz += (visibleRect.mLeft + visibleRect.mRight) / 2;
}
}
if (mLocationOffsetVCenter != BADGE_OFFSET_NOT_SPECIFIED)
{
if (LLRelPos::IsTop(mLocation))
{
location_offset_vert += visibleRect.mTop;
}
else if (LLRelPos::IsBottom(mLocation))
{
location_offset_vert += visibleRect.mBottom;
}
else // center
{
location_offset_vert += (visibleRect.mBottom + visibleRect.mTop) / 2;
}
}
}
F32 badge_center_x;
F32 badge_center_y;
// Compute x position
if (mLocationOffsetHCenter == BADGE_OFFSET_NOT_SPECIFIED)
{
badge_center_x = owner_rect.mLeft + owner_rect.getWidth() * mLocationPercentHCenter;
}
else
{
badge_center_x = location_offset_horiz;
}
// Compute y position
if (mLocationOffsetVCenter == BADGE_OFFSET_NOT_SPECIFIED)
{
badge_center_y = owner_rect.mBottom + owner_rect.getHeight() * mLocationPercentVCenter;
}
else
{
badge_center_y = location_offset_vert;
}
//
// Draw button image, if available.
// Otherwise draw basic rectangular button.

View File

@ -39,8 +39,9 @@
// Declarations
//
class LLUICtrlFactory;
class LLFontGL;
class LLScrollContainer;
class LLUICtrlFactory;
//
// Relative Position Alignment
@ -108,6 +109,8 @@ public:
Optional< S32 > label_offset_vert;
Optional< LLRelPos::Location > location;
Optional< S32 > location_offset_hcenter;
Optional< S32 > location_offset_vcenter;
Optional< U32 > location_percent_hcenter;
Optional< U32 > location_percent_vcenter;
@ -150,6 +153,8 @@ private:
S32 mLabelOffsetVert;
LLRelPos::Location mLocation;
S32 mLocationOffsetHCenter;
S32 mLocationOffsetVCenter;
F32 mLocationPercentHCenter;
F32 mLocationPercentVCenter;
@ -157,6 +162,8 @@ private:
F32 mPaddingHoriz;
F32 mPaddingVert;
LLScrollContainer* mParentScroller;
};
// Build time optimization, generate once in .cpp file

View File

@ -104,11 +104,11 @@ LLButton::Params::Params()
commit_on_return("commit_on_return", true),
use_draw_context_alpha("use_draw_context_alpha", true),
badge("badge"),
handle_right_mouse("handle_right_mouse")
handle_right_mouse("handle_right_mouse"),
held_down_delay("held_down_delay")
{
addSynonym(is_toggle, "toggle");
held_down_delay.seconds = 0.5f;
initial_value.set(LLSD(false), false);
changeDefault(initial_value, LLSD(false));
}

View File

@ -525,15 +525,12 @@ void LLComboBox::createLineEditor(const LLComboBox::Params& p)
else
{
mButton->setRect(rect);
mButton->setTabStop(TRUE);
mButton->setHAlign(LLFontGL::LEFT);
mButton->setLabel(mLabel.getString());
if (mTextEntry)
{
mTextEntry->setVisible(FALSE);
}
mButton->setFollowsAll();
}
}

View File

@ -54,7 +54,7 @@ public:
persist_time("persist_time", 0.f), // forever
font_size_index("font_size_index")
{
mouse_opaque(false);
changeDefault(mouse_opaque, false);
}
};
protected:

View File

@ -50,7 +50,7 @@ public:
show_label("show_label", FALSE),
display_children("display_children", TRUE)
{
mouse_opaque(false);
changeDefault(mouse_opaque, false);
}
};

View File

@ -51,8 +51,8 @@ public:
drag_highlight_color("drag_highlight_color", LLUIColorTable::instance().getColor("DefaultHighlightLight")),
drag_shadow_color("drag_shadow_color", LLUIColorTable::instance().getColor("DefaultShadowDark"))
{
mouse_opaque(true);
follows.flags(FOLLOWS_ALL);
changeDefault(mouse_opaque, true);
changeDefault(follows.flags, FOLLOWS_ALL);
}
};
void initFromParams(const Params&);

Some files were not shown because too many files have changed in this diff Show More