summaryrefslogtreecommitdiff
path: root/indra/llimage/llimage.h
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2010-04-01 10:30:27 -0600
committerXiaohong Bao <bao@lindenlab.com>2010-04-01 10:30:27 -0600
commit990011f3d68b46ec43218800328d810bd153495a (patch)
tree7384f8157d3d81c622ba00a0f07d06461f824b9e /indra/llimage/llimage.h
parentfc8c4ea485f34ef52b2c3e037124795e5df9c064 (diff)
make LLImageBase::allocateData() thread-safe.
insert debug code for EXT-6567: crash at LLImageBase::allocateData [secondlife-bin llimage.cpp:170]
Diffstat (limited to 'indra/llimage/llimage.h')
-rw-r--r--indra/llimage/llimage.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h
index 686f583886..10444e7f89 100644
--- a/indra/llimage/llimage.h
+++ b/indra/llimage/llimage.h
@@ -48,7 +48,7 @@ const S32 MAX_IMAGE_SIZE = (1<<MAX_IMAGE_MIP); // 2048
const S32 MIN_IMAGE_AREA = MIN_IMAGE_SIZE * MIN_IMAGE_SIZE;
const S32 MAX_IMAGE_AREA = MAX_IMAGE_SIZE * MAX_IMAGE_SIZE;
const S32 MAX_IMAGE_COMPONENTS = 8;
-const S32 MAX_IMAGE_DATA_SIZE = MAX_IMAGE_AREA * MAX_IMAGE_COMPONENTS;
+const S32 MAX_IMAGE_DATA_SIZE = MAX_IMAGE_AREA * MAX_IMAGE_COMPONENTS; //2048 * 2048 * 8 = 16 MB
// Note! These CANNOT be changed without modifying simulator code
// *TODO: change both to 1024 when SIM texture fetching is deprecated
@@ -124,10 +124,12 @@ public:
const U8 *getData() const ;
U8 *getData() ;
- BOOL isBufferInvalid() ;
+ bool isBufferInvalid() ;
void setSize(S32 width, S32 height, S32 ncomponents);
U8* allocateDataSize(S32 width, S32 height, S32 ncomponents, S32 size = -1); // setSize() + allocateData()
+ void enableOverSize() {mAllowOverSize = true ;}
+ void disableOverSize() {mAllowOverSize = false; }
protected:
// special accessor to allow direct setting of mData and mDataSize by LLImageFormatted
@@ -140,8 +142,6 @@ public:
// <= 0 priority means that there's no need for more data.
static F32 calc_download_priority(F32 virtual_size, F32 visible_area, S32 bytes_sent);
- static void setSizeOverride(BOOL enabled) { sSizeOverride = enabled; }
-
static EImageCodec getCodecFromExtension(const std::string& exten);
private:
@@ -153,12 +153,10 @@ private:
S8 mComponents;
- BOOL mBadBufferAllocation ;
-
+ bool mBadBufferAllocation ;
+ bool mAllowOverSize ;
public:
LLMemType::DeclareMemType& mMemType; // debug
-
- static BOOL sSizeOverride;
};
// Raw representation of an image (used for textures, and other uncompressed formats