diff options
| author | JJ Linden <jj@lindenlab.com> | 2013-05-15 14:57:56 -0700 |
|---|---|---|
| committer | JJ Linden <jj@lindenlab.com> | 2013-05-15 14:57:56 -0700 |
| commit | a606a1cd68bd858c711856702185ae11194c6311 (patch) | |
| tree | 2c060215b7ddc02492d715cae6b48d5f3c26f335 /indra/llimage/llimage.cpp | |
| parent | 435bda9df464ef7faaf8329ffa094dca9e82a6a4 (diff) | |
| parent | 50e3b7da42ddbae409f0a2bdbc322da96941fa07 (diff) | |
merged in branch for changing BuildParams
Diffstat (limited to 'indra/llimage/llimage.cpp')
| -rwxr-xr-x[-rw-r--r--] | 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 1c25256e95..c8a05e1fae 100644..100755 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -689,8 +689,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) |
