Commits

simon_linden committed ee4c26f Merge

Merge latest from lindenlab/viewer-development/

Comments (0)

Files changed (857)

 b723921b5c711bd24dbe77dc76ef488b544dac78 DRTVWR-34_2.5.0-beta3
 b723921b5c711bd24dbe77dc76ef488b544dac78 2.5.0-release
 b723921b5c711bd24dbe77dc76ef488b544dac78 DRTVWR-31_2.5.0-release
-92e58e51776a4f8c29069b1a62ff21454d2085f0 2.6.0-start
 3178e311da3a8739a85363665006ea3c4610cad4 dons-headless-hackathon-work
 63a6aedfce785a6c760377bf685b2dae616797d2 2.5.1-start
 4dede9ae1ec74d41f6887719f6f1de7340d8578d 2.5.1-release
 b53a0576eec80614d7767ed72b40ed67aeff27c9 2.5.2-release
 92e58e51776a4f8c29069b1a62ff21454d2085f0 2.6.0-start
 f1827b441e05bf37c68e2c15ebc6d09e9b03f527 2.6.0-start
-f1827b441e05bf37c68e2c15ebc6d09e9b03f527 2.6.0-start
 4e9eec6a347f89b2b3f295beb72f1cf7837dff66 2.6.0-start
 9283d6d1d7eb71dfe4c330e7c9144857e7356bde 2.6.0-beta1
 9283d6d1d7eb71dfe4c330e7c9144857e7356bde DRTVWR-40_2.6.0-beta1
 bb1075286b3b147b1dae2e3d6b2d56f04ff03f35 DRTVWR-52_2.6.6-beta1
 bb1075286b3b147b1dae2e3d6b2d56f04ff03f35 2.6.6-beta1
 5e349dbe9cc84ea5795af8aeb6d473a0af9d4953 2.6.8-start
-11d5d8080e67c3955914caf98f2eb116af30e55a 2.6.9-start
+beafa8a9bd1d1b670b7523d865204dc4a4b38eef DRTVWR-55_2.6.8-beta1
+beafa8a9bd1d1b670b7523d865204dc4a4b38eef 2.6.8-beta1
 11d5d8080e67c3955914caf98f2eb116af30e55a 2.6.9-start
 e67da2c6e3125966dd49eef98b36317afac1fcfe 2.6.9-start
-beafa8a9bd1d1b670b7523d865204dc4a4b38eef DRTVWR-55_2.6.8-beta1
-beafa8a9bd1d1b670b7523d865204dc4a4b38eef 2.6.8-beta1
 77e5a08344c95738ab879f9671b7758cddd712a3 DRTVWR-57_2.6.9-beta1
 77e5a08344c95738ab879f9671b7758cddd712a3 2.6.9-beta1
+be2000b946f8cb3de5f44b2d419287d4c48ec4eb DRTVWR-54_2.6.8-release
+be2000b946f8cb3de5f44b2d419287d4c48ec4eb 2.6.8-release
+dac76a711da5f1489a01c1fa62ec97d99c25736d DRTVWR-51_2.6.6-release
+dac76a711da5f1489a01c1fa62ec97d99c25736d 2.6.6-release
+8f2da1701c81a62352df2b8d413d27fb2cade9a6 DRTVWR-46_2.6.3-release
+8f2da1701c81a62352df2b8d413d27fb2cade9a6 2.6.3-release
+77e5a08344c95738ab879f9671b7758cddd712a3 DRTVWR-56_2.6.9-release
 8835e0e3c0d3a48244c287bc05811dfc2fba43ec 2.7.0-start
+43c7ee846b7eed80786acbbf35d03bd016a3e85d DRTVWR-59_2.7.0-beta1
+43c7ee846b7eed80786acbbf35d03bd016a3e85d 2.7.0-beta1
+77e5a08344c95738ab879f9671b7758cddd712a3 2.6.9-release
+54fd44ac92e4c61435ea33effe093a3527e18d98 2.7.1-start
+0c4d0c24278074f219e5a32e72b449e78301d11b DRTVWR-61_2.7.1-beta1
+0c4d0c24278074f219e5a32e72b449e78301d11b 2.7.1-beta1
+9f79a6ed8fdcd2f3dac33ea6b3236eeb278dccfe 2.7.2-start
 gooey.build_viewer_update_version_manager = false
 
 # ========================================
-# Display Names project
+# Search Project
 # ========================================
 
-#viewer-identity-evolution.email = leyla@lindenlab.com
-viewer-identity.build_Debug = false
-viewer-identity.build_RelWithDebInfo = false
-viewer-identity.build_viewer = true
-viewer-identity.build_server = false
-viewer-identity.build_server_tests = false
-viewer-identity.build_Linux = true
-viewer-identity.build_hg_bundle = true
-viewer-identity.bulld_docs = true
-viewer-identity.viewer_channel = "Second Life Project Viewer"
-viewer-identity.login_channel = "Second Life Project Viewer"
-viewer-identity.viewer_grid = aditi
-viewer-identity.build_viewer_update_version_manager = false
-
-
+search_project-viewer.build_debug_release_separately = true
+search_project-viewer.viewer_channel = "Second Life Project Viewer - Search"
+search_project-viewer.login_channel = "Second Life Project Viewer - Search"
 
 # ========================================
 # palange
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>7c546f54f6ed654f713c778af3925dd4</string>
+              <string>930bdd987a321eda1838caba8cd6098f</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/226566/arch/Darwin/installer/glod-1.0pre4-darwin-20110413.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/230348/arch/Darwin/installer/glod-1.0pre4-darwin-20110519.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>18c708163d2a669bc3c030b05b4ebe61</string>
+              <string>fb33b6cac2e6b98f93c5efa2af2e5a00</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/226657/arch/Linux/installer/glod-1.0pre4-linux-20110414.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/230348/arch/Linux/installer/glod-1.0pre4-linux-20110519.tar.bz2</string>
             </map>
             <key>name</key>
             <string>linux</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>c4ae6cddc04e0b2908a301726a53922c</string>
+              <string>388cf0e292f756b4bb37696622f0bbc5</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/226194/arch/CYGWIN/installer/glod-1.0pre4-windows-20110408.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/230348/arch/CYGWIN/installer/glod-1.0pre4-windows-20110519.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>76c1015eafcba5ca9932c3009533b51c</string>
+              <string>82798d0da3ac3d97c91517a575d9ea1c</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/225273/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20110329.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/231093/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20110526.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>1b1b8e104e39c542d69eb37b5ee81818</string>
+              <string>f0708d18943a05013493f69ab7dc6429</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/225249/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20110329.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/231093/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20110526.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>

doc/contributions.txt

 	VWR-13996
 	VWR-14426
 	VWR-24247
+	VWR-25654
 	VWR-24251
 	VWR-24252
 	VWR-24254
 	STORM-1182
 	VWR-233
 	VWR-20583
+	VWR-25654
 	VWR-20891
 	VWR-23455
 	VWR-24487

indra/cmake/LLTestCommand.cmake

File contents unchanged.

indra/cmake/Variables.cmake

   # To support a different SDK update these Xcode settings:
   set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
   set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
-  set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "4.2")
+  set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "4.0")
   set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym)
 
   # NOTE: To attempt an i386/PPC Universal build, add this on the configure line:

indra/llcommon/CMakeLists.txt

     indra_constants.h
     linden_common.h
     linked_lists.h
+    llaccountingquota.h
     llallocator.h
     llallocator_heap_profile.h
     llagentconstants.h

indra/llcommon/llaccountingquota.h

+/** 
+ * @file llaccountingquota.h
+ * @
+ *
+ * $LicenseInfo:firstyear=2001&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$
+ */
+
+#ifndef LL_ACCOUNTINGQUOTA_H
+#define LL_ACCOUNTINGQUOTA_H
+
+struct ParcelQuota
+{
+	ParcelQuota( F32 ownerRenderCost, F32 ownerPhysicsCost, F32 ownerNetworkCost, F32 ownerSimulationCost,
+				F32 groupRenderCost, F32 groupPhysicsCost, F32 groupNetworkCost, F32 groupSimulationCost,
+				F32 otherRenderCost, F32 otherPhysicsCost, F32 otherNetworkCost, F32 otherSimulationCost,
+				F32 totalRenderCost, F32 totalPhysicsCost, F32 totalNetworkCost, F32 totalSimulationCost)
+	: mOwnerRenderCost( ownerRenderCost ), mOwnerPhysicsCost( ownerPhysicsCost ) 
+	, mOwnerNetworkCost( ownerNetworkCost ), mOwnerSimulationCost( ownerSimulationCost )
+	, mGroupRenderCost( groupRenderCost ), mGroupPhysicsCost( groupPhysicsCost )
+	, mGroupNetworkCost( groupNetworkCost ), mGroupSimulationCost( groupSimulationCost )
+	, mOtherRenderCost( otherRenderCost ), mOtherPhysicsCost( otherPhysicsCost )
+	, mOtherNetworkCost( otherNetworkCost ), mOtherSimulationCost( otherSimulationCost )
+	, mTotalRenderCost( totalRenderCost ), mTotalPhysicsCost( totalPhysicsCost ) 
+	, mTotalNetworkCost( totalNetworkCost ), mTotalSimulationCost( totalSimulationCost )
+	{
+	}
+	ParcelQuota(){}			
+	F32 mOwnerRenderCost, mOwnerPhysicsCost, mOwnerNetworkCost, mOwnerSimulationCost;
+	F32 mGroupRenderCost, mGroupPhysicsCost, mGroupNetworkCost, mGroupSimulationCost;
+	F32 mOtherRenderCost, mOtherPhysicsCost, mOtherNetworkCost, mOtherSimulationCost;
+	F32 mTotalRenderCost, mTotalPhysicsCost, mTotalNetworkCost, mTotalSimulationCost;
+};
+
+struct SelectionQuota
+{
+	SelectionQuota( S32 localId, F32 renderCost, F32 physicsCost, F32 networkCost, F32 simulationCost )
+	: mLocalId( localId)
+	, mRenderCost( renderCost )
+	, mPhysicsCost( physicsCost )
+	, mNetworkCost( networkCost )
+	, mSimulationCost( simulationCost )
+	{
+	}
+	SelectionQuota() {}
+	
+	F32 mRenderCost, mPhysicsCost, mNetworkCost, mSimulationCost;	
+	S32 mLocalId;
+};
+
+#endif
+
+
+

indra/llcommon/llchat.h

 	CHAT_TYPE_STOP = 5,
 	CHAT_TYPE_DEBUG_MSG = 6,
 	CHAT_TYPE_REGION = 7,
-	CHAT_TYPE_OWNER = 8
+	CHAT_TYPE_OWNER = 8,
+	CHAT_TYPE_DIRECT = 9		// From llRegionSayTo()
 } EChatType;
 
 typedef enum e_chat_audible_level

indra/llcommon/llsys.cpp

 				 if(osvi.wProductType == VER_NT_WORKSTATION)
 					mOSStringSimple = "Microsoft Windows XP x64 Edition ";
 				 else
-					 mOSStringSimple = "Microsoft Windows Server 2003 ";
+					mOSStringSimple = "Microsoft Windows Server 2003 ";
 			}
-			else if(osvi.dwMajorVersion == 6 && osvi.dwMinorVersion <= 1)
+			else if(osvi.dwMajorVersion == 6 && osvi.dwMinorVersion <= 2)
 			{
 				if(osvi.dwMinorVersion == 0)
 				{
-					mOSStringSimple = "Microsoft Windows Vista ";
+					if(osvi.wProductType == VER_NT_WORKSTATION)
+						mOSStringSimple = "Microsoft Windows Vista ";
+					else
+						mOSStringSimple = "Windows Server 2008 ";
 				}
 				else if(osvi.dwMinorVersion == 1)
 				{
-					mOSStringSimple = "Microsoft Windows 7 ";
+					if(osvi.wProductType == VER_NT_WORKSTATION)
+						mOSStringSimple = "Microsoft Windows 7 ";
+					else
+						mOSStringSimple = "Windows Server 2008 R2 ";
 				}
-
-				if(osvi.wProductType != VER_NT_WORKSTATION)
+				else if(osvi.dwMinorVersion == 2)
 				{
-					mOSStringSimple += "Server ";
+					if(osvi.wProductType == VER_NT_WORKSTATION)
+						mOSStringSimple = "Microsoft Windows 8 ";
+					else
+						mOSStringSimple = "Windows Server 2012 ";
 				}
 
 				///get native system info if available..
 	std::string compatibility_mode;
 	if(got_shell32_version)
 	{
-		if(osvi.dwMajorVersion != shell32_major 
-			|| osvi.dwMinorVersion != shell32_minor)
+		if(osvi.dwMajorVersion != shell32_major || osvi.dwMinorVersion != shell32_minor)
 		{
 			compatibility_mode = llformat(" compatibility mode. real ver: %d.%d (Build %d)", 
 											shell32_major,

indra/llcommon/llversionviewer.h

 
 const S32 LL_VERSION_MAJOR = 2;
 const S32 LL_VERSION_MINOR = 7;
-const S32 LL_VERSION_PATCH = 1;
+const S32 LL_VERSION_PATCH = 3;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";

indra/llinventory/llparcel.cpp

     // 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;
+	}
+}
+

indra/llinventory/llparcel.h

 #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;
 	LLUUID	getPreviousOwnerID() const		{ return mPreviousOwnerID; }
 	BOOL	getPreviouslyGroupOwned() const	{ return mPreviouslyGroupOwned; }
 	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;
 	BOOL				mRegionPushOverride;
 	BOOL				mRegionDenyAnonymousOverride;
 	BOOL				mRegionDenyAgeUnverifiedOverride;
-
-
+	
+	ParcelQuota			mQuota;
+	
 public:
 	// HACK, make private
 	S32					mLocalID;

indra/llkdu/llimagej2ckdu.cpp

 
 const char* engineInfoLLImageJ2CKDU()
 {
-	std::string version = llformat("KDU %s", KDU_CORE_VERSION);
+	static std::string version = llformat("KDU %s", KDU_CORE_VERSION);
 	return version.c_str();
 }
 

indra/llplugin/llpluginclassmedia.cpp

 	return result;
 }
 
+void LLPluginClassMedia::jsExposeObjectEvent( bool expose )
+{
+	if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
+	{
+		return;
+	}
+
+	LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_expose_object");
+	message.setValueBoolean( "expose", expose );
+	sendMessage( message );
+}
+
+void LLPluginClassMedia::jsValuesValidEvent( bool valid )
+{
+	if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
+	{
+		return;
+	}
+
+	LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_values_valid");
+	message.setValueBoolean( "valid", valid );
+	sendMessage( message );
+}
+
+void LLPluginClassMedia::jsAgentLocationEvent( double x, double y, double z )
+{
+	if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
+	{
+		return;
+	}
+
+	LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_location");
+	message.setValueReal( "x", x );
+	message.setValueReal( "y", y );
+	message.setValueReal( "z", z );
+	sendMessage( message );
+}
+
+void LLPluginClassMedia::jsAgentGlobalLocationEvent( double x, double y, double z )
+{
+	if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
+	{
+		return;
+	}
+
+	LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_global_location");
+	message.setValueReal( "x", x );
+	message.setValueReal( "y", y );
+	message.setValueReal( "z", z );
+	sendMessage( message );
+}
+
+void LLPluginClassMedia::jsAgentOrientationEvent( double angle )
+{
+	if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
+	{
+		return;
+	}
+
+	LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_orientation");
+	message.setValueReal( "angle", angle );
+
+	sendMessage( message );
+}
+
+void LLPluginClassMedia::jsAgentLanguageEvent( const std::string& language )
+{
+	if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
+	{
+		return;
+	}
+
+	LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_language");
+	message.setValue( "language", language );
+	sendMessage( message );
+}
+
+void LLPluginClassMedia::jsAgentRegionEvent( const std::string& region )
+{
+	if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
+	{
+		return;
+	}
+
+	LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_region");
+	message.setValue( "region", region );
+	sendMessage( message );
+}
+
+void LLPluginClassMedia::jsAgentMaturityEvent( const std::string& maturity )
+{
+	if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
+	{
+		return;
+	}
+
+	LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_maturity");
+	message.setValue( "maturity", maturity );
+	sendMessage( message );
+}
+
 void LLPluginClassMedia::mouseEvent(EMouseEventType type, int button, int x, int y, MASK modifiers)
 {
 	if(type == MOUSE_EVENT_MOVE)

indra/llplugin/llpluginclassmedia.h

 	bool keyEvent(EKeyEventType type, int key_code, MASK modifiers, LLSD native_key_data);
 
 	void scrollEvent(int x, int y, MASK modifiers);
-	
+
+	// Javascript <-> viewer events
+	void jsExposeObjectEvent( bool expose );
+	void jsValuesValidEvent( bool valid );
+	void jsAgentLocationEvent( double x, double y, double z );
+	void jsAgentGlobalLocationEvent( double x, double y, double z );
+	void jsAgentOrientationEvent( double angle );
+	void jsAgentLanguageEvent( const std::string& language );
+	void jsAgentRegionEvent( const std::string& region_name );
+	void jsAgentMaturityEvent( const std::string& maturity );
+		
 	// Text may be unicode (utf8 encoded)
 	bool textInput(const std::string &text, MASK modifiers, LLSD native_key_data);
 	

indra/llprimitive/llmodel.cpp

 		scale.splat(1.f);
 		scale.div(size);
 
+		LLVector4a inv_scale(1.f);
+		inv_scale.div(scale);
+
 		for (U32 i = 0; i < mVolumeFaces.size(); ++i)
 		{
 			LLVolumeFace& face = mVolumeFaces[i];
 			// For all the positions, we scale
 			// the positions to fit within the unit cube.
 			LLVector4a* pos = (LLVector4a*) face.mPositions;
+			LLVector4a* norm = (LLVector4a*) face.mNormals;
+
 			for (U32 j = 0; j < face.mNumVertices; ++j)
 			{
 			 	pos[j].add(trans);
 				pos[j].mul(scale);
+				norm[j].mul(inv_scale);
+				norm[j].normalize3();
 			}
 		}
 

indra/llrender/llfontgl.cpp

 	BOOL in_word = FALSE;
 
 	// avoid S32 overflow when max_pixels == S32_MAX by staying in floating point
-	F32 scaled_max_pixels =	ceil(max_pixels * sScaleX);
+	F32 scaled_max_pixels =	max_pixels * sScaleX;
 	F32 width_padding = 0.f;
 	
 	LLFontGlyphInfo* next_glyph = NULL;

indra/llrender/llgl.cpp

 	mHasShaderObjects(FALSE),
 	mHasVertexShader(FALSE),
 	mHasFragmentShader(FALSE),
+	mNumTextureImageUnits(0),
 	mHasOcclusionQuery(FALSE),
 	mHasOcclusionQuery2(FALSE),
 	mHasPointParameters(FALSE),
 		return false;
 	}
 	
+	if (mHasFragmentShader)
+	{
+		GLint num_tex_image_units;
+		glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &num_tex_image_units);
+		mNumTextureImageUnits = num_tex_image_units;
+	}
+	
 	setToDebugGPU();
 
 	initGLStates();
 		LL_INFOS("RenderInit") << "Disabling mip-map generation for Intel GPUs" << LL_ENDL;
 		mHasMipMapGeneration = FALSE;
 	}
+#if !LL_DARWIN
 	if (mIsATI && mHasMipMapGeneration)
 	{
 		LL_INFOS("RenderInit") << "Disabling mip-map generation for ATI GPUs (performance opt)" << LL_ENDL;
 		mHasMipMapGeneration = FALSE;
 	}
+#endif
 	
 	// Misc
 	glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, (GLint*) &mGLMaxVertexRange);

indra/llrender/llgl.h

 	BOOL mHasShaderObjects;
 	BOOL mHasVertexShader;
 	BOOL mHasFragmentShader;
+	S32  mNumTextureImageUnits;
 	BOOL mHasOcclusionQuery;
 	BOOL mHasOcclusionQuery2;
 	BOOL mHasPointParameters;

indra/llrender/llrender.cpp

 	gGL.flush();
 	
 	glActiveTextureARB(GL_TEXTURE0_ARB + mIndex);
+
+	//
+	// Per apple spec, don't call glEnable/glDisable when index exceeds max texture units
+	// http://www.mailinglistarchive.com/html/mac-opengl@lists.apple.com/2008-07/msg00653.html
+	//
+	bool enableDisable = (mIndex < gGLManager.mNumTextureUnits);
+		
 	if (mCurrTexType != TT_NONE)
 	{
-		glEnable(sGLTextureType[mCurrTexType]);
+		if (enableDisable)
+		{
+			glEnable(sGLTextureType[mCurrTexType]);
+		}
+		
 		glBindTexture(sGLTextureType[mCurrTexType], mCurrTexture);
 	}
 	else
 	{
-		glDisable(GL_TEXTURE_2D);
+		if (enableDisable)
+		{
+			glDisable(GL_TEXTURE_2D);
+		}
+		
 		glBindTexture(GL_TEXTURE_2D, 0);	
 	}
 
 		mCurrTexType = type;
 
 		gGL.flush();
-		glEnable(sGLTextureType[type]);
+		
+		if (mIndex < gGLManager.mNumTextureUnits)
+		{
+			glEnable(sGLTextureType[type]);
+		}
 	}
 }
 
 		activate();
 		unbind(mCurrTexType);
 		gGL.flush();
-		glDisable(sGLTextureType[mCurrTexType]);
+		
+		if (mIndex < gGLManager.mNumTextureUnits)
+		{
+			glDisable(sGLTextureType[mCurrTexType]);
+		}
+		
 		mCurrTexType = TT_NONE;
 	}
 }

indra/llrender/llrendertarget.cpp

 		case GL_FRAMEBUFFER_COMPLETE:
 			break;
 		default:
+			llwarns << "check_framebuffer_status failed -- " << std::hex << status << llendl;
 			ll_fail("check_framebuffer_status failed");	
 			break;
 		}

indra/llui/lltextbase.cpp

 	if (getLength() >= S32(mMaxTextByteLength / 4))
 	{	
 		// Have to check actual byte size
-        LLWString text(getWText());
+		LLWString text(getWText());
 		S32 utf8_byte_size = wstring_utf8_length(text);
 		if ( utf8_byte_size > mMaxTextByteLength )
 		{
 		}
 
 		LLRect text_rect(line.mRect);
-		text_rect.mRight = llmin(mDocumentView->getRect().getWidth(), text_rect.mRight); // clamp right edge to document extents
-		text_rect.translate(mVisibleTextRect.mLeft, mVisibleTextRect.mBottom); // translate into display region of text widget
+		text_rect.mRight = mDocumentView->getRect().getWidth(); // clamp right edge to document extents
 		text_rect.translate(mDocumentView->getRect().mLeft, mDocumentView->getRect().mBottom); // adjust by scroll position
 
 		// draw a single line of text
 	}
 
 	text.insert(pos, wstr);
-    getViewModel()->setDisplay(text);
+	getViewModel()->setDisplay(text);
 
 	if ( truncate() )
 	{
 
 S32 LLTextBase::removeStringNoUndo(S32 pos, S32 length)
 {
-    LLWString text(getWText());
+	LLWString text(getWText());
 	segment_set_t::iterator seg_iter = getSegIterContaining(pos);
 	while(seg_iter != mSegments.end())
 	{
 	}
 
 	text.erase(pos, length);
-    getViewModel()->setDisplay(text);
+	getViewModel()->setDisplay(text);
 
 	// recreate default segment in case we erased everything
 	createDefaultSegment();
 	{
 		return 0;
 	}
-    LLWString text(getWText());
+	LLWString text(getWText());
 	text[pos] = wc;
-    getViewModel()->setDisplay(text);
+	getViewModel()->setDisplay(text);
 
 	onValueChange(pos, pos + 1);
 	needsReflow(pos);
 		// Did we just click on a link?
 		if (mURLClickSignal
 			&& cur_segment->getStyle()
-		    && cur_segment->getStyle()->isLink())
+			&& cur_segment->getStyle()->isLink())
 		{
 			// *TODO: send URL here?
 			(*mURLClickSignal)(this, LLSD() );
 		gl_rect_2d(text_rect, bg_color % alpha, TRUE);
 	}
 
- 	bool should_clip = mClip || mScroller != NULL;
- 	{ LLLocalClipRect clip(text_rect, should_clip);
+	bool should_clip = mClip || mScroller != NULL;
+	{ LLLocalClipRect clip(text_rect, should_clip);
  
- 		// draw document view
- 		if (mScroller)
+		// draw document view
+		if (mScroller)
 		{
- 			drawChild(mScroller);
- 		}
- 		else
- 		{
- 			drawChild(mDocumentView);
- 		}
+			drawChild(mScroller);
+		}
+		else
+		{
+			drawChild(mDocumentView);
+		}
  
 		drawSelectionBackground();
 		drawText();
 		drawCursor();
 	}
  
- 	mDocumentView->setVisible(FALSE);
- 	LLUICtrl::draw();
- 	mDocumentView->setVisible(TRUE);
+	mDocumentView->setVisible(FALSE);
+	LLUICtrl::draw();
+	mDocumentView->setVisible(TRUE);
 }
 
 
 
 	// scroll so that the cursor is at the top of the page
 	LLRect scroller_doc_window = getVisibleDocumentRect();
-	LLRect cursor_rect_doc = getLocalRectFromDocIndex(mCursorPos);
-	cursor_rect_doc.translate(scroller_doc_window.mLeft, scroller_doc_window.mBottom);
+	LLRect cursor_rect_doc = getDocRectFromDocIndex(mCursorPos);
 	mScroller->scrollToShowRect(cursor_rect_doc, LLRect(0, scroller_doc_window.getHeight() - 5, scroller_doc_window.getWidth(), 5));
 }
 
 {
 	S32 num_lines = getLineCount();
 	if (num_lines == 0)
-    {
+	{
 		return 0;
-    }
+	}
 
 	line = llclamp(line, 0, num_lines-1);
 	return mLineInfoList[line].mDocIndexStart;
 {
 	S32 num_lines = getLineCount();
 	if (num_lines == 0)
-    {
+	{
 		return 0;
-    }
+	}
 
 	line = llclamp(line, 0, num_lines-1);
 	return mLineInfoList[line].mDocIndexEnd;
 		LLUrlMatch match;
 		std::string text = new_text;
 		while ( LLUrlRegistry::instance().findUrl(text, match,
-		        boost::bind(&LLTextBase::replaceUrl, this, _1, _2, _3)) )
+				boost::bind(&LLTextBase::replaceUrl, this, _1, _2, _3)) )
 		{
 			
 			LLTextUtil::processUrlMatch(&match,this);
 
 const LLWString& LLTextBase::getWText() const
 {
-    return getViewModel()->getDisplay();
+	return getViewModel()->getDisplay();
 }
 
 // If round is true, if the position is on the right half of a character, the cursor
 {
 	// Figure out which line we're nearest to.
 	LLRect visible_region = getVisibleDocumentRect();
+	LLRect doc_rect = mDocumentView->getRect();
+
+	S32 doc_y = local_y - doc_rect.mBottom;
 	
 	// binary search for line that starts before local_y
-	line_list_t::const_iterator line_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), local_y - mVisibleTextRect.mBottom + visible_region.mBottom, compare_bottom());
+	line_list_t::const_iterator line_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), doc_y, compare_bottom());
 
 	if (line_iter == mLineInfoList.end())
 	{
 	}
 	
 	S32 pos = getLength();
-	S32 start_x = mVisibleTextRect.mLeft + line_iter->mRect.mLeft - visible_region.mLeft;
+	S32 start_x = line_iter->mRect.mLeft + doc_rect.mLeft;
 
 	segment_set_t::iterator line_seg_iter;
 	S32 line_seg_offset;
 		}
 
 		// if we've reached a line of text *below* the mouse cursor, doc index is first character on that line
-		if (hit_past_end_of_line && local_y - mVisibleTextRect.mBottom + visible_region.mBottom > line_iter->mRect.mTop)
+		if (hit_past_end_of_line && doc_y > line_iter->mRect.mTop)
 		{
 			pos = segment_line_start;
 			break;
 		LLRect doc_rect = mDocumentView->getLocalRect();
 		doc_rect.mLeft -= mDocumentView->getRect().mLeft;
 		// adjust for height of text above widget baseline
-		doc_rect.mBottom = llmin(0, doc_rect.getHeight() - mVisibleTextRect.getHeight());
+		doc_rect.mBottom = doc_rect.getHeight() - mVisibleTextRect.getHeight();
 		return doc_rect;
 	}
 }
 
 	LLColor4 color = (mEditor.getReadOnly() ? mStyle->getReadOnlyColor() : mStyle->getColor())  % alpha;
 
-  	if( selection_start > seg_start )
+	if( selection_start > seg_start )
 	{
 		// Draw normally
 		S32 start = seg_start;
 		S32 end = llmin( selection_start, seg_end );
 		S32 length =  end - start;