diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-07-25 15:17:11 +0300 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-07-25 15:17:11 +0300 |
commit | 17fae30f721c716bab1dd78cc5f8ac6b0aad49e0 (patch) | |
tree | 151ea9257c62e26a08d86194c5b9ac14261df77e /indra/llimage/llimage.h | |
parent | 8df0583db09426904523f8dc70d638f9b8f2d809 (diff) |
DRTVWR-493 LLImage to LLParamSingleton
Diffstat (limited to 'indra/llimage/llimage.h')
-rw-r--r-- | indra/llimage/llimage.h | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index 8ec49d3f0f..e5526ba9c0 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -30,6 +30,7 @@ #include "lluuid.h" #include "llstring.h" #include "llpointer.h" +#include "llsingleton.h" #include "lltrace.h" const S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2 @@ -88,23 +89,25 @@ typedef enum e_image_codec //============================================================================ // library initialization class -class LLImage +class LLImage : public LLParamSingleton<LLImage> { + LLPARAMSINGLETON(LLImage, bool use_new_byte_range = false, S32 minimal_reverse_byte_range_percent = 75); + ~LLImage(); public: - static void initClass(bool use_new_byte_range = false, S32 minimal_reverse_byte_range_percent = 75); - static void cleanupClass(); - static const std::string& getLastError(); - static void setLastError(const std::string& message); - - static bool useNewByteRange() { return sUseNewByteRange; } - static S32 getReverseByteRangePercent() { return sMinimalReverseByteRangePercent; } - -protected: - static LLMutex* sMutex; - static std::string sLastErrorMessage; - static bool sUseNewByteRange; - static S32 sMinimalReverseByteRangePercent; + const std::string& getLastErrorMessage(); + static const std::string& getLastError() { return getInstance()->getLastErrorMessage(); }; + void setLastErrorMessage(const std::string& message); + static void setLastError(const std::string& message) { getInstance()->setLastErrorMessage(message); } + + bool useNewByteRange() { return mUseNewByteRange; } + S32 getReverseByteRangePercent() { return mMinimalReverseByteRangePercent; } + +private: + LLMutex* mMutex; + std::string mLastErrorMessage; + bool mUseNewByteRange; + S32 mMinimalReverseByteRangePercent; }; //============================================================================ |