diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2013-08-19 16:12:07 -0600 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2013-08-19 16:12:07 -0600 |
commit | 1616b73ef30bcb3e99be68fb7ccc05f0be78ddf6 (patch) | |
tree | e22c94948ed8d8c7f35422fc064172ea3662b264 /indra/llimage/llimage.cpp | |
parent | ea45b8acd25785bd2789c2c1928e223c9a8e2fbd (diff) | |
parent | d8c02bf06250015b8cb0bcc9c0d8445cfb6acf1c (diff) |
Automated merge with http://bitbucket.org/lindenlab/viewer-interesting
Diffstat (limited to 'indra/llimage/llimage.cpp')
-rwxr-xr-x | indra/llimage/llimage.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 83638b56a3..7a46f47473 100755 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -690,8 +690,17 @@ void LLImageRaw::fill( const LLColor4U& color ) } } +LLPointer<LLImageRaw> LLImageRaw::duplicate() +{ + if(getNumRefs() < 2) + { + return this; //nobody else refences to this image, no need to duplicate. + } - + //make a duplicate + LLPointer<LLImageRaw> dup = new LLImageRaw(getData(), getWidth(), getHeight(), getComponents()); + return dup; +} // Src and dst can be any size. Src and dst can each have 3 or 4 components. void LLImageRaw::copy(LLImageRaw* src) |