diff options
author | simon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com> | 2012-09-05 17:17:54 -0700 |
---|---|---|
committer | simon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com> | 2012-09-05 17:17:54 -0700 |
commit | 38acb45af804968a3a75e220b45ea4b1ef489633 (patch) | |
tree | 6ea9e4237149abef95a4bc550f46dacd65d98539 /indra/llimage | |
parent | 608fa855b3e8d647d22e586218a4fc12277c387e (diff) | |
parent | e3b4b3875a6d8c7857ba948a662ace4731913ecf (diff) |
Merge in latest viewer-development
Diffstat (limited to 'indra/llimage')
-rw-r--r-- | indra/llimage/llimage.cpp | 9 | ||||
-rw-r--r-- | indra/llimage/llimage.h | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index eb9ff4d5a0..4999f9886d 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -285,10 +285,15 @@ 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() { - 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); } diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index d4b2fc2589..b6caa730f1 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -186,7 +186,7 @@ protected: public: LLImageRaw(); LLImageRaw(U16 width, U16 height, S8 components); - LLImageRaw(U8 *data, U16 width, U16 height, S8 components); + LLImageRaw(U8 *data, U16 width, U16 height, S8 components, bool no_copy = false); // Construct using createFromFile (used by tools) //LLImageRaw(const std::string& filename, bool j2c_lowest_mip_only = false); |