Commit Graph

103 Commits (a831237e29c650146b6870b568feddcda310ab29)

Author SHA1 Message Date
Ansariel a831237e29 Merge branch 'DRTVWR-600-maint-A' of https://github.com/secondlife/viewer
# Conflicts:
#	indra/llimage/llimage.cpp
#	indra/llimage/llimage.h
#	indra/llkdu/llimagej2ckdu.cpp
#	indra/newview/app_settings/settings.xml
#	indra/newview/llfavoritesbar.cpp
#	indra/newview/llfloaterpreference.cpp
#	indra/newview/llfloaterpreference.h
#	scripts/messages/message_template.msg.sha1
2024-02-06 17:58:20 +01:00
Alexander Gavriliuk 74c8b028d4 SL-20743 Use LLMutex in LLImageBase for internal data thread-safety 2023-12-21 19:12:52 +01:00
Andrey Lihatskiy 3954e5d802 DRTVWR-600 macos buildfix 2023-12-15 10:18:32 +02:00
Alexander Gavriliuk 7f9438ed2b SL-3508 Crash in LLKDUDecodeState::processTileDecode 2023-12-15 07:45:05 +01:00
Ansariel c5d9c3c2a7 Merge branch 'DRTVWR-563' of https://bitbucket.org/lindenlab/viewer
# Conflicts:
#	indra/cmake/Tracy.cmake
#	indra/llcommon/llprofiler.h
#	indra/llcommon/llqueuedthread.cpp
#	indra/llimage/llimageworker.cpp
#	indra/llimagej2coj/llimagej2coj.cpp
#	indra/llkdu/llimagej2ckdu.cpp
#	indra/llrender/llimagegl.cpp
#	indra/llrender/llimagegl.h
#	indra/llwindow/llwindowwin32.cpp
#	indra/newview/app_settings/settings.xml
#	indra/newview/featuretable_mac.txt
#	indra/newview/llappviewer.cpp
#	indra/newview/llfloaterpreference.cpp
#	indra/newview/llmeshrepository.cpp
#	indra/newview/lltexturefetch.cpp
#	indra/newview/llviewercontrol.cpp
#	indra/newview/llviewertexture.cpp
#	indra/newview/llviewertexture.h
#	indra/newview/llviewertexturelist.cpp
#	indra/newview/llviewertexturelist.h
#	indra/newview/llviewerwindow.cpp
#	indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml
#	indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml
2022-06-03 15:07:06 +02:00
Dave Parks b6841d75c2 SL-17219 WIP - Texture pipeline overhaul 2022-04-15 19:02:07 -05:00
Ansariel 0a0e2fe93e Merge branch 'DRTVWR-546' of https://bitbucket.org/lindenlab/viewer 2022-01-15 02:39:07 +01:00
Beq 0911cae538 Initial merge of DRTVWR-541 into FS
Fixup a few niggly mistakes from the LL work
Add a couple of missing macros
replace all FS tracy macros with the corresponding LL ones.
2021-10-09 20:18:14 +01:00
Nicky b2569a06e6 Windows; Update KDU to 8.2 2021-08-23 17:55:59 +02:00
Beq 20cd749175 Instrument threaded texture decode
includes fix for timeout in slow decoded bakes
2021-05-28 02:22:53 +01:00
Nicky b25a3e5448 Correct KDU version check. 2021-03-28 14:09:39 +02:00
Ansariel 7e97addca3 Fix KDU image encoding for KDU >= 8.0.4 2020-07-28 18:35:38 +02:00
Nat Goodspeed d6baa7a853 DRTVWR-494: Put streaming operator<<() for kdu_dims in kdu_core.
It seems the lookup now requires that the operator<<() function be defined in
the same namespace as the argument.
2020-03-25 15:28:17 -04:00
Nicky Dasmijn a135b5b428 Merge remote-tracking branch 'origin/ll-vs2017' into fs-vs2017 2019-12-21 13:14:51 +01:00
Nicky 5469b246d2 Compile time compatibility for KDU 8 2019-12-09 22:06:14 +01:00
Nat Goodspeed 65e00abe6f DRTVWR-494: Put streaming operator<<() for kdu_dims in kdu_core.
It seems the lookup now requires that the operator<<() function be defined in
the same namespace as the argument.
2019-12-06 16:02:28 -05:00
Nicky 127809e241 Merge with viewer64. 2017-04-10 15:15:11 +02:00
Nat Goodspeed 1771857e6c Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2017-03-06 14:27:29 -05:00
Rider Linden 25cd2ed205 Merge 2017-01-25 11:13:59 -08:00
Nicky 2290d5ed16 Merge with viewer64, first pass. 2017-01-10 19:33:15 +01:00
Callum Prentice 7b2cf53f78 Pull in new version of KDU third party package that is build (correctly) as a static library vs. a stub library/DLL 2016-11-30 12:21:05 -08:00
Nat Goodspeed 0413e40d82 DRTVWR-418: Update KDU and llimagej2ckdu* with certain clang fixes. 2016-11-03 20:48:41 -04:00
Nat Goodspeed 6cc4a8dcd2 Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2016-11-03 09:31:15 -04:00
Nicky d7a0835432 Merge. 2016-09-26 21:12:34 +02:00
Rider Linden 8d86f5a0c4 Merge 2016-09-16 16:00:07 -07:00
Rider Linden 51236b7c9c Merge 2016-09-14 09:55:18 -07:00
Nat Goodspeed c7cb6636c4 MAINT-6584, MAINT-5011: Change new 'throw' to LLTHROW()
to be consistent with new exception conventions.
2016-09-07 10:57:07 -04:00
Nat Goodspeed dd1a0218b1 Automated merge with ssh://bitbucket.org/lindenlab/viewer-vlc 2016-09-07 10:46:28 -04:00
Ansariel c2b88ca860 Build fix for KDU 7.5+ 2016-08-29 21:30:03 +02:00
Ansariel 66aba60ce0 Build fix - now idea how this actually works at all for LL... 2016-08-29 13:01:43 +02:00
Ansariel 09b9913d35 Merge viewer-vob 2016-08-29 11:40:53 +02:00
Nat Goodspeed 0eac1f41f6 MAINT-5011: Catch kdu_exception (aka int) in case it leaks out.
KDU internally throws kdu_exception, which is a typedef for int. It's possible
that such an exception might leak out.

Our usual strategy for unknown exceptions is to catch (...) and let
boost::current_exception_diagnostic_information() handle them. However, for
int (or a class not derived from std::exception), that function will only
shrug and report no information available.

Besides, we want to format kdu_exception specially anyway. First, the KDU
#defines are in hex, so we should report the value in hex. But on inspection,
certain of those hex values are actually multibyte ASCII literals in disguise
-- so also report the byte string value.
2016-08-17 16:42:10 -04:00
Nat Goodspeed 83eb960063 MAINT-5011: Derive image-load exceptions from LLContinueError.
Failure to load an image shouldn't crash the whole viewer.
2016-08-17 15:47:08 -04:00
Nat Goodspeed 993f54f6e9 MAINT-5011: Try to enrich catch (...) logging throughout viewer.
Turns out we have a surprising number of catch (...) clauses in the viewer
code base. If all we currently do is

    LL_ERRS() << "unknown exception" << LL_ENDL;

then call CRASH_ON_UNHANDLED_EXCEPTION() instead. If what we do is

    LL_WARNS() << "unknown exception" << LL_ENDL;

then call LOG_UNHANDLED_EXCEPTION() instead.

Since many places need LOG_UNHANDLED_EXCEPTION() and nobody catches
LLContinueError yet, eliminate LLContinueError& parameter from
LOG_UNHANDLED_EXCEPTION(). This permits us to use the same log message as
CRASH_ON_UNHANDLED_EXCEPTION(), just with a different severity level.

Where a catch (...) clause actually provides contextual information, or makes
an error string, add boost::current_exception_diagnostic_information() to try
to figure out actual exception class and message.
2016-08-17 15:40:03 -04:00
Nat Goodspeed db4f13e7bc MAINT-5011: Clean up indentation from merge of viewer-release. 2016-08-17 11:48:33 -04:00
Nat Goodspeed e72bdc9bc5 Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2016-08-17 11:41:12 -04:00
Nat Goodspeed 5e9d2f57c8 MAINT-5011: Use LLTHROW() instead of plain BOOST_THROW_EXCEPTION().
A level of preprocessor indirection lets us later change the implementation if
desired.
2016-08-17 11:36:24 -04:00
Ansariel cb89140d29 Merge LL release 4.0.7 2016-08-11 23:42:52 +02:00
Nat Goodspeed 1773f44b6d MAINT-6584: Don't crash on inconsistent dims in a JPEG-2000 image.
Previous code would crump with LL_ERRS. But a bad image file should fail only
the image load -- not crash the viewer.

While at it, validate all components present, not just 0, 1, 2.

While at it, make the failure message report which component and what the
mismatched dimensions are, not just "Components don't have matching
dimensions!"
2016-08-06 11:39:11 -04:00
Nat Goodspeed 80adc9b6aa MAINT-6584: Introduce KDUError exception from other viewer project.
Specifically, manually apply changesets b4db8a8 and b98371d from
nat_linden/viewer-mac-mainloop. We need to throw from a new place, but if we
threw const char* (current convention), the new throw wouldn't be patched when
we merge to new exception convention.
2016-08-05 17:57:24 -04:00
Nat Goodspeed a5ce63eb3c MAINT-6584: Add explanatory comments to LLImageJ2CKDU implementation.
These comments are inherently fragile, in that they enumerate all present
callers of certain methods. Adding, removing or relocating calls would
invalidate these comments. However, the LLImageJ2CKDU implementation is
probably pretty stable by now.
2016-08-05 17:44:13 -04:00
Nat Goodspeed 65d608cdac MAINT-6584: Clarify LLKDUMessageError::flush() throwing exception. 2016-08-05 14:02:12 -04:00
Nat Goodspeed 2ce38c3c98 MAINT-6584: Comment out completely unused LLImageJ2CKDU code.
The only call to the findDiscardLevelsBoundaries() method was commented out
inside initDecode(), with a comment:
        // Merov : Test!! DO NOT COMMIT!!

This was the only caller of copy_tile(), which was the only caller of
copy_block(). Commented out all three of these (biggish!) functions, since I
have no idea what any of them were supposed to do or when it might be useful
to call them. In other words, I can't yet rule out the possibility that I
might have to uncomment them.
2016-08-04 16:20:39 -04:00
AndreyL ProductEngine 2339e759fc MAINT-4327/MAINT-6584 Supress the crash on memory allocation error when decoding J2C images 2016-07-27 05:49:07 +03:00
Nat Goodspeed 03bff896bd MAINT-6584: Use RAII classes to manage helper object lifespans.
Use boost::scoped_ptr instead of raw pointers to LLKDUMemSource,
LLKDUDecodeState, kdu_coords and kdu_dims so cleanup is simpler, and automated
on destruction of LLImageJ2CKDU.

Replace pointer to kdu_codestream with a custom RAII class. kdu_codestream is
itself an opaque handle, so we don't need to add another layer of indirection.
Just wrap it to ensure its destroy() method is reliably called when needed.

Make static instances of LLKDUMessageWarning and LLKDUMessageError
self-register, eliminating the companion static bool and explicit checks in
code.
2016-08-03 20:40:03 -04:00
Nat Goodspeed acdb050ce5 MAINT-6584: Convert LLImage class hierarchy to standard 'bool'
instead of legacy BOOL.
2016-07-22 11:35:23 -04:00
Nat Goodspeed ab07b1a461 MAINT-6584: Rationalize custom KDU error/warning message classes.
Derive them both from a common base class that does the message logging,
instead of having each handler class log redundantly -- especially since the
put_text() override accepting const kdu_uint16* was simply streaming the
kdu_uint16 pointer to the log file, which would log the hex value of the
pointer.

Although we want a static instance of each of these handler classes, pull it
out rather than nesting the instance within the class itself.
2016-07-22 10:32:53 -04:00
Nat Goodspeed 71b593e88b MAINT-6584: Streamline static LLImageJ2C implementation API.
Specifically, remove unused function pointer types CreateLLImageJ2CFunction,
DestroyLLImageJ2CFunction and EngineInfoLLImageJ2CFunction.

Also eliminate static fallbackDestroyLLImageJ2CImpl() and
fallbackEngineInfoLLImageJ2CImpl(), leaving only static
fallbackCreateLLImageJ2CImpl().

We do need a factory function to instantiate the appropriate LLImageJ2CImpl
subclass, so leave the fallbackCreateLLImageJ2CImpl() link seam in place.

However, given that every known LLImageJ2CImpl subclass is cheap to
instantiate, make getEngineInfo() a pure virtual method on that subclass: the
static LLImageJ2C::getEngineInfo() method can temporarily construct an
instance to query. While we're at it, make getEngineInfo() return std::string
like LLImageJ2C::getEngineInfo(). It's ridiculous that
fallbackEngineInfoLLImageJ2CImpl() implementations constructed a static
std::string and returned its c_str(), only to have LLImageJ2C::getEngineInfo()
construct ANOTHER std::string from the returned const char*.

fallbackDestroyLLImageJ2CImpl() never did anything useful: it merely deleted
the passed LLImageJ2CImpl subclass pointer as the specific subclass type. But
since LLImageJ2CImpl's destructor is virtual, LLImageJ2C's destructor could
simply delete the stored LLImageJ2CImpl*. In fact, make mImpl a
boost::scoped_ptr<LLImageJ2CImpl> so we don't even have to delete it manually.
2016-07-21 16:49:02 -04:00
Nat Goodspeed f09a92f1f3 DRTVWR-427: Remove engineInfoLLImageJ2CKDU(), createLLImageJ2CKDU(),
destroyLLImageJ2CKDU().

These were apparently intended as simple C-style DLL entry points. But as
nobody calls them, and as we decided against building the viewer from DLLs,
they only clutter the code.
2016-07-21 14:29:29 -04:00
Nat Goodspeed 9c49a6c91d MAINT-5011: Introduce LLException base class for viewer exceptions.
This also introduces LLContinueError for exceptions which should interrupt
some part of viewer processing (e.g. the current coroutine) but should attempt
to let the viewer session proceed.

Derive all existing viewer exception classes from LLException rather than from
std::runtime_error or std::logic_error.

Use BOOST_THROW_EXCEPTION() rather than plain 'throw' to enrich the thrown
exception with source file, line number and containing function.
2016-07-19 16:25:25 -04:00