From 611d8bdf6155f6c7b440ab745f197d278a74b209 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 6 Jan 2011 16:20:21 -0700 Subject: use the private pool in the texture pipeline --- indra/llimage/llimage.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'indra/llimage/llimage.h') diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index bca7e915fa..b137ea9a61 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -29,7 +29,6 @@ #include "lluuid.h" #include "llstring.h" -//#include "llmemory.h" #include "llthread.h" #include "llmemtype.h" @@ -56,6 +55,7 @@ const S32 MAX_IMG_PACKET_SIZE = 1000; class LLImageFormatted; class LLImageRaw; class LLColor4U; +class LLPrivateMemoryPool; typedef enum e_image_codec { @@ -127,7 +127,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); @@ -138,6 +138,11 @@ public: static EImageCodec getCodecFromExtension(const std::string& exten); + static void createPrivatePool() ; + static void destroyPrivatePool() ; + static char* allocateMemory(S32 size) ; + static void deleteMemory(void* p) ; + private: U8 *mData; S32 mDataSize; @@ -149,6 +154,8 @@ private: bool mBadBufferAllocation ; bool mAllowOverSize ; + + static LLPrivateMemoryPool* sPrivatePoolp ; public: LLMemType::DeclareMemType& mMemType; // debug }; @@ -172,7 +179,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); @@ -184,7 +191,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 ); -- cgit v1.2.3 From b594d3b04d3095f15750436910debdd5a602a872 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 10 May 2011 21:02:20 -0600 Subject: add debug mode to track the memory allocation/deallocation. --- indra/llimage/llimage.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/llimage/llimage.h') diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index ab20ccda9e..10621623ad 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -140,8 +140,7 @@ public: static void createPrivatePool() ; static void destroyPrivatePool() ; - static char* allocateMemory(S32 size) ; - static void deleteMemory(void* p) ; + static LLPrivateMemoryPool* getPrivatePool() {return sPrivatePoolp;} private: U8 *mData; -- cgit v1.2.3