From 4a5ad357930f0bede4d84b9810978e9d0c5d268b Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 20 Jul 2012 11:42:15 -0500 Subject: MAINT-570 Remove unused memory tracking system LLMemType --- indra/llimage/llimage.cpp | 85 +------------------------------------------- indra/llimage/llimage.h | 6 +--- indra/llimage/llimagej2c.cpp | 4 --- 3 files changed, 2 insertions(+), 93 deletions(-) (limited to 'indra/llimage') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 6775b005f4..eb9ff4d5a0 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -30,7 +30,6 @@ #include "llmath.h" #include "v4coloru.h" -#include "llmemtype.h" #include "llimagebmp.h" #include "llimagetga.h" @@ -96,8 +95,7 @@ LLImageBase::LLImageBase() mHeight(0), mComponents(0), mBadBufferAllocation(false), - mAllowOverSize(false), - mMemType(LLMemType::MTYPE_IMAGEBASE) + mAllowOverSize(false) { } @@ -167,8 +165,6 @@ void LLImageBase::deleteData() // virtual U8* LLImageBase::allocateData(S32 size) { - LLMemType mt1(mMemType); - if (size < 0) { size = mWidth * mHeight * mComponents; @@ -213,7 +209,6 @@ U8* LLImageBase::allocateData(S32 size) // virtual U8* LLImageBase::reallocateData(S32 size) { - LLMemType mt1(mMemType); U8 *new_datap = (U8*)ALLOCATE_MEM(sPrivatePoolp, size); if (!new_datap) { @@ -279,14 +274,12 @@ S32 LLImageRaw::sRawImageCount = 0; LLImageRaw::LLImageRaw() : LLImageBase() { - mMemType = LLMemType::MTYPE_IMAGERAW; ++sRawImageCount; } LLImageRaw::LLImageRaw(U16 width, U16 height, S8 components) : LLImageBase() { - mMemType = LLMemType::MTYPE_IMAGERAW; //llassert( S32(width) * S32(height) * S32(components) <= MAX_IMAGE_DATA_SIZE ); allocateDataSize(width, height, components); ++sRawImageCount; @@ -295,7 +288,6 @@ LLImageRaw::LLImageRaw(U16 width, U16 height, S8 components) LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components) : LLImageBase() { - mMemType = LLMemType::MTYPE_IMAGERAW; if(allocateDataSize(width, height, components)) { memcpy(getData(), data, width*height*components); @@ -370,29 +362,6 @@ BOOL LLImageRaw::resize(U16 width, U16 height, S8 components) return TRUE; } -#if 0 -U8 * LLImageRaw::getSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height) const -{ - LLMemType mt1(mMemType); - U8 *data = new U8[width*height*getComponents()]; - - // Should do some simple bounds checking - if (!data) - { - llerrs << "Out of memory in LLImageRaw::getSubImage" << llendl; - return NULL; - } - - U32 i; - for (i = y_pos; i < y_pos+height; i++) - { - memcpy(data + i*width*getComponents(), /* Flawfinder: ignore */ - getData() + ((y_pos + i)*getWidth() + x_pos)*getComponents(), getComponents()*width); - } - return data; -} -#endif - BOOL LLImageRaw::setSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height, const U8 *data, U32 stride, BOOL reverse_y) { @@ -457,7 +426,6 @@ void LLImageRaw::clear(U8 r, U8 g, U8 b, U8 a) // Reverses the order of the rows in the image void LLImageRaw::verticalFlip() { - LLMemType mt1(mMemType); S32 row_bytes = getWidth() * getComponents(); llassert(row_bytes > 0); std::vector line_buffer(row_bytes); @@ -590,7 +558,6 @@ 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) { - LLMemType mt1(mMemType); llinfos << "compositeScaled4onto3" << llendl; LLImageRaw* dst = this; // Just for clarity. @@ -832,7 +799,6 @@ void LLImageRaw::copyUnscaled3onto4( LLImageRaw* src ) // Src and dst can be any size. Src and dst have same number of components. void LLImageRaw::copyScaled( LLImageRaw* src ) { - LLMemType mt1(mMemType); LLImageRaw* dst = this; // Just for clarity. llassert_always( (1 == src->getComponents()) || (3 == src->getComponents()) || (4 == src->getComponents()) ); @@ -861,57 +827,9 @@ void LLImageRaw::copyScaled( LLImageRaw* src ) } } -#if 0 -//scale down image by not blending a pixel with its neighbors. -BOOL LLImageRaw::scaleDownWithoutBlending( S32 new_width, S32 new_height) -{ - LLMemType mt1(mMemType); - - S8 c = getComponents() ; - llassert((1 == c) || (3 == c) || (4 == c) ); - - S32 old_width = getWidth(); - S32 old_height = getHeight(); - - S32 new_data_size = old_width * new_height * c ; - llassert_always(new_data_size > 0); - - F32 ratio_x = (F32)old_width / new_width ; - F32 ratio_y = (F32)old_height / new_height ; - if( ratio_x < 1.0f || ratio_y < 1.0f ) - { - return TRUE; // Nothing to do. - } - ratio_x -= 1.0f ; - ratio_y -= 1.0f ; - - U8* new_data = allocateMemory(new_data_size) ; - llassert_always(new_data != NULL) ; - - U8* old_data = getData() ; - S32 i, j, k, s, t; - for(i = 0, s = 0, t = 0 ; i < new_height ; i++) - { - for(j = 0 ; j < new_width ; j++) - { - for(k = 0 ; k < c ; k++) - { - new_data[s++] = old_data[t++] ; - } - t += (S32)(ratio_x * c + 0.1f) ; - } - t += (S32)(ratio_y * old_width * c + 0.1f) ; - } - - setDataAndSize(new_data, new_width, new_height, c) ; - - return TRUE ; -} -#endif BOOL LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data ) { - LLMemType mt1(mMemType); llassert((1 == getComponents()) || (3 == getComponents()) || (4 == getComponents()) ); S32 old_width = getWidth(); @@ -1341,7 +1259,6 @@ LLImageFormatted::LLImageFormatted(S8 codec) mDiscardLevel(-1), mLevels(0) { - mMemType = LLMemType::MTYPE_IMAGEFORMATTED; } // virtual diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index 46e6d1a901..d4b2fc2589 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -30,7 +30,6 @@ #include "lluuid.h" #include "llstring.h" #include "llthread.h" -#include "llmemtype.h" const S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2 const S32 MAX_IMAGE_MIP = 11; // 2048x2048 @@ -176,8 +175,6 @@ private: bool mAllowOverSize ; static LLPrivateMemoryPool* sPrivatePoolp ; -public: - LLMemType::DeclareMemType& mMemType; // debug }; // Raw representation of an image (used for textures, and other uncompressed formats @@ -211,8 +208,7 @@ public: void contractToPowerOfTwo(S32 max_dim = MAX_IMAGE_SIZE, BOOL scale_image = TRUE); void biasedScaleToPowerOfTwo(S32 max_dim = MAX_IMAGE_SIZE); BOOL scale( S32 new_width, S32 new_height, BOOL scale_image = TRUE ); - //BOOL scaleDownWithoutBlending( S32 new_width, S32 new_height) ; - + // Fill the buffer with a constant color void fill( const LLColor4U& color ); diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index 452aad25cb..5412f98ee5 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -26,7 +26,6 @@ #include "lldir.h" #include "llimagej2c.h" -#include "llmemtype.h" #include "lltimer.h" #include "llmath.h" #include "llmemory.h" @@ -161,7 +160,6 @@ BOOL LLImageJ2C::decode(LLImageRaw *raw_imagep, F32 decode_time) BOOL LLImageJ2C::decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 first_channel, S32 max_channel_count ) { LLTimer elapsed; - LLMemType mt1(mMemType); BOOL res = TRUE; @@ -227,7 +225,6 @@ BOOL LLImageJ2C::encode(const LLImageRaw *raw_imagep, F32 encode_time) BOOL LLImageJ2C::encode(const LLImageRaw *raw_imagep, const char* comment_text, F32 encode_time) { LLTimer elapsed; - LLMemType mt1(mMemType); resetLastError(); BOOL res = mImpl->encodeImpl(*this, *raw_imagep, comment_text, encode_time, mReversible); if (!mLastError.empty()) @@ -404,7 +401,6 @@ BOOL LLImageJ2C::loadAndValidate(const std::string &filename) BOOL LLImageJ2C::validate(U8 *data, U32 file_size) { - LLMemType mt1(mMemType); resetLastError(); -- cgit v1.2.3 From bfd1c0370fe9f7a2372365f890bf88cf00c52f77 Mon Sep 17 00:00:00 2001 From: Kelly Washington Date: Fri, 20 Jul 2012 13:28:04 -0700 Subject: MAINT-570 Remove unused memory tracking system LLMemType follow up to fix test compiles. --- indra/llimage/tests/llimageworker_test.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/llimage') diff --git a/indra/llimage/tests/llimageworker_test.cpp b/indra/llimage/tests/llimageworker_test.cpp index 08476fb72c..e255d65b43 100644 --- a/indra/llimage/tests/llimageworker_test.cpp +++ b/indra/llimage/tests/llimageworker_test.cpp @@ -49,8 +49,7 @@ mWidth(0), mHeight(0), mComponents(0), mBadBufferAllocation(false), -mAllowOverSize(false), -mMemType(LLMemType::MTYPE_IMAGEBASE) +mAllowOverSize(false) { } LLImageBase::~LLImageBase() {} -- cgit v1.2.3 From 8ba2b388769e245ec1b49b7d6d4b0372d684ff86 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 13 Sep 2012 10:25:48 +0000 Subject: Fleshed out target_link_libraries dependencies between libraries. Appearance utility now reads avatar_lad.xml during stubbed out params processing. --- indra/llimage/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'indra/llimage') diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt index ea8c1a1107..706464a770 100644 --- a/indra/llimage/CMakeLists.txt +++ b/indra/llimage/CMakeLists.txt @@ -7,6 +7,8 @@ include(LLCommon) include(LLImage) include(LLMath) include(LLVFS) +include(LLKDU) +include(LLImageJ2COJ) include(ZLIB) include(LLAddBuildTest) include(Tut) @@ -56,8 +58,16 @@ list(APPEND llimage_SOURCE_FILES ${llimage_HEADER_FILES}) add_library (llimage ${llimage_SOURCE_FILES}) # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level +if (USE_KDU) + target_link_libraries(llimage ${LLKDU_LIBRARIES}) +else (USE_KDU) + target_link_libraries(llimage ${LLIMAGEJ2COJ_LIBRARIES}) +endif (USE_KDU) + target_link_libraries(llimage - llcommon + ${LLVFS_LIBRARIES} + ${LLMATH_LIBRARIES} + ${LLCOMMON_LIBRARIES} ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} -- cgit v1.2.3 From 8c0aa31536c447edb6ef4fbee43f99debf593a20 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 4 Oct 2012 00:42:31 +0000 Subject: Adding optimization to skip alpha image analysis when it isn't needed. --- indra/llimage/llimagetga.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/llimage') diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp index 58426d31fa..920ae2891f 100644 --- a/indra/llimage/llimagetga.cpp +++ b/indra/llimage/llimagetga.cpp @@ -132,12 +132,12 @@ BOOL LLImageTGA::updateData() ** FIELD 2 : COLOR MAP TYPE (1 BYTES) ** FIELD 3 : IMAGE TYPE CODE (1 BYTES) ** = 0 NO IMAGE DATA INCLUDED - ** = 1 UNCOMPRESSED, COLOR-MAPPED IMAGE - ** = 2 UNCOMPRESSED, TRUE-COLOR IMAGE - ** = 3 UNCOMPRESSED, BLACK AND WHITE IMAGE - ** = 9 RUN-LENGTH ENCODED COLOR-MAPPED IMAGE - ** = 10 RUN-LENGTH ENCODED TRUE-COLOR IMAGE - ** = 11 RUN-LENGTH ENCODED BLACK AND WHITE IMAGE + ** = (0001) 1 UNCOMPRESSED, COLOR-MAPPED IMAGE + ** = (0010) 2 UNCOMPRESSED, TRUE-COLOR IMAGE + ** = (0011) 3 UNCOMPRESSED, BLACK AND WHITE IMAGE + ** = (1001) 9 RUN-LENGTH ENCODED COLOR-MAPPED IMAGE + ** = (1010) 10 RUN-LENGTH ENCODED TRUE-COLOR IMAGE + ** = (1011) 11 RUN-LENGTH ENCODED BLACK AND WHITE IMAGE ** FIELD 4 : COLOR MAP SPECIFICATION (5 BYTES) ** 4.1 : COLOR MAP ORIGIN (2 BYTES) ** 4.2 : COLOR MAP LENGTH (2 BYTES) -- cgit v1.2.3 From a039b7c489885784fe779d05670825b316fa13d4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 11 Oct 2012 13:29:36 -0400 Subject: Fixes for build issues, missing LLCOMMON_SYSTEM_INCLUDE_DIRS in some libraries --- indra/llimage/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 indra/llimage/CMakeLists.txt (limited to 'indra/llimage') diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt old mode 100644 new mode 100755 index 706464a770..e837b0cac2 --- a/indra/llimage/CMakeLists.txt +++ b/indra/llimage/CMakeLists.txt @@ -15,6 +15,7 @@ include(Tut) include_directories( ${LLCOMMON_INCLUDE_DIRS} + ${LLCOMMON_SYSTEM_INCLUDE_DIRS} ${LLMATH_INCLUDE_DIRS} ${LLVFS_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS} -- cgit v1.2.3 From 802e738b77f09a67c893825dc8699f8273cebbee Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Tue, 18 Dec 2012 23:40:31 +0000 Subject: Fix for alpha blending using gl fixed-functions not matching shader implementation --- indra/llimage/llimage.cpp | 23 +++++++++++++++++++++++ indra/llimage/llimage.h | 5 +++++ 2 files changed, 28 insertions(+) (limited to 'indra/llimage') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 916c346b7a..79949df2d0 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -673,6 +673,29 @@ void LLImageRaw::compositeUnscaled4onto3( LLImageRaw* src ) } } +void LLImageRaw::copyUnscaledAlphaMask( LLImageRaw* src, const LLColor4U& fill) +{ + LLImageRaw* dst = this; // Just for clarity. + + llassert( 1 == src->getComponents() ); + llassert( 4 == dst->getComponents() ); + llassert( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) ); + + S32 pixels = getWidth() * getHeight(); + U8* src_data = src->getData(); + U8* dst_data = dst->getData(); + for ( S32 i = 0; i < pixels; i++ ) + { + dst_data[0] = fill.mV[0]; + dst_data[1] = fill.mV[1]; + dst_data[2] = fill.mV[2]; + dst_data[3] = src_data[0]; + src_data += 1; + dst_data += 4; + } +} + + // Fill the buffer with a constant color void LLImageRaw::fill( const LLColor4U& color ) { diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index 5f54585005..2d98f02aa6 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -230,6 +230,11 @@ public: // Src and dst are same size. Src has 3 components. Dst has 4 components. void copyUnscaled3onto4( LLImageRaw* src ); + // Src and dst are same size. Src has 1 component. Dst has 4 components. + // Alpha component is set to source alpha mask component. + // RGB components are set to fill color. + void copyUnscaledAlphaMask( LLImageRaw* src, const LLColor4U& fill); + // Src and dst can be any size. Src and dst have same number of components. void copyScaled( LLImageRaw* src ); -- cgit v1.2.3 From bf6182daa8b4d7cea79310547f71d7a3155e17b0 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Fri, 29 Mar 2013 07:50:08 -0700 Subject: Update Mac and Windows breakpad builds to latest --- indra/llimage/CMakeLists.txt | 0 indra/llimage/llimage.cpp | 0 indra/llimage/llimage.h | 0 indra/llimage/llimagebmp.cpp | 0 indra/llimage/llimagebmp.h | 0 indra/llimage/llimagedimensionsinfo.cpp | 0 indra/llimage/llimagedimensionsinfo.h | 0 indra/llimage/llimagedxt.cpp | 0 indra/llimage/llimagedxt.h | 0 indra/llimage/llimagej2c.cpp | 0 indra/llimage/llimagej2c.h | 0 indra/llimage/llimagejpeg.cpp | 0 indra/llimage/llimagejpeg.h | 0 indra/llimage/llimagepng.cpp | 0 indra/llimage/llimagepng.h | 0 indra/llimage/llimagetga.cpp | 0 indra/llimage/llimagetga.h | 0 indra/llimage/llimageworker.cpp | 0 indra/llimage/llimageworker.h | 0 indra/llimage/llmapimagetype.h | 0 indra/llimage/llpngwrapper.cpp | 0 indra/llimage/llpngwrapper.h | 0 indra/llimage/tests/llimageworker_test.cpp | 0 23 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 indra/llimage/CMakeLists.txt mode change 100644 => 100755 indra/llimage/llimage.cpp mode change 100644 => 100755 indra/llimage/llimage.h mode change 100644 => 100755 indra/llimage/llimagebmp.cpp mode change 100644 => 100755 indra/llimage/llimagebmp.h mode change 100644 => 100755 indra/llimage/llimagedimensionsinfo.cpp mode change 100644 => 100755 indra/llimage/llimagedimensionsinfo.h mode change 100644 => 100755 indra/llimage/llimagedxt.cpp mode change 100644 => 100755 indra/llimage/llimagedxt.h mode change 100644 => 100755 indra/llimage/llimagej2c.cpp mode change 100644 => 100755 indra/llimage/llimagej2c.h mode change 100644 => 100755 indra/llimage/llimagejpeg.cpp mode change 100644 => 100755 indra/llimage/llimagejpeg.h mode change 100644 => 100755 indra/llimage/llimagepng.cpp mode change 100644 => 100755 indra/llimage/llimagepng.h mode change 100644 => 100755 indra/llimage/llimagetga.cpp mode change 100644 => 100755 indra/llimage/llimagetga.h mode change 100644 => 100755 indra/llimage/llimageworker.cpp mode change 100644 => 100755 indra/llimage/llimageworker.h mode change 100644 => 100755 indra/llimage/llmapimagetype.h mode change 100644 => 100755 indra/llimage/llpngwrapper.cpp mode change 100644 => 100755 indra/llimage/llpngwrapper.h mode change 100644 => 100755 indra/llimage/tests/llimageworker_test.cpp (limited to 'indra/llimage') diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt old mode 100644 new mode 100755 diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp old mode 100644 new mode 100755 diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h old mode 100644 new mode 100755 diff --git a/indra/llimage/llimagebmp.cpp b/indra/llimage/llimagebmp.cpp old mode 100644 new mode 100755 diff --git a/indra/llimage/llimagebmp.h b/indra/llimage/llimagebmp.h old mode 100644 new mode 100755 diff --git a/indra/llimage/llimagedimensionsinfo.cpp b/indra/llimage/llimagedimensionsinfo.cpp old mode 100644 new mode 100755 diff --git a/indra/llimage/llimagedimensionsinfo.h b/indra/llimage/llimagedimensionsinfo.h old mode 100644 new mode 100755 diff --git a/indra/llimage/llimagedxt.cpp b/indra/llimage/llimagedxt.cpp old mode 100644 new mode 100755 diff --git a/indra/llimage/llimagedxt.h b/indra/llimage/llimagedxt.h old mode 100644 new mode 100755 diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp old mode 100644 new mode 100755 diff --git a/indra/llimage/llimagej2c.h b/indra/llimage/llimagej2c.h old mode 100644 new mode 100755 diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp old mode 100644 new mode 100755 diff --git a/indra/llimage/llimagejpeg.h b/indra/llimage/llimagejpeg.h old mode 100644 new mode 100755 diff --git a/indra/llimage/llimagepng.cpp b/indra/llimage/llimagepng.cpp old mode 100644 new mode 100755 diff --git a/indra/llimage/llimagepng.h b/indra/llimage/llimagepng.h old mode 100644 new mode 100755 diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp old mode 100644 new mode 100755 diff --git a/indra/llimage/llimagetga.h b/indra/llimage/llimagetga.h old mode 100644 new mode 100755 diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp old mode 100644 new mode 100755 diff --git a/indra/llimage/llimageworker.h b/indra/llimage/llimageworker.h old mode 100644 new mode 100755 diff --git a/indra/llimage/llmapimagetype.h b/indra/llimage/llmapimagetype.h old mode 100644 new mode 100755 diff --git a/indra/llimage/llpngwrapper.cpp b/indra/llimage/llpngwrapper.cpp old mode 100644 new mode 100755 diff --git a/indra/llimage/llpngwrapper.h b/indra/llimage/llpngwrapper.h old mode 100644 new mode 100755 diff --git a/indra/llimage/tests/llimageworker_test.cpp b/indra/llimage/tests/llimageworker_test.cpp old mode 100644 new mode 100755 -- cgit v1.2.3