SH-4297 WIP interesting: viewer-interesting starts loading cached scene late

dependency cleanup - removed a lot of unecessary includes
master
Richard Linden 2013-07-18 15:09:45 -07:00
parent 862cdf3061
commit 075a7bcc98
25 changed files with 140 additions and 117 deletions

View File

@ -44,6 +44,7 @@
#include "llstl.h"
#include "lltexglobalcolor.h"
#include "llwearabledata.h"
#include "boost/bind.hpp"
#if LL_MSVC

View File

@ -33,6 +33,7 @@
#include "llvisualparam.h"
#include "llavatarappearancedefines.h"
#include "llwearable.h"
#include "boost/bind.hpp"
using namespace LLAvatarAppearanceDefines;

View File

@ -30,7 +30,6 @@
#include "llsd.h"
#include "llpointer.h"
#include "llthread.h"
namespace LLOldEvents
{

View File

@ -32,9 +32,6 @@
#include <typeinfo>
#include "string_table.h"
#include <boost/utility.hpp>
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include <boost/iterator/transform_iterator.hpp>
#include <boost/iterator/indirect_iterator.hpp>

View File

@ -27,13 +27,16 @@
#ifndef LL_LLMUTEX_H
#define LL_LLMUTEX_H
#include "llapr.h"
#include "apr_thread_cond.h"
#include "stdtypes.h"
//============================================================================
#define MUTEX_DEBUG (LL_DEBUG || LL_RELEASE_WITH_DEBUG_INFO)
struct apr_thread_mutex_t;
struct apr_pool_t;
struct apr_thread_cond_t;
class LL_COMMON_API LLMutex
{
public:
@ -45,18 +48,18 @@ public:
LLMutex(apr_pool_t *apr_poolp = NULL); // NULL pool constructs a new pool for the mutex
virtual ~LLMutex();
void lock(); // blocks
void lock(); // blocks
void unlock();
bool isLocked(); // non-blocking, but does do a lock/unlock so not free
bool isSelfLocked(); //return true if locked in a same thread
bool isLocked(); // non-blocking, but does do a lock/unlock so not free
bool isSelfLocked(); //return true if locked in a same thread
U32 lockingThread() const; //get ID of locking thread
protected:
apr_thread_mutex_t *mAPRMutexp;
apr_thread_mutex_t* mAPRMutexp;
mutable U32 mCount;
mutable U32 mLockingThread;
apr_pool_t *mAPRPoolp;
apr_pool_t* mAPRPoolp;
BOOL mIsLocalPool;
#if MUTEX_DEBUG
@ -68,7 +71,7 @@ protected:
class LL_COMMON_API LLCondition : public LLMutex
{
public:
LLCondition(apr_pool_t *apr_poolp); // Defaults to global pool, could use the thread pool as well.
LLCondition(apr_pool_t* apr_poolp); // Defaults to global pool, could use the thread pool as well.
~LLCondition();
void wait(); // blocks
@ -76,7 +79,7 @@ public:
void broadcast();
protected:
apr_thread_cond_t *mAPRCondp;
apr_thread_cond_t* mAPRCondp;
};
class LLMutexLock

View File

@ -27,6 +27,7 @@
#define LLPOINTER_H
#include "llerror.h" // *TODO: consider eliminating this
#include "llmutex.h"
//----------------------------------------------------------------------------
// RefCount objects should generally only be accessed by way of LLPointer<>'s
@ -213,4 +214,82 @@ private:
bool mStayUnique;
};
//============================================================================
// see llmemory.h for LLPointer<> definition
class LL_COMMON_API LLThreadSafeRefCount
{
public:
static void initThreadSafeRefCount(); // creates sMutex
static void cleanupThreadSafeRefCount(); // destroys sMutex
private:
static LLMutex* sMutex;
protected:
virtual ~LLThreadSafeRefCount(); // use unref()
public:
LLThreadSafeRefCount();
LLThreadSafeRefCount(const LLThreadSafeRefCount&);
LLThreadSafeRefCount& operator=(const LLThreadSafeRefCount& ref)
{
if (sMutex)
{
sMutex->lock();
}
mRef = 0;
if (sMutex)
{
sMutex->unlock();
}
return *this;
}
void ref()
{
if (sMutex) sMutex->lock();
mRef++;
if (sMutex) sMutex->unlock();
}
S32 unref()
{
llassert(mRef >= 1);
if (sMutex) sMutex->lock();
S32 res = --mRef;
if (sMutex) sMutex->unlock();
if (0 == res)
{
delete this;
return 0;
}
return res;
}
S32 getNumRefs() const
{
return mRef;
}
private:
S32 mRef;
};
/**
* intrusive pointer support for LLThreadSafeRefCount
* this allows you to use boost::intrusive_ptr with any LLThreadSafeRefCount-derived type
*/
namespace boost
{
inline void intrusive_ptr_add_ref(LLThreadSafeRefCount* p)
{
p->ref();
}
inline void intrusive_ptr_release(LLThreadSafeRefCount* p)
{
p->unref();
}
};
#endif

View File

@ -33,7 +33,6 @@
#include "llpointer.h"
#include "llrefcount.h" // LLRefCount
#include "llthread.h" // LLThreadSafeRefCount
#include <boost/type_traits/is_base_of.hpp>
#include <boost/type_traits/remove_pointer.hpp>
#include <boost/utility/enable_if.hpp>

View File

@ -30,6 +30,7 @@
// Project includes
#include "llsdparam.h"
#include "llsdutil.h"
#include "boost/bind.hpp"
static LLInitParam::Parser::parser_read_func_map_t sReadFuncs;
static LLInitParam::Parser::parser_write_func_map_t sWriteFuncs;

View File

@ -32,6 +32,7 @@
#include "apr_thread_cond.h"
#include "boost/intrusive_ptr.hpp"
#include "llmutex.h"
#include "llpointer.h"
LL_COMMON_API void assert_main_thread();
@ -148,86 +149,6 @@ void LLThread::unlockData()
//============================================================================
// see llmemory.h for LLPointer<> definition
class LL_COMMON_API LLThreadSafeRefCount
{
public:
static void initThreadSafeRefCount(); // creates sMutex
static void cleanupThreadSafeRefCount(); // destroys sMutex
private:
static LLMutex* sMutex;
protected:
virtual ~LLThreadSafeRefCount(); // use unref()
public:
LLThreadSafeRefCount();
LLThreadSafeRefCount(const LLThreadSafeRefCount&);
LLThreadSafeRefCount& operator=(const LLThreadSafeRefCount& ref)
{
if (sMutex)
{
sMutex->lock();
}
mRef = 0;
if (sMutex)
{
sMutex->unlock();
}
return *this;
}
void ref()
{
if (sMutex) sMutex->lock();
mRef++;
if (sMutex) sMutex->unlock();
}
S32 unref()
{
llassert(mRef >= 1);
if (sMutex) sMutex->lock();
S32 res = --mRef;
if (sMutex) sMutex->unlock();
if (0 == res)
{
delete this;
return 0;
}
return res;
}
S32 getNumRefs() const
{
return mRef;
}
private:
S32 mRef;
};
/**
* intrusive pointer support for LLThreadSafeRefCount
* this allows you to use boost::intrusive_ptr with any LLThreadSafeRefCount-derived type
*/
namespace boost
{
inline void intrusive_ptr_add_ref(LLThreadSafeRefCount* p)
{
p->ref();
}
inline void intrusive_ptr_release(LLThreadSafeRefCount* p)
{
p->unref();
}
};
//============================================================================
// Simple responder for self destructing callbacks
// Pure virtual class
class LL_COMMON_API LLResponder : public LLThreadSafeRefCount

View File

@ -123,6 +123,7 @@ class EventStatHandle
public:
typedef F64 storage_t;
typedef TraceType<EventAccumulator> trace_t;
typedef EventStatHandle<T> self_t;
EventStatHandle(const char* name, const char* description = NULL)
: trace_t(name, description)
@ -146,6 +147,7 @@ class SampleStatHandle
public:
typedef F64 storage_t;
typedef TraceType<SampleAccumulator> trace_t;
typedef SampleStatHandle<T> self_t;
SampleStatHandle(const char* name, const char* description = NULL)
: trace_t(name, description)
@ -168,6 +170,7 @@ class CountStatHandle
public:
typedef F64 storage_t;
typedef TraceType<CountAccumulator> trace_t;
typedef CountStatHandle<T> self_t;
CountStatHandle(const char* name, const char* description = NULL)
: trace_t(name, description)

View File

@ -30,12 +30,12 @@
#include "stdtypes.h"
#include "llpreprocessor.h"
#include "llerrorlegacy.h"
#include <boost/type_traits/is_same.hpp>
template<typename STORAGE_TYPE, typename UNIT_TYPE>
struct LLUnit
{
typedef LLUnit<STORAGE_TYPE, UNIT_TYPE> self_t;
typedef STORAGE_TYPE storage_t;
// value initialization
@ -163,18 +163,28 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNIT_TYPE>
};
template<typename S, typename T>
struct LLIsSameType
{
static const bool value = false;
};
template<typename T>
struct LLIsSameType<T, T>
{
static const bool value = true;
};
template<typename S1, typename T1, typename S2, typename T2>
LL_FORCE_INLINE void ll_convert_units(LLUnit<S1, T1> in, LLUnit<S2, T2>& out, ...)
{
typedef boost::integral_constant<bool,
boost::is_same<T1, T2>::value
|| !boost::is_same<T1, typename T1::base_unit_t>::value
|| !boost::is_same<T2, typename T2::base_unit_t>::value> conversion_valid_t;
LL_STATIC_ASSERT(conversion_valid_t::value, "invalid conversion");
LL_STATIC_ASSERT((LLIsSameType<T1, T2>::value
|| !LLIsSameType<T1, typename T1::base_unit_t>::value
|| !LLIsSameType<T2, typename T2::base_unit_t>::value), "invalid conversion");
if (boost::is_same<T1, typename T1::base_unit_t>::value)
if (LLIsSameType<T1, typename T1::base_unit_t>::value)
{
if (boost::is_same<T2, typename T2::base_unit_t>::value)
if (LLIsSameType<T2, typename T2::base_unit_t>::value)
{
// T1 and T2 fully reduced and equal...just copy

View File

@ -26,6 +26,7 @@
#include "linden_common.h"
#include "llimageworker.h"
#include "llimage.h"
#include "llmath.h"
@ -37,7 +38,6 @@
#include "llimagejpeg.h"
#include "llimagepng.h"
#include "llimagedxt.h"
#include "llimageworker.h"
#include "llmemory.h"
//---------------------------------------------------------------------------

View File

@ -29,7 +29,7 @@
#include "lluuid.h"
#include "llstring.h"
#include "llthread.h"
#include "llpointer.h"
#include "lltrace.h"
const S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2

View File

@ -172,8 +172,8 @@ bool LLImageDimensionsInfo::getImageDimensionsJpeg()
/* Make sure this is a JPEG file. */
const size_t JPEG_MAGIC_SIZE = 2;
const uint8_t jpeg_magic[JPEG_MAGIC_SIZE] = {0xFF, 0xD8};
uint8_t signature[JPEG_MAGIC_SIZE];
const U8 jpeg_magic[JPEG_MAGIC_SIZE] = {0xFF, 0xD8};
U8 signature[JPEG_MAGIC_SIZE];
if (fread(signature, sizeof(signature), 1, fp) != 1)
{

View File

@ -27,6 +27,8 @@
#ifndef LL_LLIMAGEDIMENSIONSINFO_H
#define LL_LLIMAGEDIMENSIONSINFO_H
#include "llapr.h"
//-----------------------------------------------------------------------------
// LLImageDimensionsInfo
// helper class to get image dimensions WITHOUT loading image to memore

View File

@ -24,6 +24,7 @@
*/
#include "linden_common.h"
#include "llapr.h"
#include "lldir.h"
#include "llimagej2c.h"
#include "lltimer.h"

View File

@ -31,6 +31,7 @@
#include "llimage.h"
#include "llwin32headerslean.h"
extern "C" {
#ifdef LL_STANDALONE
# include <jpeglib.h>

View File

@ -41,7 +41,6 @@
#include "llbuffer.h"
#include "lliopipe.h"
#include "llsd.h"
#include "llthread.h"
#include "llqueuedthread.h"
#include "llframetimer.h"
#include "llpointer.h"

View File

@ -28,6 +28,7 @@
#define LL_FLASHTIMER_H
#include "lleventtimer.h"
#include "boost/function.hpp"
class LLFlashTimer : public LLEventTimer
{

View File

@ -29,6 +29,7 @@
#include "llrngwriter.h"
#include "lluicolor.h"
#include "lluictrlfactory.h"
#include "boost/bind.hpp"
static LLInitParam::Parser::parser_read_func_map_t sReadFuncs;
static LLInitParam::Parser::parser_write_func_map_t sWriteFuncs;

View File

@ -38,6 +38,7 @@
#include <fstream>
#include <boost/tokenizer.hpp>
#include <boost/bind.hpp>
//#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/classic_core.hpp>

View File

@ -39,7 +39,6 @@
#include "indra_constants.h"
#include "llpointer.h"
#include "llthread.h" // LLThreadSafeRefCount
#include "llstring.h"
#include "llstringtable.h"
#include "llfile.h"

View File

@ -271,7 +271,7 @@ private:
LLWatchdogTimeout* mMainloopTimeout;
// For performance and metric gathering
LLThread* mFastTimerLogThread;
class LLThread* mFastTimerLogThread;
// for tracking viewer<->region circuit death
bool mAgentRegionLastAlive;

View File

@ -28,9 +28,10 @@
#ifndef LLSECAPI_H
#define LLSECAPI_H
#include <vector>
#include "llwin32headerslean.h"
#include <openssl/x509.h>
#include <ostream>
#include "llthread.h"
#include "llpointer.h"
#ifdef LL_WINDOWS
#pragma warning(disable:4250)

View File

@ -48,6 +48,8 @@ struct SimMeasurementSampler : public LLInstanceTracker<SimMeasurementSampler, E
template<typename T = F64>
struct SimMeasurement : public LLTrace::SampleStatHandle<T>, public SimMeasurementSampler
{
typedef SimMeasurement<T> self_t;
SimMeasurement(const char* name, const char* description, ESimStatID stat_id)
: LLTrace::SampleStatHandle<T>(name, description),
SimMeasurementSampler(stat_id)
@ -55,17 +57,18 @@ struct SimMeasurement : public LLTrace::SampleStatHandle<T>, public SimMeasureme
using SimMeasurementSampler::getInstance;
//friend void sample(self_t& measurement, T value)
//{
// LLTrace::sample(static_cast<LLTrace::SampleStatHandle<T>& >(measurement), value);
//}
/*virtual*/ void sample(F64 value)
{
LLTrace::sample(*this, value);
LLTrace::sample(static_cast<LLTrace::SampleStatHandle<T>& >(*this), value);
//LLStatViewer::sample(*this, value);
}
};
template<typename T, typename VALUE_T>
void sample(SimMeasurement<T>& measurement, VALUE_T value)
{
LLTrace::sample(measurement, value);
}
};
extern LLTrace::CountStatHandle<> FPS,
PACKETS_IN,