diff options
author | simon <none@none> | 2014-04-21 12:48:50 -0700 |
---|---|---|
committer | simon <none@none> | 2014-04-21 12:48:50 -0700 |
commit | a5a0a0b1362da5d00cc6d09bb841ef6167bb2922 (patch) | |
tree | 0b58bf76487dca0bc439d1f99cd568f970b9cc32 /indra/llimage | |
parent | 114084bb80d4991519e2ca4020823319810c64b2 (diff) | |
parent | 0b9a777bfd3c85390c55d91fc3dc5c4bee9bf71b (diff) |
Merge downstream code
Diffstat (limited to 'indra/llimage')
-rwxr-xr-x | indra/llimage/llimage.cpp | 28 | ||||
-rwxr-xr-x | indra/llimage/llimageworker.cpp | 16 | ||||
-rwxr-xr-x | indra/llimage/tests/llimageworker_test.cpp | 1 |
3 files changed, 8 insertions, 37 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 183620f9bc..c8a05e1fae 100755 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -230,7 +230,7 @@ const U8* LLImageBase::getData() const { if(mBadBufferAllocation) { - llwarns << "Bad memory allocation for the image buffer!" << llendl ; + llerrs << "Bad memory allocation for the image buffer!" << llendl ; } return mData; @@ -240,7 +240,7 @@ U8* LLImageBase::getData() { if(mBadBufferAllocation) { - llwarns << "Bad memory allocation for the image buffer!" << llendl ; + llerrs << "Bad memory allocation for the image buffer!" << llendl ; } return mData; @@ -293,7 +293,7 @@ LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components, bool no_c { setDataAndSize(data, width, height, components); } - else if(allocateDataSize(width, height, components) && getData()) + else if(allocateDataSize(width, height, components)) { memcpy(getData(), data, width*height*components); } @@ -431,11 +431,6 @@ void LLImageRaw::clear(U8 r, U8 g, U8 b, U8 a) // Reverses the order of the rows in the image void LLImageRaw::verticalFlip() { - if (!getData()) - { - return; - } - S32 row_bytes = getWidth() * getComponents(); llassert(row_bytes > 0); std::vector<U8> line_buffer(row_bytes); @@ -671,11 +666,6 @@ void LLImageRaw::copyUnscaledAlphaMask( LLImageRaw* src, const LLColor4U& fill) // Fill the buffer with a constant color void LLImageRaw::fill( const LLColor4U& color ) { - if (!getData()) - { - return; - } - S32 pixels = getWidth() * getHeight(); if( 4 == getComponents() ) { @@ -877,11 +867,6 @@ void LLImageRaw::copyScaled( LLImageRaw* src ) BOOL LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data ) { - if (!getData()) - { - return FALSE; - } - llassert((1 == getComponents()) || (3 == getComponents()) || (4 == getComponents()) ); S32 old_width = getWidth(); @@ -916,7 +901,7 @@ BOOL LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data ) copyLineScaled( &temp_buffer[0] + (getComponents() * old_width * row), new_buffer + (getComponents() * new_width * row), old_width, new_width, 1, 1 ); } } - else if (getData()) + else { // copy out existing image data S32 temp_data_size = old_width * old_height * getComponents(); @@ -1579,11 +1564,6 @@ BOOL LLImageFormatted::load(const std::string &filename, int load_size) BOOL LLImageFormatted::save(const std::string &filename) { - if (!getData()) - { - return FALSE; - } - resetLastError(); LLAPRFile outfile ; diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp index 148cf4fa55..ad2eb0f69c 100755 --- a/indra/llimage/llimageworker.cpp +++ b/indra/llimage/llimageworker.cpp @@ -142,12 +142,8 @@ bool LLImageDecodeThread::ImageRequest::processRequest() mFormattedImage->getHeight(), mFormattedImage->getComponents()); } - - if (mDecodedImageRaw->getData()) - { - done = mFormattedImage->decode(mDecodedImageRaw, decode_time_slice); // 1ms - mDecodedRaw = done; - } + done = mFormattedImage->decode(mDecodedImageRaw, decode_time_slice); // 1ms + mDecodedRaw = done; } if (done && mNeedsAux && !mDecodedAux && mFormattedImage.notNull()) { @@ -158,12 +154,8 @@ bool LLImageDecodeThread::ImageRequest::processRequest() mFormattedImage->getHeight(), 1); } - - if (mDecodedImageAux->getData()) - { - done = mFormattedImage->decodeChannels(mDecodedImageAux, decode_time_slice, 4, 4); // 1ms - mDecodedAux = done; - } + done = mFormattedImage->decodeChannels(mDecodedImageAux, decode_time_slice, 4, 4); // 1ms + mDecodedAux = done; } return done; diff --git a/indra/llimage/tests/llimageworker_test.cpp b/indra/llimage/tests/llimageworker_test.cpp index f6fb8f54b4..e255d65b43 100755 --- a/indra/llimage/tests/llimageworker_test.cpp +++ b/indra/llimage/tests/llimageworker_test.cpp @@ -58,7 +58,6 @@ void LLImageBase::sanityCheck() { } void LLImageBase::deleteData() { } U8* LLImageBase::allocateData(S32 size) { return NULL; } U8* LLImageBase::reallocateData(S32 size) { return NULL; } -U8* LLImageBase::getData() { return NULL; } LLImageRaw::LLImageRaw(U16 width, U16 height, S8 components) { } LLImageRaw::~LLImageRaw() { } |