diff options
Diffstat (limited to 'indra/llimage/llimageworker.cpp')
-rw-r--r-- | indra/llimage/llimageworker.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp index c1ee052997..dc99b34c57 100644 --- a/indra/llimage/llimageworker.cpp +++ b/indra/llimage/llimageworker.cpp @@ -35,7 +35,7 @@ class ImageRequest { public: ImageRequest(const LLPointer<LLImageFormatted>& image, - S32 discard, BOOL needs_aux, + S32 discard, bool needs_aux, const LLPointer<LLImageDecodeThread::Responder>& responder); virtual ~ImageRequest(); @@ -48,12 +48,12 @@ private: // input LLPointer<LLImageFormatted> mFormattedImage; S32 mDiscardLevel; - BOOL mNeedsAux; + bool mNeedsAux; // output LLPointer<LLImageRaw> mDecodedImageRaw; LLPointer<LLImageRaw> mDecodedImageAux; - BOOL mDecodedRaw; - BOOL mDecodedAux; + bool mDecodedRaw; + bool mDecodedAux; LLPointer<LLImageDecodeThread::Responder> mResponder; }; @@ -87,7 +87,7 @@ size_t LLImageDecodeThread::getPending() LLImageDecodeThread::handle_t LLImageDecodeThread::decodeImage( const LLPointer<LLImageFormatted>& image, S32 discard, - BOOL needs_aux, + bool needs_aux, const LLPointer<LLImageDecodeThread::Responder>& responder) { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; @@ -124,13 +124,13 @@ LLImageDecodeThread::Responder::~Responder() //---------------------------------------------------------------------------- ImageRequest::ImageRequest(const LLPointer<LLImageFormatted>& image, - S32 discard, BOOL needs_aux, + S32 discard, bool needs_aux, const LLPointer<LLImageDecodeThread::Responder>& responder) : mFormattedImage(image), mDiscardLevel(discard), mNeedsAux(needs_aux), - mDecodedRaw(FALSE), - mDecodedAux(FALSE), + mDecodedRaw(false), + mDecodedAux(false), mResponder(responder) { } @@ -149,9 +149,18 @@ ImageRequest::~ImageRequest() bool ImageRequest::processRequest() { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; + + if (mFormattedImage.isNull()) + return true; + const F32 decode_time_slice = 0.f; //disable time slicing bool done = true; - if (!mDecodedRaw && mFormattedImage.notNull()) + + LLImageDataLock lockFormatted(mFormattedImage); + LLImageDataLock lockDecodedRaw(mDecodedImageRaw); + LLImageDataLock lockDecodedAux(mDecodedImageAux); + + if (!mDecodedRaw) { // Decode primary channels if (mDecodedImageRaw.isNull()) @@ -177,7 +186,7 @@ bool ImageRequest::processRequest() // some decoders are removing data when task is complete and there were errors mDecodedRaw = done && mDecodedImageRaw->getData(); } - if (done && mNeedsAux && !mDecodedAux && mFormattedImage.notNull()) + if (done && mNeedsAux && !mDecodedAux) { // Decode aux channel if (!mDecodedImageAux) |