diff options
| author | Logan Dethrow <log@lindenlab.com> | 2012-12-07 17:50:37 -0500 |
|---|---|---|
| committer | Logan Dethrow <log@lindenlab.com> | 2012-12-07 17:50:37 -0500 |
| commit | b6a7c8fcfdaf9220accf832a4dc07efcd08c6eeb (patch) | |
| tree | 621f992abc5e2d0ccc596a824ba70828c463ae87 /indra/llimage/llimage.cpp | |
| parent | 954200e97f0283a2f16d19601129d64fb16449c2 (diff) | |
| parent | a15ec8d014307da35b792659964cd5478d1aafe7 (diff) | |
Merge in backed out changes.
Diffstat (limited to 'indra/llimage/llimage.cpp')
| -rw-r--r-- | indra/llimage/llimage.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 6775b005f4..916c346b7a 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -292,11 +292,16 @@ LLImageRaw::LLImageRaw(U16 width, U16 height, S8 components) ++sRawImageCount; } -LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components) +LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components, bool no_copy) : LLImageBase() { mMemType = LLMemType::MTYPE_IMAGERAW; - if(allocateDataSize(width, height, components)) + + if(no_copy) + { + setDataAndSize(data, width, height, components); + } + else if(allocateDataSize(width, height, components)) { memcpy(getData(), data, width*height*components); } @@ -1660,6 +1665,12 @@ static void avg4_colors2(const U8* a, const U8* b, const U8* c, const U8* d, U8* dst[1] = (U8)(((U32)(a[1]) + b[1] + c[1] + d[1])>>2); } +void LLImageBase::setDataAndSize(U8 *data, S32 size) +{ + ll_assert_aligned(data, 16); + mData = data; mDataSize = size; +} + //static void LLImageBase::generateMip(const U8* indata, U8* mipdata, S32 width, S32 height, S32 nchannels) { |
