summaryrefslogtreecommitdiff
path: root/indra/llimage
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2013-08-26 18:54:39 -0400
committerMonty Brandenberg <monty@lindenlab.com>2013-08-26 18:54:39 -0400
commitf00b6c713347155fbde7e4c68e9656d29c13c6fc (patch)
tree757be382d012da06b2d730f07d06eed41091fb67 /indra/llimage
parenta45806e17cc99961ab559f544f43691ccafa9bf2 (diff)
parent6e1138585bf745f73f0bb99ca62f77eeb273f1e4 (diff)
Merge. Pull in viewer-release after SSA merge.
Diffstat (limited to 'indra/llimage')
-rwxr-xr-xindra/llimage/llimage.cpp11
-rwxr-xr-xindra/llimage/llimage.h4
2 files changed, 14 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)
diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h
index 4fc40ecff7..2277afc585 100755
--- a/indra/llimage/llimage.h
+++ b/indra/llimage/llimage.h
@@ -30,6 +30,7 @@
#include "lluuid.h"
#include "llstring.h"
#include "llthread.h"
+#include "llpointer.h"
const S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2
const S32 MAX_IMAGE_MIP = 11; // 2048x2048
@@ -214,6 +215,9 @@ public:
// Copy operations
+ //duplicate this raw image if refCount > 1.
+ LLPointer<LLImageRaw> duplicate();
+
// Src and dst can be any size. Src and dst can each have 3 or 4 components.
void copy( LLImageRaw* src );