Commits

dessie linden committed 1778f26 Merge

merged .hgtags

  • Participants
  • Parent commits ae6a39e, b276676
  • Tags 3.0.0-release, DRTVWR-77_3.0.0-release

Comments (0)

Files changed (214)

 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/server-linux-*
 4780e3bd2b3042f91be3426151f28c30d199bb3b DRTVWR-76_2.8.1-hotfix
 4780e3bd2b3042f91be3426151f28c30d199bb3b 2.8.1-hotfix
 54bc7823ad4e3a436fef79710f685a7372bbf795 2.8.2-start
+29e93d7e19991011bd12b5748142b11a5dcb4370 DRTVWR-72_2.8.1-release
+29e93d7e19991011bd12b5748142b11a5dcb4370 2.8.1-release
 ac0f1a132d35c02a58861d37cca75b0429ac9137 2.8.3-start
 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
 mesh-development.build_viewer_update_version_manager = false
 
 # ========================================
+# mesh-development-release-1-candidate
+# ========================================
+mesh-development-release-1-candidate.viewer_channel = "Project Viewer - Mesh"
+mesh-development-release-1-candidate.login_channel = "Project Viewer - Mesh"
+mesh-development-release-1-candidate.viewer_grid = agni
+mesh-development-release-1-candidate.build_debug_release_separately = true
+mesh-development-release-1-candidate.build_CYGWIN_Debug = false
+mesh-development-release-1-candidate.build_viewer_update_version_manager = false
+
+# ========================================
+# mesh-development-rc
+# ========================================
+mesh-development-rc.viewer_channel = "Project Viewer - Mesh"
+mesh-development-rc.login_channel = "Project Viewer - Mesh"
+mesh-development-rc.viewer_grid = agni
+mesh-development-rc.build_debug_release_separately = true
+mesh-development-rc.build_CYGWIN_Debug = false
+mesh-development-rc.build_viewer_update_version_manager = false
+
+# ========================================
 # mesh-asset-deprecation
 # ========================================
 mesh-asset-deprecation.viewer_channel = "Project Viewer - Mesh Asset Deprecation"
 # 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-beta-review.build_debug_release_separately = true
 oz_viewer-beta-review.codeticket_add_context = false
+oz_viewer-beta-review.viewer_channel = "Second Life Beta Viewer"
+oz_viewer-beta-review.login_channel = "Second Life Beta Viewer"
 
 oz_viewer-poreview.build_debug_release_separately = true
 oz_viewer-poreview.codeticket_add_context = false
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>d05be8fc196e9ce7b6636b931cf13dff</string>
+              <string>be7321370b69b6d66938b82a9230a067</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-colladadom/rev/226716/arch/Linux/installer/colladadom-2.2-linux-20110415.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-colladadom/rev/233450/arch/Linux/installer/colladadom-2.2-linux-20110621.tar.bz2</string>
             </map>
             <key>name</key>
             <string>linux</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>6e45ad68506cd1ba49fd35a3201f0478</string>
+              <string>0db10480362168f075c2af0ae302cb74</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/228821/arch/Darwin/installer/llconvexdecomposition-0.1-darwin-20110504.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/234943/arch/Darwin/installer/llconvexdecomposition-0.1-darwin-20110707.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>00ff5144612c2e261a0811a4503ce3ba</string>
+              <string>f3c667dc159c0537a9122ce6e72e16db</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/228821/arch/Linux/installer/llconvexdecomposition-0.1-linux-20110504.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/234943/arch/Linux/installer/llconvexdecomposition-0.1-linux-20110707.tar.bz2</string>
             </map>
             <key>name</key>
             <string>linux</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>a4635dcbbe0915ce023dd41d3b848d4c</string>
+              <string>46cac4d667446bbbc9b5023f2848a5ac</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/228821/arch/CYGWIN/installer/llconvexdecomposition-0.1-windows-20110504.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/234943/arch/CYGWIN/installer/llconvexdecomposition-0.1-windows-20110707.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
         <key>license</key>
         <string>lgpl</string>
         <key>license_file</key>
-        <string>LICENSES/lgpl.txt</string>
+        <string>LICENSES/LLConvexDecompositionStubLicense.txt</string>
         <key>name</key>
         <string>llconvexdecompositionstub</string>
         <key>platforms</key>

doc/contributions.txt

 	STORM-1273
 	STORM-1462
 	STORM-1459
+Kadah Coba
+    STORM-1060
 Kage Pixel
 	VWR-11
 Ken March
 	VWR-8889
 	VWR-8310
 	VWR-9499
+    STORM-1060
 Mm Alder
 	SNOW-376
 	VWR-197

indra/cmake/OpenSSL.cmake

File contents unchanged.

indra/integration_tests/llimage_libtest/llimage_libtest.cpp

 #include "llimagetga.h"
 #include "llimagej2c.h"
 #include "lldir.h"
+#include "lldiriterator.h"
 
 // system libraries
 #include <iostream>
 	{
 		// If file name is a pattern, iterate to get each file name and store
 		std::string next_name;
-		while (gDirUtilp->getNextFileInDir(dir,name,next_name))
+		LLDirIterator iter(dir, name);
+		while (iter.next(next_name))
 		{
 			std::string file_name = dir + gDirUtilp->getDirDelimiter() + next_name;
 			input_filenames.push_back(file_name);

indra/llcommon/lleventtimer.cpp

 void LLEventTimer::updateClass() 
 {
 	std::list<LLEventTimer*> completed_timers;
-
+	for (instance_iter iter = beginInstances(); iter != endInstances(); ) 
 	{
-		LLInstanceTrackerScopedGuard guard;
-		for (instance_iter iter = guard.beginInstances(); iter != guard.endInstances(); ) 
-		{
-			LLEventTimer& timer = *iter++;
-			F32 et = timer.mEventTimer.getElapsedTimeF32();
-			if (timer.mEventTimer.getStarted() && et > timer.mPeriod) {
-				timer.mEventTimer.reset();
-				if ( timer.tick() )
-				{
-					completed_timers.push_back( &timer );
-				}
+		LLEventTimer& timer = *iter++;
+		F32 et = timer.mEventTimer.getElapsedTimeF32();
+		if (timer.mEventTimer.getStarted() && et > timer.mPeriod) {
+			timer.mEventTimer.reset();
+			if ( timer.tick() )
+			{
+				completed_timers.push_back( &timer );
 			}
 		}
 	}

indra/llcommon/llfasttimer_class.cpp

 // static
 void LLFastTimer::DeclareTimer::updateCachedPointers()
 {
-	DeclareTimer::LLInstanceTrackerScopedGuard guard;
 	// propagate frame state pointers to timer declarations
-	for (DeclareTimer::instance_iter it = guard.beginInstances();
-		it != guard.endInstances();
-		++it)
+	for (instance_iter it = beginInstances(); it != endInstances(); ++it)
 	{
 		// update cached pointer
 		it->mFrameState = &it->mTimer.getFrameState();
 	}
 
-	// also update frame states of timers on stack
-	LLFastTimer* cur_timerp = LLFastTimer::sCurTimerData.mCurTimer;
-	while(cur_timerp->mLastTimerData.mCurTimer != cur_timerp)	
-	{
-		cur_timerp->mFrameState = &cur_timerp->mFrameState->mTimer->getFrameState();
-		cur_timerp = cur_timerp->mLastTimerData.mCurTimer;
+	// also update frame states of timers on stack
+	LLFastTimer* cur_timerp = LLFastTimer::sCurTimerData.mCurTimer;
+	while(cur_timerp->mLastTimerData.mCurTimer != cur_timerp)	
+	{
+		cur_timerp->mFrameState = &cur_timerp->mFrameState->mTimer->getFrameState();
+		cur_timerp = cur_timerp->mLastTimerData.mCurTimer;
 	}
 }
 
 
 	// set up initial tree
 	{
-		NamedTimer::LLInstanceTrackerScopedGuard guard;
-		for (instance_iter it = guard.beginInstances();
-		     it != guard.endInstances();
-		     ++it)
+		for (instance_iter it = beginInstances(); it != endInstances(); ++it)
 		{
 			NamedTimer& timer = *it;
 			if (&timer == NamedTimerFactory::instance().getRootTimer()) continue;
 		LLSD sd;
 
 		{
-			NamedTimer::LLInstanceTrackerScopedGuard guard;
-			for (NamedTimer::instance_iter it = guard.beginInstances();
-			     it != guard.endInstances();
-			     ++it)
+			for (instance_iter it = beginInstances(); it != endInstances(); ++it)
 			{
 				NamedTimer& timer = *it;
 				FrameState& info = timer.getFrameState();
 		llassert_always(timerp->mFrameStateIndex < (S32)getFrameStateList().size());
 	}
 
-	// sort timers by dfs traversal order to improve cache coherency
+	// sort timers by DFS traversal order to improve cache coherency
 	std::sort(getFrameStateList().begin(), getFrameStateList().end(), SortTimersDFS());
 
 	// update pointers into framestatelist now that we've sorted it
 
 	// reset for next frame
 	{
-		NamedTimer::LLInstanceTrackerScopedGuard guard;
-		for (NamedTimer::instance_iter it = guard.beginInstances();
-		     it != guard.endInstances();
-		     ++it)
+		for (instance_iter it = beginInstances(); it != endInstances(); ++it)
 		{
 			NamedTimer& timer = *it;
 			
 
 	// reset all history
 	{
-		NamedTimer::LLInstanceTrackerScopedGuard guard;
-		for (NamedTimer::instance_iter it = guard.beginInstances();
-		     it != guard.endInstances();
-		     ++it)
+		for (instance_iter it = beginInstances(); it != endInstances(); ++it)
 		{
 			NamedTimer& timer = *it;
 			if (&timer != NamedTimerFactory::instance().getRootTimer()) 
 
 #else
 //LL_COMMON_API U64 get_clock_count(); // in lltimer.cpp
-// These use QueryPerformanceCounter, which is arguably fine and also works on amd architectures.
+// These use QueryPerformanceCounter, which is arguably fine and also works on AMD architectures.
 U32 LLFastTimer::getCPUClockCount32()
 {
 	return (U32)(get_clock_count()>>8);

indra/llcommon/llinstancetracker.h

 {
 	typedef typename std::map<KEY, T*> InstanceMap;
 	typedef LLInstanceTracker<T, KEY> MyT;
-	typedef boost::function<const KEY&(typename InstanceMap::value_type&)> KeyGetter;
-	typedef boost::function<T*(typename InstanceMap::value_type&)> InstancePtrGetter;
 public:
-	/// Dereferencing key_iter gives you a const KEY&
-	typedef boost::transform_iterator<KeyGetter, typename InstanceMap::iterator> key_iter;
-	/// Dereferencing instance_iter gives you a T&
-	typedef boost::indirect_iterator< boost::transform_iterator<InstancePtrGetter, typename InstanceMap::iterator> > instance_iter;
+	class instance_iter : public boost::iterator_facade<instance_iter, T, boost::forward_traversal_tag>
+	{
+	public:
+		typedef boost::iterator_facade<instance_iter, T, boost::forward_traversal_tag> super_t;
+		
+		instance_iter(const typename InstanceMap::iterator& it)
+		:	mIterator(it)
+		{
+			++sIterationNestDepth;
+		}
+
+		~instance_iter()
+		{
+			--sIterationNestDepth;
+		}
+
+
+	private:
+		friend class boost::iterator_core_access;
+
+		void increment() { mIterator++; }
+		bool equal(instance_iter const& other) const
+		{
+			return mIterator == other.mIterator;
+		}
+
+		T& dereference() const
+		{
+			return *(mIterator->second);
+		}
+
+		typename InstanceMap::iterator mIterator;
+	};
+
+	class key_iter : public boost::iterator_facade<key_iter, KEY, boost::forward_traversal_tag>
+	{
+	public:
+		typedef boost::iterator_facade<key_iter, KEY, boost::forward_traversal_tag> super_t;
+
+		key_iter(typename InstanceMap::iterator& it)
+			:	mIterator(it)
+		{
+			++sIterationNestDepth;
+		}
+
+		key_iter(const key_iter& other)
+			:	mIterator(other.mIterator)
+		{
+			++sIterationNestDepth;
+		}
+
+		~key_iter()
+		{
+			--sIterationNestDepth;
+		}
+
+
+	private:
+		friend class boost::iterator_core_access;
+
+		void increment() { mIterator++; }
+		bool equal(key_iter const& other) const
+		{
+			return mIterator == other.mIterator;
+		}
+
+		KEY& dereference() const
+		{
+			return const_cast<KEY&>(mIterator->first);
+		}
+
+		typename InstanceMap::iterator mIterator;
+	};
 
 	static T* getInstance(const KEY& k)
 	{
 		return (found == getMap_().end()) ? NULL : found->second;
 	}
 
+	static instance_iter beginInstances() 
+	{	
+		return instance_iter(getMap_().begin()); 
+	}
+
+	static instance_iter endInstances() 
+	{
+		return instance_iter(getMap_().end());
+	}
+
+	static S32 instanceCount() { return getMap_().size(); }
+
 	static key_iter beginKeys()
 	{
-		return boost::make_transform_iterator(getMap_().begin(),
-											  boost::bind(&InstanceMap::value_type::first, _1));
+		return key_iter(getMap_().begin());
 	}
 	static key_iter endKeys()
 	{
-		return boost::make_transform_iterator(getMap_().end(),
-											  boost::bind(&InstanceMap::value_type::first, _1));
+		return key_iter(getMap_().end());
 	}
-	static instance_iter beginInstances()
-	{
-		return instance_iter(boost::make_transform_iterator(getMap_().begin(),
-															boost::bind(&InstanceMap::value_type::second, _1)));
-	}
-	static instance_iter endInstances()
-	{
-		return instance_iter(boost::make_transform_iterator(getMap_().end(),
-															boost::bind(&InstanceMap::value_type::second, _1)));
-	}
-	static S32 instanceCount() { return getMap_().size(); }
+
 protected:
 	LLInstanceTracker(KEY key) { add_(key); }
-	virtual ~LLInstanceTracker() { remove_(); }
+	virtual ~LLInstanceTracker() 
+	{ 
+		// it's unsafe to delete instances of this type while all instances are being iterated over.
+		llassert(sIterationNestDepth == 0);
+		remove_(); 		
+	}
 	virtual void setKey(KEY key) { remove_(); add_(key); }
-	virtual const KEY& getKey() const { return mKey; }
+	virtual const KEY& getKey() const { return mInstanceKey; }
 
 private:
 	void add_(KEY key) 
 	{ 
-		mKey = key; 
+		mInstanceKey = key; 
 		getMap_()[key] = static_cast<T*>(this); 
 	}
 	void remove_()
 	{
-		getMap_().erase(mKey);
+		getMap_().erase(mInstanceKey);
 	}
 
     static InstanceMap& getMap_()
 
 private:
 
-	KEY mKey;
+	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>
 	typedef typename std::set<T*> InstanceSet;
 	typedef LLInstanceTracker<T, T*> MyT;
 public:
-	/// Dereferencing key_iter gives you a T* (since T* is the key)
-	typedef typename InstanceSet::iterator key_iter;
-	/// Dereferencing instance_iter gives you a T&
-	typedef boost::indirect_iterator<key_iter> instance_iter;
 
 	/// for completeness of analogy with the generic implementation
 	static T* getInstance(T* k) { return k; }
 	static S32 instanceCount() { return getSet_().size(); }
 
-	// Instantiate this to get access to iterators for this type.  It's a 'guard' in the sense
-	// that it treats deletes of this type as errors as long as there is an instance of
-	// this class alive in scope somewhere (i.e. deleting while iterating is bad).
-	class LLInstanceTrackerScopedGuard
+	class instance_iter : public boost::iterator_facade<instance_iter, T, boost::forward_traversal_tag>
 	{
 	public:
-		LLInstanceTrackerScopedGuard()
+		instance_iter(const typename InstanceSet::iterator& it)
+		:	mIterator(it)
 		{
 			++sIterationNestDepth;
 		}
 
-		~LLInstanceTrackerScopedGuard()
+		instance_iter(const instance_iter& other)
+		:	mIterator(other.mIterator)
+		{
+			++sIterationNestDepth;
+		}
+
+		~instance_iter()
 		{
 			--sIterationNestDepth;
 		}
 
-		static instance_iter beginInstances() {	return instance_iter(getSet_().begin()); }
-		static instance_iter endInstances() { return instance_iter(getSet_().end()); }
-		static key_iter beginKeys() { return getSet_().begin(); }
-		static key_iter endKeys()   { return getSet_().end(); }
+	private:
+		friend class boost::iterator_core_access;
+
+		void increment() { mIterator++; }
+		bool equal(instance_iter const& other) const
+		{
+			return mIterator == other.mIterator;
+		}
+
+		T& dereference() const
+		{
+			return **mIterator;
+		}
+
+		typename InstanceSet::iterator mIterator;
 	};
 
+	static instance_iter beginInstances() {	return instance_iter(getSet_().begin()); }
+	static instance_iter endInstances() { return instance_iter(getSet_().end()); }
+
 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.
-		//llassert(sIterationNestDepth == 0);
 		getSet_().insert(static_cast<T*>(this));
 	}
 	virtual ~LLInstanceTracker()
 
 	LLInstanceTracker(const LLInstanceTracker& other)
 	{
-		//llassert(sIterationNestDepth == 0);
 		getSet_().insert(static_cast<T*>(this));
 	}
 

indra/llcommon/llversionviewer.h

 #ifndef LL_LLVERSIONVIEWER_H
 #define LL_LLVERSIONVIEWER_H
 
-const S32 LL_VERSION_MAJOR = 2;
-const S32 LL_VERSION_MINOR = 8;
-const S32 LL_VERSION_PATCH = 3;
+const S32 LL_VERSION_MAJOR = 3;
+const S32 LL_VERSION_MINOR = 0;
+const S32 LL_VERSION_PATCH = 0;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";

indra/llcommon/tests/llinstancetracker_test.cpp

         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 keys;
-        keys.insert(&one);
-        keys.insert(&two);
-        keys.insert(&three);
-	{
-		Unkeyed::LLInstanceTrackerScopedGuard guard;
-		for (Unkeyed::key_iter ki(guard.beginKeys()), kend(guard.endKeys());
-		     ki != kend; ++ki)
-		{
-			ensure_equals("spurious key", keys.erase(*ki), 1);
-		}
-	}
-        ensure_equals("unreported key", keys.size(), 0);
-
-        KeySet instances;
-        instances.insert(&one);
-        instances.insert(&two);
-        instances.insert(&three);
-	{
-		Unkeyed::LLInstanceTrackerScopedGuard guard;
-		for (Unkeyed::instance_iter ii(guard.beginInstances()), iend(guard.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);
+  //  }
 } // namespace tut

indra/llcrashlogger/llcrashlogger.cpp

 
 bool LLCrashLogger::init()
 {
-	LLCurl::initClass();
+	LLCurl::initClass(false);
 
 	// We assume that all the logs we're looking for reside on the current drive
 	gDirUtilp->initAppDirs("SecondLife");

indra/llmath/llvolume.cpp

 #if !LL_WINDOWS
 #include <stdint.h>
 #endif
+#include <cmath>
 
 #include "llerror.h"
 #include "llmemtype.h"
 bool LLVolumeFace::VertexData::compareNormal(const LLVolumeFace::VertexData& rhs, F32 angle_cutoff) const
 {
 	bool retval = false;
-	if (rhs.mData[POSITION].equals3(mData[POSITION]) && rhs.mTexCoord == mTexCoord)
+
+	const F32 epsilon = 0.00001f;
+
+	if (rhs.mData[POSITION].equals3(mData[POSITION], epsilon) && 
+		fabs(rhs.mTexCoord[0]-mTexCoord[0]) < epsilon &&
+		fabs(rhs.mTexCoord[1]-mTexCoord[1]) < epsilon)
 	{
 		if (angle_cutoff > 1.f)
 		{
-			retval = (mData[NORMAL].equals3(rhs.mData[NORMAL]));
+			retval = (mData[NORMAL].equals3(rhs.mData[NORMAL], epsilon));
 		}
 		else
 		{
 			}
 
 			{
-				U16* n = (U16*) &(norm[0]);
-				if(n)
+				if (!norm.empty())
 				{
+					U16* n = (U16*) &(norm[0]);
 					for (U32 j = 0; j < num_verts; ++j)
 					{
 						norm_out->set((F32) n[0], (F32) n[1], (F32) n[2]);
 						n += 3;
 					}
 				}
+				else
+				{
+					memset(norm_out, 0, sizeof(LLVector4a)*num_verts);
+				}
 			}
 
 			{
-				U16* t = (U16*) &(tc[0]);
-				if(t)
+				if (!tc.empty())
 				{
+					U16* t = (U16*) &(tc[0]);
 					for (U32 j = 0; j < num_verts; j+=2)
 					{
 						if (j < num_verts-1)
 						tc_out++;
 					}
 				}
+				else
+				{
+					memset(tc_out, 0, sizeof(LLVector2)*num_verts);
+				}
 			}
 
 			if (mdl[i].has("Weights"))
 					min.setMin(min, face.mPositions[i]);
 					max.setMax(max, face.mPositions[i]);
 				}
+
+				if (face.mTexCoords)
+				{
+					LLVector2& min_tc = face.mTexCoordExtents[0];
+					LLVector2& max_tc = face.mTexCoordExtents[1];
+
+					min_tc = face.mTexCoords[0];
+					max_tc = face.mTexCoords[0];
+
+					for (U32 j = 1; j < face.mNumVertices; ++j)
+					{
+						update_min_max(min_tc, max_tc, face.mTexCoords[j]);
+					}
+				}
+				else
+				{
+					face.mTexCoordExtents[0].set(0,0);
+					face.mTexCoordExtents[1].set(1,1);
+				}
 			}
 		}
 	}
 	n[2] = cv[2].getNormal();
 	n += 3;
 
-	tc[0] = cv[0].mTexCoord;
-	tc[1] = cv[1].mTexCoord;
-	tc[2] = cv[2].mTexCoord;
-	tc += 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]);
 	n[2] = cv[2].getNormal();
 	n += 3;
 
-	tc[0] = cv[0].mTexCoord;
-	tc[1] = cv[1].mTexCoord;
-	tc[2] = cv[2].mTexCoord;
-	tc += 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]);
 	n[2] = cv[2].getNormal();
 	n += 3;
 
-	tc[0] = cv[0].mTexCoord;
-	tc[1] = cv[1].mTexCoord;
-	tc[2] = cv[2].mTexCoord;
-	tc += 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]);
 	n[2] = cv[2].getNormal();
 	n += 3;
 
-	tc[0] = cv[0].mTexCoord;
-	tc[1] = cv[1].mTexCoord;
-	tc[2] = cv[2].mTexCoord;
-	tc += 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++)
 			
 		LLVector4a::memcpyNonAliased16((F32*) mPositions, (F32*) src.mPositions, vert_size);
 		LLVector4a::memcpyNonAliased16((F32*) mNormals, (F32*) src.mNormals, vert_size);
-		LLVector4a::memcpyNonAliased16((F32*) mTexCoords, (F32*) src.mTexCoords, tc_size);
+
+		if(src.mTexCoords)
+		{
+			LLVector4a::memcpyNonAliased16((F32*) mTexCoords, (F32*) src.mTexCoords, tc_size);
+		}
+		else
+		{
+			ll_aligned_free_16(mTexCoords) ;
+			mTexCoords = NULL ;
+		}
 
 
 		if (src.mBinormals)
 void LLVolumeFace::getVertexData(U16 index, LLVolumeFace::VertexData& cv)
 {
 	cv.setPosition(mPositions[index]);
-	cv.setNormal(mNormals[index]);
-	cv.mTexCoord = mTexCoords[index];
+	if (mNormals)
+	{
+		cv.setNormal(mNormals[index]);
+	}
+	else
+	{
+		cv.getNormal().clear();
+	}
+
+	if (mTexCoords)
+	{
+		cv.mTexCoord = mTexCoords[index];
+	}
+	else
+	{
+		cv.mTexCoord.clear();
+	}
 }
 
 bool LLVolumeFace::VertexMapData::operator==(const LLVolumeFace::VertexData& rhs) const
 	LLVolumeFace new_face;
 
 	//map of points to vector of vertices at that point
-	VertexMapData::PointMap point_map;
+	std::map<U64, std::vector<VertexMapData> > point_map;
+
+	LLVector4a range;
+	range.setSub(mExtents[1],mExtents[0]);
 
 	//remove redundant vertices
 	for (U32 i = 0; i < mNumIndices; ++i)
 		getVertexData(index, cv);
 		
 		BOOL found = FALSE;
-		VertexMapData::PointMap::iterator point_iter = point_map.find(LLVector3(cv.getPosition().getF32ptr()));
+
+		LLVector4a pos;
+		pos.setSub(mPositions[index], mExtents[0]);
+		pos.div(range);
+
+		U64 pos64 = 0;
+
+		pos64 = (U16) (pos[0]*65535);
+		pos64 = pos64 | (((U64) (pos[1]*65535)) << 16);
+		pos64 = pos64 | (((U64) (pos[2]*65535)) << 32);
+
+		std::map<U64, std::vector<VertexMapData> >::iterator point_iter = point_map.find(pos64);
+		
 		if (point_iter != point_map.end())
 		{ //duplicate point might exist
 			for (U32 j = 0; j < point_iter->second.size(); ++j)
 			}
 			else
 			{
-				point_map[LLVector3(d.getPosition().getF32ptr())].push_back(d);
-			}
-		}
+				point_map[pos64].push_back(d);
+			}
+		}
+	}
+
+	llassert(new_face.mNumIndices == mNumIndices);
+	llassert(new_face.mNumVertices <= mNumVertices);
+
+	if (angle_cutoff > 1.f && !mNormals)
+	{
+		ll_aligned_free_16(new_face.mNormals);
+		new_face.mNormals = NULL;
+	}
+
+	if (!mTexCoords)
+	{
+		ll_aligned_free_16(new_face.mTexCoords);
+		new_face.mTexCoords = NULL;
 	}
 
 	swapData(new_face);

indra/llmessage/llcurl.cpp

  * $/LicenseInfo$
  */
 
+
 #if LL_WINDOWS
 #define SAFE_SSL 1
 #elif LL_DARWIN
 static const S32 CURL_REQUEST_TIMEOUT = 30; // seconds
 static const S32 MAX_ACTIVE_REQUEST_COUNT = 100;
 
+static 
 // DEBUG //
 S32 gCurlEasyCount = 0;
 S32 gCurlMultiCount = 0;
 std::string LLCurl::sCAPath;
 std::string LLCurl::sCAFile;
 
+bool LLCurl::sMultiThreaded = false;
+static U32 sMainThreadID = 0;
+
 void check_curl_code(CURLcode code)
 {
 	if (code != CURLE_OK)
 	U32 report(CURLcode);
 	void getTransferInfo(LLCurl::TransferInfo* info);
 
-	void prepRequest(const std::string& url, const std::vector<std::string>& headers, ResponderPtr, bool post = false);
+	void prepRequest(const std::string& url, const std::vector<std::string>& headers, ResponderPtr, S32 time_out = 0, bool post = false);
 	
 	const char* getErrorBuffer();
 
 
 void LLCurl::Easy::prepRequest(const std::string& url,
 							   const std::vector<std::string>& headers,
-							   ResponderPtr responder, bool post)
+							   ResponderPtr responder, S32 time_out, bool post)
 {
 	resetState();
 	
 	
 	//don't verify host name so urls with scrubbed host names will work (improves DNS performance)
 	setopt(CURLOPT_SSL_VERIFYHOST, 0);
-	setopt(CURLOPT_TIMEOUT, CURL_REQUEST_TIMEOUT);
+	setopt(CURLOPT_TIMEOUT, llmax(time_out, CURL_REQUEST_TIMEOUT));
 
 	setoptString(CURLOPT_URL, url);
 
 
 	S32 process();
 	void perform();
+	void doPerform();
 	
 	virtual void run();
 
 
 	LLCondition* mSignal;
 	bool mQuitting;
+	bool mThreaded;
 
 private:
 	void easyFree(Easy*);
 	  mPerformState(PERFORM_STATE_READY)
 {
 	mQuitting = false;
-	mSignal = new LLCondition(NULL);
+
+	mThreaded = LLCurl::sMultiThreaded && LLThread::currentID() == sMainThreadID;
+	if (mThreaded)
+	{
+		mSignal = new LLCondition(NULL);
+	}
+	else
+	{
+		mSignal = NULL;
+	}
 
 	mCurlMultiHandle = curl_multi_init();
 	if (!mCurlMultiHandle)
 
 void LLCurl::Multi::perform()
 {
-	if (mPerformState == PERFORM_STATE_READY)
+	if (mThreaded)
 	{
-		mSignal->signal();
+		if (mPerformState == PERFORM_STATE_READY)
+		{
+			mSignal->signal();
+		}
+	}
+	else
+	{
+		doPerform();
 	}
 }
 
 void LLCurl::Multi::run()
 {
+	llassert(mThreaded);
+
 	while (!mQuitting)
 	{
 		mSignal->wait();
 		mPerformState = PERFORM_STATE_PERFORMING;
 		if (!mQuitting)
 		{
-			S32 q = 0;
-			for (S32 call_count = 0;
-				 call_count < MULTI_PERFORM_CALL_REPEAT;
-				 call_count += 1)
-			{
-				CURLMcode code = curl_multi_perform(mCurlMultiHandle, &q);
-				if (CURLM_CALL_MULTI_PERFORM != code || q == 0)
-				{
-					check_curl_multi_code(code);
-					break;
-				}
-	
-			}
-			mQueued = q;
-			mPerformState = PERFORM_STATE_COMPLETED;
+			doPerform();
 		}
 	}
 }
 
+void LLCurl::Multi::doPerform()
+{
+	S32 q = 0;
+	for (S32 call_count = 0;
+			call_count < MULTI_PERFORM_CALL_REPEAT;
+			call_count += 1)
+	{
+		CURLMcode code = curl_multi_perform(mCurlMultiHandle, &q);
+		if (CURLM_CALL_MULTI_PERFORM != code || q == 0)
+		{
+			check_curl_multi_code(code);
+			break;
+		}
+	
+	}
+	mQueued = q;
+	mPerformState = PERFORM_STATE_COMPLETED;
+}
+
 S32 LLCurl::Multi::process()
 {
 	perform();
 	{
 		LLCurl::Multi* multi = *iter;
 		multi->mQuitting = true;
-		while (!multi->isStopped())
+		if (multi->mThreaded)
 		{
-			multi->mSignal->signal();
-			apr_sleep(1000);
+			while (!multi->isStopped())
+			{
+				multi->mSignal->signal();
+				apr_sleep(1000);
+			}
 		}
 	}
 	for_each(mMultiSet.begin(), mMultiSet.end(), DeletePointer());
 {
 	llassert_always(mThreadID == LLThread::currentID());
 	LLCurl::Multi* multi = new LLCurl::Multi();
-	multi->start();
+	if (multi->mThreaded)
+	{
+		multi->start();
+	}
 	mMultiSet.insert(multi);
 	mActiveMulti = multi;
 	mActiveRequestCount = 0;
 bool LLCurlRequest::post(const std::string& url,
 						 const headers_t& headers,
 						 const LLSD& data,
-						 LLCurl::ResponderPtr responder)
+						 LLCurl::ResponderPtr responder, S32 time_out)
 {
 	LLCurl::Easy* easy = allocEasy();
 	if (!easy)
 	{
 		return false;
 	}
-	easy->prepRequest(url, headers, responder);
+	easy->prepRequest(url, headers, responder, time_out);
 
 	LLSDSerialize::toXML(data, easy->getInput());
 	S32 bytes = easy->getInput().str().length();
 bool LLCurlRequest::post(const std::string& url,
 						 const headers_t& headers,
 						 const std::string& data,
-						 LLCurl::ResponderPtr responder)
+						 LLCurl::ResponderPtr responder, S32 time_out)
 {
 	LLCurl::Easy* easy = allocEasy();
 	if (!easy)
 	{
 		return false;
 	}
-	easy->prepRequest(url, headers, responder);
+	easy->prepRequest(url, headers, responder, time_out);
 
 	easy->getInput().write(data.data(), data.size());
 	S32 bytes = easy->getInput().str().length();
 		{
 			mMultiSet.erase(curiter);
 			multi->mQuitting = true;
-			while (!multi->isStopped())
+			if (multi->mThreaded)
 			{
-				multi->mSignal->signal();
-				apr_sleep(1000);
+				while (!multi->isStopped())
+				{
+					multi->mSignal->signal();
+					apr_sleep(1000);
+				}
 			}
 
 			delete multi;
 		curlmulti_set_t::iterator curiter = iter++;
 		LLCurl::Multi* multi = *curiter;
 		queued += multi->mQueued;
+		if (multi->mPerformState != LLCurl::Multi::PERFORM_STATE_READY)
+		{
+			++queued;
+		}
 	}
 	return queued;
 }
 	  mResultReturned(false)
 {
 	mMulti = new LLCurl::Multi();
-	mMulti->start();
+	if (mMulti->mThreaded)
+	{
+		mMulti->start();
+	}
 	mEasy = mMulti->allocEasy();
 	if (mEasy)
 	{
 LLCurlEasyRequest::~LLCurlEasyRequest()
 {
 	mMulti->mQuitting = true;
-	while (!mMulti->isStopped())
+	if (mMulti->mThreaded)
 	{
-		mMulti->mSignal->signal();
-		apr_sleep(1000);
+		while (!mMulti->isStopped())
+		{
+			mMulti->mSignal->signal();
+			apr_sleep(1000);
+		}
 	}
 	delete mMulti;
 }
 }
 #endif
 
-void LLCurl::initClass()
+void LLCurl::initClass(bool multi_threaded)
 {
+	sMainThreadID = LLThread::currentID();
+	sMultiThreaded = multi_threaded;
 	// Do not change this "unless you are familiar with and mean to control 
 	// internal operations of libcurl"
 	// - http://curl.haxx.se/libcurl/c/curl_global_init.html

indra/llmessage/llcurl.h

 #include "llbuffer.h"
 #include "lliopipe.h"
 #include "llsd.h"
+#include "llthread.h"
 
 class LLMutex;
 
 	class Easy;
 	class Multi;
 
+	static bool sMultiThreaded;
+
 	struct TransferInfo
 	{
 		TransferInfo() : mSizeDownload(0.0), mTotalTime(0.0), mSpeedDownload(0.0) {}
 	/**
 	 * @ brief Initialize LLCurl class
 	 */
-	static void initClass();
+	static void initClass(bool multi_threaded = false);
 
 	/**
 	 * @ brief Cleanup LLCurl class
 
 	void get(const std::string& url, LLCurl::ResponderPtr responder);
 	bool getByteRange(const std::string& url, const headers_t& headers, S32 offset, S32 length, LLCurl::ResponderPtr responder);
-	bool post(const std::string& url, const headers_t& headers, const LLSD& data, LLCurl::ResponderPtr responder);
-	bool post(const std::string& url, const headers_t& headers, const std::string& data, LLCurl::ResponderPtr responder);
+	bool post(const std::string& url, const headers_t& headers, const LLSD& data, LLCurl::ResponderPtr responder, S32 time_out = 0);
+	bool post(const std::string& url, const headers_t& headers, const std::string& data, LLCurl::ResponderPtr responder, S32 time_out = 0);
 	
 	S32  process();
 	S32  getQueued();

indra/llplugin/llpluginclassmedia.cpp

-/** 
- * @file llpluginclassmedia.cpp
- * @brief LLPluginClassMedia handles a plugin which knows about the "media" message class.
- *
- * @cond
- * $LicenseInfo:firstyear=2008&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, 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$
- * @endcond
- */
-
-#include "linden_common.h"
-#include "indra_constants.h"
-
-#include "llpluginclassmedia.h"
-#include "llpluginmessageclasses.h"
-
-#include "llqtwebkit.h"
-
-static int LOW_PRIORITY_TEXTURE_SIZE_DEFAULT = 256;
-
-static int nextPowerOf2( int value )
-{
-	int next_power_of_2 = 1;
-	while ( next_power_of_2 < value )
-	{
-		next_power_of_2 <<= 1;
-	}
-	
-	return next_power_of_2;
-}
-
-LLPluginClassMedia::LLPluginClassMedia(LLPluginClassMediaOwner *owner)
-{
-	mOwner = owner;
-	mPlugin = NULL;
-	reset();
-
-	//debug use
-	mDeleteOK = true ;
-}
-
-
-LLPluginClassMedia::~LLPluginClassMedia()
-{
-	llassert_always(mDeleteOK) ;
-	reset();
-}
-
-bool LLPluginClassMedia::init(const std::string &launcher_filename, const std::string &plugin_dir, const std::string &plugin_filename, bool debug)
-{	
-	LL_DEBUGS("Plugin") << "launcher: " << launcher_filename << LL_ENDL;
-	LL_DEBUGS("Plugin") << "dir: " << plugin_dir << LL_ENDL;
-	LL_DEBUGS("Plugin") << "plugin: " << plugin_filename << LL_ENDL;
-	
-	mPlugin = new LLPluginProcessParent(this);
-	mPlugin->setSleepTime(mSleepTime);
-	
-	// Queue up the media init message -- it will be sent after all the currently queued messages.
-	LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "init");
-	message.setValue("target", mTarget);
-	sendMessage(message);
-	
-	mPlugin->init(launcher_filename, plugin_dir, plugin_filename, debug);
-
-	return true;
-}
-
-
-void LLPluginClassMedia::reset()
-{
-	if(mPlugin != NULL)
-	{
-		delete mPlugin;
-		mPlugin = NULL;
-	}
-
-	mTextureParamsReceived = false;
-	mRequestedTextureDepth = 0;
-	mRequestedTextureInternalFormat = 0;
-	mRequestedTextureFormat = 0;
-	mRequestedTextureType = 0;
-	mRequestedTextureSwapBytes = false;
-	mRequestedTextureCoordsOpenGL = false;
-	mTextureSharedMemorySize = 0;
-	mTextureSharedMemoryName.clear();
-	mDefaultMediaWidth = 0;
-	mDefaultMediaHeight = 0;
-	mNaturalMediaWidth = 0;
-	mNaturalMediaHeight = 0;
-	mSetMediaWidth = -1;
-	mSetMediaHeight = -1;
-	mRequestedMediaWidth = 0;
-	mRequestedMediaHeight = 0;
-	mRequestedTextureWidth = 0;
-	mRequestedTextureHeight = 0;
-	mFullMediaWidth = 0;
-	mFullMediaHeight = 0;
-	mTextureWidth = 0;
-	mTextureHeight = 0;
-	mMediaWidth = 0;
-	mMediaHeight = 0;
-	mDirtyRect = LLRect::null;	
-	mAutoScaleMedia = false;
-	mRequestedVolume = 1.0f;
-	mPriority = PRIORITY_NORMAL;
-	mLowPrioritySizeLimit = LOW_PRIORITY_TEXTURE_SIZE_DEFAULT;
-	mAllowDownsample = false;
-	mPadding = 0;
-	mLastMouseX = 0;
-	mLastMouseY = 0;
-	mStatus = LLPluginClassMediaOwner::MEDIA_NONE;
-	mSleepTime = 1.0f / 100.0f;
-	mCanCut = false;
-	mCanCopy = false;
-	mCanPaste = false;
-	mMediaName.clear();
-	mMediaDescription.clear();
-	mBackgroundColor = LLColor4(1.0f, 1.0f, 1.0f, 1.0f);
-	
-	// media_browser class
-	mNavigateURI.clear();
-	mNavigateResultCode = -1;
-	mNavigateResultString.clear();
-	mHistoryBackAvailable = false;
-	mHistoryForwardAvailable = false;
-	mStatusText.clear();
-	mProgressPercent = 0;	
-	mClickURL.clear();
-	mClickNavType.clear();
-	mClickTarget.clear();
-	mClickUUID.clear();
-	mStatusCode = 0;
-	
-	// media_time class
-	mCurrentTime = 0.0f;
-	mDuration = 0.0f;
-	mCurrentRate = 0.0f;
-	mLoadedDuration = 0.0f;
-}
-
-void LLPluginClassMedia::idle(void)
-{
-	if(mPlugin)
-	{
-		mPlugin->idle();
-	}
-	
-	if((mMediaWidth == -1) || (!mTextureParamsReceived) || (mPlugin == NULL) || (mPlugin->isBlocked()) || (mOwner == NULL))
-	{
-		// Can't process a size change at this time
-	}
-	else if((mRequestedMediaWidth != mMediaWidth) || (mRequestedMediaHeight != mMediaHeight))
-	{
-		// Calculate the correct size for the media texture
-		mRequestedTextureHeight = mRequestedMediaHeight;
-		if(mPadding < 0)
-		{
-			// negative values indicate the plugin wants a power of 2
-			mRequestedTextureWidth = nextPowerOf2(mRequestedMediaWidth);
-		}
-		else
-		{
-			mRequestedTextureWidth = mRequestedMediaWidth;
-			
-			if(mPadding > 1)
-			{
-				// Pad up to a multiple of the specified number of bytes per row
-				int rowbytes = mRequestedTextureWidth * mRequestedTextureDepth;
-				int pad = rowbytes % mPadding;
-				if(pad != 0)
-				{
-					rowbytes += mPadding - pad;
-				}
-				
-				if(rowbytes % mRequestedTextureDepth == 0)
-				{
-					mRequestedTextureWidth = rowbytes / mRequestedTextureDepth;
-				}
-				else
-				{
-					LL_WARNS("Plugin") << "Unable to pad texture width, padding size " << mPadding << "is not a multiple of pixel size " << mRequestedTextureDepth << LL_ENDL;
-				}
-			}
-		}
-
-		
-		// Size change has been requested but not initiated yet.
-		size_t newsize = mRequestedTextureWidth * mRequestedTextureHeight * mRequestedTextureDepth;
-
-		// Add an extra line for padding, just in case.
-		newsize += mRequestedTextureWidth * mRequestedTextureDepth;
-
-		if(newsize != mTextureSharedMemorySize)
-		{
-			if(!mTextureSharedMemoryName.empty())
-			{
-				// Tell the plugin to remove the old memory segment
-				mPlugin->removeSharedMemory(mTextureSharedMemoryName);
-				mTextureSharedMemoryName.clear();
-			}
-			
-			mTextureSharedMemorySize = newsize;
-			mTextureSharedMemoryName = mPlugin->addSharedMemory(mTextureSharedMemorySize);
-			if(!mTextureSharedMemoryName.empty())
-			{
-				void *addr = mPlugin->getSharedMemoryAddress(mTextureSharedMemoryName);
-				
-				// clear texture memory to avoid random screen visual fuzz from uninitialized texture data
-				memset( addr, 0x00, newsize );
-				
-				// We could do this to force an update, but textureValid() will still be returning false until the first roundtrip to the plugin,
-				// so it may not be worthwhile.
-				// mDirtyRect.setOriginAndSize(0, 0, mRequestedMediaWidth, mRequestedMediaHeight);
-			}
-		}
-		
-		// This is our local indicator that a change is in progress.
-		mTextureWidth = -1;
-		mTextureHeight = -1;
-		mMediaWidth = -1;
-		mMediaHeight = -1;
-
-		// This invalidates any existing dirty rect.
-		resetDirty();
-		
-		// Send a size change message to the plugin
-		{
-			LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change");
-			message.setValue("name", mTextureSharedMemoryName);
-			message.setValueS32("width", mRequestedMediaWidth);
-			message.setValueS32("height", mRequestedMediaHeight);
-			message.setValueS32("texture_width", mRequestedTextureWidth);
-			message.setValueS32("texture_height", mRequestedTextureHeight);
-			message.setValueReal("background_r", mBackgroundColor.mV[VX]);
-			message.setValueReal("background_g", mBackgroundColor.mV[VY]);
-			message.setValueReal("background_b", mBackgroundColor.mV[VZ]);
-			message.setValueReal("background_a", mBackgroundColor.mV[VW]);
-			mPlugin->sendMessage(message);	// DO NOT just use sendMessage() here -- we want this to jump ahead of the queue.
-			
-			LL_DEBUGS("Plugin") << "Sending size_change" << LL_ENDL;
-		}
-	}
-	
-	if(mPlugin && mPlugin->isRunning())
-	{
-		// Send queued messages
-		while(!mSendQueue.empty())
-		{
-			LLPluginMessage message = mSendQueue.front();
-			mSendQueue.pop();
-			mPlugin->sendMessage(message);
-		}
-	}
-}
-
-int LLPluginClassMedia::getTextureWidth() const
-{
-	return nextPowerOf2(mTextureWidth);
-}
-
-int LLPluginClassMedia::getTextureHeight() const
-{
-	return nextPowerOf2(mTextureHeight);
-}
-
-unsigned char* LLPluginClassMedia::getBitsData()
-{
-	unsigned char *result = NULL;
-	if((mPlugin != NULL) && !mTextureSharedMemoryName.empty())
-	{
-		result = (unsigned char*)mPlugin->getSharedMemoryAddress(mTextureSharedMemoryName);
-	}
-	return result;
-}
-
-void LLPluginClassMedia::setSize(int width, int height)
-{
-	if((width > 0) && (height > 0))
-	{
-		mSetMediaWidth = width;
-		mSetMediaHeight = height;
-	}
-	else
-	{
-		mSetMediaWidth = -1;
-		mSetMediaHeight = -1;
-	}
-
-	setSizeInternal();
-}
-
-void LLPluginClassMedia::setSizeInternal(void)
-{
-	if((mSetMediaWidth > 0) && (mSetMediaHeight > 0))
-	{
-		mRequestedMediaWidth = mSetMediaWidth;
-		mRequestedMediaHeight = mSetMediaHeight;
-	}
-	else if((mNaturalMediaWidth > 0) && (mNaturalMediaHeight > 0))
-	{
-		mRequestedMediaWidth = mNaturalMediaWidth;
-		mRequestedMediaHeight = mNaturalMediaHeight;
-	}
-	else
-	{
-		mRequestedMediaWidth = mDefaultMediaWidth;
-		mRequestedMediaHeight = mDefaultMediaHeight;
-	}
-	
-	// Save these for size/interest calculations
-	mFullMediaWidth = mRequestedMediaWidth;
-	mFullMediaHeight = mRequestedMediaHeight;
-	
-	if(mAllowDownsample)
-	{
-		switch(mPriority)
-		{
-			case PRIORITY_SLIDESHOW:
-			case PRIORITY_LOW:
-				// Reduce maximum texture dimension to (or below) mLowPrioritySizeLimit
-				while((mRequestedMediaWidth > mLowPrioritySizeLimit) || (mRequestedMediaHeight > mLowPrioritySizeLimit))
-				{
-					mRequestedMediaWidth /= 2;
-					mRequestedMediaHeight /= 2;
-				}
-			break;
-			
-			default:
-				// Don't adjust texture size
-			break;
-		}
-	}
-	
-	if(mAutoScaleMedia)
-	{
-		mRequestedMediaWidth = nextPowerOf2(mRequestedMediaWidth);
-		mRequestedMediaHeight = nextPowerOf2(mRequestedMediaHeight);
-	}
-	
-	if(mRequestedMediaWidth > 2048)
-		mRequestedMediaWidth = 2048;
-
-	if(mRequestedMediaHeight > 2048)
-		mRequestedMediaHeight = 2048;
-}
-
-void LLPluginClassMedia::setAutoScale(bool auto_scale)
-{
-	if(auto_scale != mAutoScaleMedia)
-	{
-		mAutoScaleMedia = auto_scale;
-		setSizeInternal();
-	}
-}
-
-bool LLPluginClassMedia::textureValid(void)
-{
-	if(
-		!mTextureParamsReceived ||
-		mTextureWidth <= 0 ||
-		mTextureHeight <= 0 ||
-		mMediaWidth <= 0 ||
-		mMediaHeight <= 0 ||
-		mRequestedMediaWidth != mMediaWidth ||
-		mRequestedMediaHeight != mMediaHeight ||
-		getBitsData() == NULL
-	)	
-		return false;
-	
-	return true;
-}
-
-bool LLPluginClassMedia::getDirty(LLRect *dirty_rect)
-{
-	bool result = !mDirtyRect.isEmpty();
-
-	if(dirty_rect != NULL)
-	{
-		*dirty_rect = mDirtyRect;
-	}
-
-	return result;
-}
-
-void LLPluginClassMedia::resetDirty(void)
-{
-	mDirtyRect = LLRect::null;
-}
-
-std::string LLPluginClassMedia::translateModifiers(MASK modifiers)