summaryrefslogtreecommitdiff
path: root/indra/llimage
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-08-12 20:07:41 -0700
committerRichard Linden <none@none>2013-08-12 20:07:41 -0700
commitb8d49dab9afddf196618d66b1a409cdf7d2d53ba (patch)
tree535eb32ba4f17c87c0853cda9223c37a4940fea1 /indra/llimage
parentc2601ec9c574ac3bd7a7f4001bc08572483028a6 (diff)
parent1a093beb7f69e6911f34cb12d71502aa7a05982e (diff)
merge
Diffstat (limited to 'indra/llimage')
-rwxr-xr-xindra/llimage/llimage.cpp56
-rwxr-xr-xindra/llimage/llimagebmp.cpp4
-rwxr-xr-xindra/llimage/llimagedimensionsinfo.cpp16
-rwxr-xr-xindra/llimage/llimagedxt.cpp22
-rwxr-xr-xindra/llimage/llimagejpeg.cpp4
-rwxr-xr-xindra/llimage/llimagetga.cpp10
-rwxr-xr-xindra/llimage/llimageworker.cpp2
7 files changed, 57 insertions, 57 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index 655d7a381a..83638b56a3 100755
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -128,12 +128,12 @@ void LLImageBase::destroyPrivatePool()
// virtual
void LLImageBase::dump()
{
- llinfos << "LLImageBase mComponents " << mComponents
+ LL_INFOS() << "LLImageBase mComponents " << mComponents
<< " mData " << mData
<< " mDataSize " << mDataSize
<< " mWidth " << mWidth
<< " mHeight " << mHeight
- << llendl;
+ << LL_ENDL;
}
// virtual
@@ -145,13 +145,13 @@ void LLImageBase::sanityCheck()
|| mComponents > (S8)MAX_IMAGE_COMPONENTS
)
{
- llerrs << "Failed LLImageBase::sanityCheck "
+ LL_ERRS() << "Failed LLImageBase::sanityCheck "
<< "width " << mWidth
<< "height " << mHeight
<< "datasize " << mDataSize
<< "components " << mComponents
<< "data " << mData
- << llendl;
+ << LL_ENDL;
}
}
@@ -171,7 +171,7 @@ U8* LLImageBase::allocateData(S32 size)
size = mWidth * mHeight * mComponents;
if (size <= 0)
{
- llerrs << llformat("LLImageBase::allocateData called with bad dimensions: %dx%dx%d",mWidth,mHeight,(S32)mComponents) << llendl;
+ LL_ERRS() << llformat("LLImageBase::allocateData called with bad dimensions: %dx%dx%d",mWidth,mHeight,(S32)mComponents) << LL_ENDL;
}
}
@@ -179,14 +179,14 @@ U8* LLImageBase::allocateData(S32 size)
static const U32 MAX_BUFFER_SIZE = 4096 * 4096 * 16 ; //256 MB
if (size < 1 || size > MAX_BUFFER_SIZE)
{
- llinfos << "width: " << mWidth << " height: " << mHeight << " components: " << mComponents << llendl ;
+ LL_INFOS() << "width: " << mWidth << " height: " << mHeight << " components: " << mComponents << LL_ENDL ;
if(mAllowOverSize)
{
- llinfos << "Oversize: " << size << llendl ;
+ LL_INFOS() << "Oversize: " << size << LL_ENDL ;
}
else
{
- llerrs << "LLImageBase::allocateData: bad size: " << size << llendl;
+ LL_ERRS() << "LLImageBase::allocateData: bad size: " << size << LL_ENDL;
}
}
if (!mData || size != mDataSize)
@@ -196,7 +196,7 @@ U8* LLImageBase::allocateData(S32 size)
mData = (U8*)ALLOCATE_MEM(sPrivatePoolp, size);
if (!mData)
{
- llwarns << "Failed to allocate image data size [" << size << "]" << llendl;
+ LL_WARNS() << "Failed to allocate image data size [" << size << "]" << LL_ENDL;
size = 0 ;
mWidth = mHeight = 0 ;
mBadBufferAllocation = true ;
@@ -214,7 +214,7 @@ U8* LLImageBase::reallocateData(S32 size)
U8 *new_datap = (U8*)ALLOCATE_MEM(sPrivatePoolp, size);
if (!new_datap)
{
- llwarns << "Out of memory in LLImageBase::reallocateData" << llendl;
+ LL_WARNS() << "Out of memory in LLImageBase::reallocateData" << LL_ENDL;
return 0;
}
if (mData)
@@ -232,7 +232,7 @@ const U8* LLImageBase::getData() const
{
if(mBadBufferAllocation)
{
- llerrs << "Bad memory allocation for the image buffer!" << llendl ;
+ LL_ERRS() << "Bad memory allocation for the image buffer!" << LL_ENDL ;
}
return mData;
@@ -242,7 +242,7 @@ U8* LLImageBase::getData()
{
if(mBadBufferAllocation)
{
- llerrs << "Bad memory allocation for the image buffer!" << llendl ;
+ LL_ERRS() << "Bad memory allocation for the image buffer!" << LL_ENDL ;
}
return mData;
@@ -564,7 +564,7 @@ void LLImageRaw::composite( LLImageRaw* src )
// Src and dst can be any size. Src has 4 components. Dst has 3 components.
void LLImageRaw::compositeScaled4onto3(LLImageRaw* src)
{
- llinfos << "compositeScaled4onto3" << llendl;
+ LL_INFOS() << "compositeScaled4onto3" << LL_ENDL;
LLImageRaw* dst = this; // Just for clarity.
@@ -698,7 +698,7 @@ void LLImageRaw::copy(LLImageRaw* src)
{
if (!src)
{
- llwarns << "LLImageRaw::copy called with a null src pointer" << llendl;
+ LL_WARNS() << "LLImageRaw::copy called with a null src pointer" << LL_ENDL;
return;
}
@@ -1215,8 +1215,8 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip
llifstream ifs(name, llifstream::binary);
if (!ifs.is_open())
{
- // SJB: changed from llinfos to lldebugs to reduce spam
- lldebugs << "Unable to open image file: " << name << llendl;
+ // SJB: changed from LL_INFOS() to LL_DEBUGS() to reduce spam
+ LL_DEBUGS() << "Unable to open image file: " << name << LL_ENDL;
return false;
}
@@ -1230,7 +1230,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip
if (!length)
{
- llinfos << "Zero length file file: " << name << llendl;
+ LL_INFOS() << "Zero length file file: " << name << LL_ENDL;
return false;
}
@@ -1266,7 +1266,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip
if (!success)
{
deleteData();
- llwarns << "Unable to decode image" << name << llendl;
+ LL_WARNS() << "Unable to decode image" << name << LL_ENDL;
return false;
}
@@ -1371,11 +1371,11 @@ void LLImageFormatted::dump()
{
LLImageBase::dump();
- llinfos << "LLImageFormatted"
+ LL_INFOS() << "LLImageFormatted"
<< " mDecoding " << mDecoding
<< " mCodec " << S32(mCodec)
<< " mDecoded " << mDecoded
- << llendl;
+ << LL_ENDL;
}
//----------------------------------------------------------------------------
@@ -1458,11 +1458,11 @@ void LLImageFormatted::sanityCheck()
if (mCodec >= IMG_CODEC_EOF)
{
- llerrs << "Failed LLImageFormatted::sanityCheck "
+ LL_ERRS() << "Failed LLImageFormatted::sanityCheck "
<< "decoding " << S32(mDecoding)
<< "decoded " << S32(mDecoded)
<< "codec " << S32(mCodec)
- << llendl;
+ << LL_ENDL;
}
}
@@ -1638,7 +1638,7 @@ void LLImageBase::generateMip(const U8* indata, U8* mipdata, S32 width, S32 heig
*(U8*)data = (U8)(((U32)(indata[0]) + indata[1] + indata[in_width] + indata[in_width+1])>>2);
break;
default:
- llerrs << "generateMmip called with bad num channels" << llendl;
+ LL_ERRS() << "generateMmip called with bad num channels" << LL_ENDL;
}
indata += nchannels*2;
data += nchannels;
@@ -1695,17 +1695,17 @@ F32 LLImageBase::calc_download_priority(F32 virtual_size, F32 visible_pixels, S3
bytes_weight *= bytes_weight;
- //llinfos << "VS: " << virtual_size << llendl;
+ //LL_INFOS() << "VS: " << virtual_size << LL_ENDL;
F32 virtual_size_factor = virtual_size / (10.f*10.f);
// The goal is for weighted priority to be <= 0 when we've reached a point where
// we've sent enough data.
- //llinfos << "BytesSent: " << bytes_sent << llendl;
- //llinfos << "BytesWeight: " << bytes_weight << llendl;
- //llinfos << "PreLog: " << bytes_weight * virtual_size_factor << llendl;
+ //LL_INFOS() << "BytesSent: " << bytes_sent << LL_ENDL;
+ //LL_INFOS() << "BytesWeight: " << bytes_weight << LL_ENDL;
+ //LL_INFOS() << "PreLog: " << bytes_weight * virtual_size_factor << LL_ENDL;
w_priority = (F32)log10(bytes_weight * virtual_size_factor);
- //llinfos << "PreScale: " << w_priority << llendl;
+ //LL_INFOS() << "PreScale: " << w_priority << LL_ENDL;
// We don't want to affect how MANY bytes we send based on the visible pixels, but the order
// in which they're sent. We post-multiply so we don't change the zero point.
diff --git a/indra/llimage/llimagebmp.cpp b/indra/llimage/llimagebmp.cpp
index 60b1c628d7..8573fe0d91 100755
--- a/indra/llimage/llimagebmp.cpp
+++ b/indra/llimage/llimagebmp.cpp
@@ -321,7 +321,7 @@ BOOL LLImageBMP::updateData()
mColorPalette = new U8[color_palette_size];
if (!mColorPalette)
{
- llerrs << "Out of memory in LLImageBMP::updateData()" << llendl;
+ LL_ERRS() << "Out of memory in LLImageBMP::updateData()" << LL_ENDL;
return FALSE;
}
memcpy( mColorPalette, mdata + FILE_HEADER_SIZE + BITMAP_HEADER_SIZE + extension_size, color_palette_size ); /* Flawfinder: ignore */
@@ -528,7 +528,7 @@ BOOL LLImageBMP::encode(const LLImageRaw* raw_image, F32 encode_time)
if( (2 == src_components) || (4 == src_components) )
{
- llinfos << "Dropping alpha information during BMP encoding" << llendl;
+ LL_INFOS() << "Dropping alpha information during BMP encoding" << LL_ENDL;
}
setSize(raw_image->getWidth(), raw_image->getHeight(), dst_components);
diff --git a/indra/llimage/llimagedimensionsinfo.cpp b/indra/llimage/llimagedimensionsinfo.cpp
index 383ae00fb7..5bf3f29b3c 100755
--- a/indra/llimage/llimagedimensionsinfo.cpp
+++ b/indra/llimage/llimagedimensionsinfo.cpp
@@ -77,7 +77,7 @@ bool LLImageDimensionsInfo::getImageDimensionsBmp()
const S32 DATA_LEN = 26; // BMP header (14) + DIB header size (4) + width (4) + height (4)
if (!checkFileLength(DATA_LEN))
{
- llwarns << "Premature end of file" << llendl;
+ LL_WARNS() << "Premature end of file" << LL_ENDL;
return false;
}
@@ -89,7 +89,7 @@ bool LLImageDimensionsInfo::getImageDimensionsBmp()
// We only support Windows bitmaps (BM), according to LLImageBMP::updateData().
if (signature[0] != 'B' || signature[1] != 'M')
{
- llwarns << "Not a BMP" << llendl;
+ LL_WARNS() << "Not a BMP" << LL_ENDL;
return false;
}
@@ -108,7 +108,7 @@ bool LLImageDimensionsInfo::getImageDimensionsTga()
// Make sure the file is long enough.
if (!checkFileLength(TGA_FILE_HEADER_SIZE + 1 /* width */ + 1 /* height */))
{
- llwarns << "Premature end of file" << llendl;
+ LL_WARNS() << "Premature end of file" << LL_ENDL;
return false;
}
@@ -127,7 +127,7 @@ bool LLImageDimensionsInfo::getImageDimensionsPng()
// Make sure the file is long enough.
if (!checkFileLength(PNG_MAGIC_SIZE + 8 + sizeof(S32) * 2 /* width, height */))
{
- llwarns << "Premature end of file" << llendl;
+ LL_WARNS() << "Premature end of file" << LL_ENDL;
return false;
}
@@ -139,7 +139,7 @@ bool LLImageDimensionsInfo::getImageDimensionsPng()
// Make sure it's a PNG file.
if (memcmp(signature, png_magic, PNG_MAGIC_SIZE) != 0)
{
- llwarns << "Not a PNG" << llendl;
+ LL_WARNS() << "Not a PNG" << LL_ENDL;
return false;
}
@@ -156,7 +156,7 @@ void on_jpeg_error(j_common_ptr cinfo)
{
(void) cinfo;
sJpegErrorEncountered = true;
- llwarns << "Libjpeg has encountered an error!" << llendl;
+ LL_WARNS() << "Libjpeg has encountered an error!" << LL_ENDL;
}
bool LLImageDimensionsInfo::getImageDimensionsJpeg()
@@ -177,12 +177,12 @@ bool LLImageDimensionsInfo::getImageDimensionsJpeg()
if (fread(signature, sizeof(signature), 1, fp) != 1)
{
- llwarns << "Premature end of file" << llendl;
+ LL_WARNS() << "Premature end of file" << LL_ENDL;
return false;
}
if (memcmp(signature, jpeg_magic, JPEG_MAGIC_SIZE) != 0)
{
- llwarns << "Not a JPEG" << llendl;
+ LL_WARNS() << "Not a JPEG" << LL_ENDL;
return false;
}
fseek(fp, 0, SEEK_SET); // go back to start of the file
diff --git a/indra/llimage/llimagedxt.cpp b/indra/llimage/llimagedxt.cpp
index 34c6793522..04e0e752eb 100755
--- a/indra/llimage/llimagedxt.cpp
+++ b/indra/llimage/llimagedxt.cpp
@@ -52,7 +52,7 @@ S32 LLImageDXT::formatBits(EFileFormat format)
case FORMAT_RGB8: return 24;
case FORMAT_RGBA8: return 32;
default:
- llerrs << "LLImageDXT::Unknown format: " << format << llendl;
+ LL_ERRS() << "LLImageDXT::Unknown format: " << format << LL_ENDL;
return 0;
}
};
@@ -82,7 +82,7 @@ S32 LLImageDXT::formatComponents(EFileFormat format)
case FORMAT_RGB8: return 3;
case FORMAT_RGBA8: return 4;
default:
- llerrs << "LLImageDXT::Unknown format: " << format << llendl;
+ LL_ERRS() << "LLImageDXT::Unknown format: " << format << LL_ENDL;
return 0;
}
};
@@ -207,7 +207,7 @@ BOOL LLImageDXT::updateData()
if (data_size < mHeaderSize)
{
- llerrs << "LLImageDXT: not enough data" << llendl;
+ LL_ERRS() << "LLImageDXT: not enough data" << LL_ENDL;
}
S32 ncomponents = formatComponents(mFileFormat);
setSize(width, height, ncomponents);
@@ -224,7 +224,7 @@ S32 LLImageDXT::getMipOffset(S32 discard)
{
if (mFileFormat >= FORMAT_DXT1 && mFileFormat <= FORMAT_DXT5)
{
- llerrs << "getMipOffset called with old (unsupported) format" << llendl;
+ LL_ERRS() << "getMipOffset called with old (unsupported) format" << LL_ENDL;
}
S32 width = getWidth(), height = getHeight();
S32 num_mips = calcNumMips(width, height);
@@ -251,7 +251,7 @@ void LLImageDXT::setFormat()
{
case 3: mFileFormat = FORMAT_DXR1; break;
case 4: mFileFormat = FORMAT_DXR3; break;
- default: llerrs << "LLImageDXT::setFormat called with ncomponents = " << ncomponents << llendl;
+ default: LL_ERRS() << "LLImageDXT::setFormat called with ncomponents = " << ncomponents << LL_ENDL;
}
mHeaderSize = calcHeaderSize();
}
@@ -265,7 +265,7 @@ BOOL LLImageDXT::decode(LLImageRaw* raw_image, F32 time)
if (mFileFormat >= FORMAT_DXT1 && mFileFormat <= FORMAT_DXR5)
{
- llwarns << "Attempt to decode compressed LLImageDXT to Raw (unsupported)" << llendl;
+ LL_WARNS() << "Attempt to decode compressed LLImageDXT to Raw (unsupported)" << LL_ENDL;
return FALSE;
}
@@ -303,7 +303,7 @@ BOOL LLImageDXT::getMipData(LLPointer<LLImageRaw>& raw, S32 discard)
}
else if (discard < mDiscardLevel)
{
- llerrs << "Request for invalid discard level" << llendl;
+ LL_ERRS() << "Request for invalid discard level" << LL_ENDL;
}
U8* data = getData() + getMipOffset(discard);
S32 width = 0;
@@ -331,7 +331,7 @@ BOOL LLImageDXT::encodeDXT(const LLImageRaw* raw_image, F32 time, bool explicit_
format = FORMAT_RGBA8;
break;
default:
- llerrs << "LLImageDXT::encode: Unhandled channel number: " << ncomponents << llendl;
+ LL_ERRS() << "LLImageDXT::encode: Unhandled channel number: " << ncomponents << LL_ENDL;
return 0;
}
@@ -422,7 +422,7 @@ bool LLImageDXT::convertToDXR()
case FORMAT_DXT4: newformat = FORMAT_DXR4; break;
case FORMAT_DXT5: newformat = FORMAT_DXR5; break;
default:
- llwarns << "convertToDXR: can not convert format: " << llformat("0x%08x",getFourCC(mFileFormat)) << llendl;
+ LL_WARNS() << "convertToDXR: can not convert format: " << llformat("0x%08x",getFourCC(mFileFormat)) << LL_ENDL;
return false;
}
mFileFormat = newformat;
@@ -433,7 +433,7 @@ bool LLImageDXT::convertToDXR()
U8* newdata = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), total_bytes);
if (!newdata)
{
- llerrs << "Out of memory in LLImageDXT::convertToDXR()" << llendl;
+ LL_ERRS() << "Out of memory in LLImageDXT::convertToDXR()" << LL_ENDL;
return false;
}
llassert(total_bytes > 0);
@@ -466,7 +466,7 @@ S32 LLImageDXT::calcDataSize(S32 discard_level)
{
if (mFileFormat == FORMAT_UNKNOWN)
{
- llerrs << "calcDataSize called with unloaded LLImageDXT" << llendl;
+ LL_ERRS() << "calcDataSize called with unloaded LLImageDXT" << LL_ENDL;
return 0;
}
if (discard_level < 0)
diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp
index b70f84efc8..a25794dab4 100755
--- a/indra/llimage/llimagejpeg.cpp
+++ b/indra/llimage/llimagejpeg.cpp
@@ -374,7 +374,7 @@ boolean LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )
U8* new_buffer = new U8[ new_buffer_size ];
if (!new_buffer)
{
- llerrs << "Out of memory in LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )" << llendl;
+ LL_ERRS() << "Out of memory in LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )" << LL_ENDL;
return FALSE;
}
memcpy( new_buffer, self->mOutputBuffer, self->mOutputBufferSize ); /* Flawfinder: ignore */
@@ -465,7 +465,7 @@ void LLImageJPEG::errorOutputMessage( j_common_ptr cinfo )
LLImage::setLastError(error);
BOOL is_decode = (cinfo->is_decompressor != 0);
- llwarns << "LLImageJPEG " << (is_decode ? "decode " : "encode ") << " failed: " << buffer << llendl;
+ LL_WARNS() << "LLImageJPEG " << (is_decode ? "decode " : "encode ") << " failed: " << buffer << LL_ENDL;
}
BOOL LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time )
diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp
index 920ae2891f..4eb8dc7440 100755
--- a/indra/llimage/llimagetga.cpp
+++ b/indra/llimage/llimagetga.cpp
@@ -266,7 +266,7 @@ BOOL LLImageTGA::updateData()
mColorMap = new U8[ color_map_bytes ];
if (!mColorMap)
{
- llerrs << "Out of Memory in BOOL LLImageTGA::updateData()" << llendl;
+ LL_ERRS() << "Out of Memory in BOOL LLImageTGA::updateData()" << LL_ENDL;
return FALSE;
}
memcpy( mColorMap, getData() + mDataOffset, color_map_bytes ); /* Flawfinder: ignore */
@@ -1043,7 +1043,7 @@ BOOL LLImageTGA::decodeAndProcess( LLImageRaw* raw_image, F32 domain, F32 weight
// Only works for unflipped monochrome RLE images
if( (getComponents() != 1) || (mImageType != 11) || mOriginTopBit || mOriginRightBit )
{
- llerrs << "LLImageTGA trying to alpha-gradient process an image that's not a standard RLE, one component image" << llendl;
+ LL_ERRS() << "LLImageTGA trying to alpha-gradient process an image that's not a standard RLE, one component image" << LL_ENDL;
return FALSE;
}
@@ -1151,7 +1151,7 @@ bool LLImageTGA::loadFile( const std::string& path )
LLFILE* file = LLFile::fopen(path, "rb"); /* Flawfinder: ignore */
if( !file )
{
- llwarns << "Couldn't open file " << path << llendl;
+ LL_WARNS() << "Couldn't open file " << path << LL_ENDL;
return false;
}
@@ -1167,7 +1167,7 @@ bool LLImageTGA::loadFile( const std::string& path )
if( bytes_read != file_size )
{
deleteData();
- llwarns << "Couldn't read file " << path << llendl;
+ LL_WARNS() << "Couldn't read file " << path << LL_ENDL;
return false;
}
@@ -1175,7 +1175,7 @@ bool LLImageTGA::loadFile( const std::string& path )
if( !updateData() )
{
- llwarns << "Couldn't decode file " << path << llendl;
+ LL_WARNS() << "Couldn't decode file " << path << LL_ENDL;
deleteData();
return false;
}
diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp
index ad2eb0f69c..c8b0e872f6 100755
--- a/indra/llimage/llimageworker.cpp
+++ b/indra/llimage/llimageworker.cpp
@@ -60,7 +60,7 @@ S32 LLImageDecodeThread::update(F32 max_time_ms)
bool res = addRequest(req);
if (!res)
{
- llerrs << "request added after LLLFSThread::cleanupClass()" << llendl;
+ LL_ERRS() << "request added after LLLFSThread::cleanupClass()" << LL_ENDL;
}
}
mCreationList.clear();