summaryrefslogtreecommitdiff
path: root/indra/llimage/llimage.cpp
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2013-08-22 14:58:10 -0700
committerGilbert Gonzales <gilbert@lindenlab.com>2013-08-22 14:58:10 -0700
commita8d5b070b090d7467a1e95134be556951ae6698a (patch)
tree66bc89a1aa416382f0af17d8714d5a31e8c0c10d /indra/llimage/llimage.cpp
parent4595978d59d905bc9ef95efd759eac8cb62b57c3 (diff)
parent171089207b528ab80a954292c127ba77254ee927 (diff)
merging viewer release
Diffstat (limited to 'indra/llimage/llimage.cpp')
-rwxr-xr-xindra/llimage/llimage.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index 1c25256e95..c8a05e1fae 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)