X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Ftexture-manager-impl.cpp;h=71385e2c59cc0cf318851de9e8531c6d94e876a1;hp=3a32ddc416cf6acab855ccc066e8ae3f2c9610aa;hb=0f3af5aa90602ae60079d11615d8de0765084afe;hpb=6e1032b5996011523338aa4bc5cdbeffcfc71ad5 diff --git a/dali-toolkit/internal/visuals/texture-manager-impl.cpp b/dali-toolkit/internal/visuals/texture-manager-impl.cpp index 3a32ddc..71385e2 100644 --- a/dali-toolkit/internal/visuals/texture-manager-impl.cpp +++ b/dali-toolkit/internal/visuals/texture-manager-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,6 +85,8 @@ Debug::Filter* gTextureManagerLogFilter = Debug::Filter::New( Debug::NoLogging, loadState == TextureManager::LOADING ? "LOADING" : \ loadState == TextureManager::LOAD_FINISHED ? "LOAD_FINISHED" : \ loadState == TextureManager::WAITING_FOR_MASK ? "WAITING_FOR_MASK" : \ + loadState == TextureManager::MASK_APPLYING ? "MASK_APPLYING" : \ + loadState == TextureManager::MASK_APPLIED ? "MASK_APPLIED" : \ loadState == TextureManager::UPLOADED ? "UPLOADED" : \ loadState == TextureManager::CANCELLED ? "CANCELLED" : \ loadState == TextureManager::LOAD_FAILED ? "LOAD_FAILED" : "Unknown" @@ -142,9 +144,35 @@ TextureManager::~TextureManager() } } +Devel::PixelBuffer TextureManager::LoadPixelBuffer( + const VisualUrl& url, Dali::ImageDimensions desiredSize, Dali::FittingMode::Type fittingMode, Dali::SamplingMode::Type samplingMode, bool synchronousLoading, TextureUploadObserver* textureObserver, bool orientationCorrection, TextureManager::MultiplyOnLoad& preMultiplyOnLoad ) +{ + Devel::PixelBuffer pixelBuffer; + if( synchronousLoading ) + { + if( url.IsValid() ) + { + pixelBuffer = LoadImageFromFile( url.GetUrl(), desiredSize, fittingMode, samplingMode, + orientationCorrection ); + if( pixelBuffer && preMultiplyOnLoad == TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD ) + { + PreMultiply( pixelBuffer, preMultiplyOnLoad ); + } + } + } + else + { + RequestLoadInternal( url, INVALID_TEXTURE_ID, 1.0f, desiredSize, fittingMode, samplingMode, TextureManager::NO_ATLAS, + false, KEEP_PIXEL_BUFFER, textureObserver, orientationCorrection, TextureManager::ReloadPolicy::FORCED, + preMultiplyOnLoad, true ); + } + + return pixelBuffer; +} + TextureSet TextureManager::LoadTexture( const VisualUrl& url, Dali::ImageDimensions desiredSize, Dali::FittingMode::Type fittingMode, - Dali::SamplingMode::Type samplingMode, const MaskingDataPointer& maskInfo, + Dali::SamplingMode::Type samplingMode, MaskingDataPointer& maskInfo, bool synchronousLoading, TextureManager::TextureId& textureId, Vector4& textureRect, Dali::ImageDimensions& textureRectSize, bool& atlasingStatus, bool& loadingStatus, Dali::WrapMode::Type wrapModeU, Dali::WrapMode::Type wrapModeV, TextureUploadObserver* textureObserver, @@ -180,6 +208,15 @@ TextureSet TextureManager::LoadTexture( { Devel::PixelBuffer pixelBuffer = LoadImageFromFile( url.GetUrl(), desiredSize, fittingMode, samplingMode, orientationCorrection ); + if( maskInfo ) + { + Devel::PixelBuffer maskPixelBuffer = LoadImageFromFile( maskInfo->mAlphaMaskUrl.GetUrl(), ImageDimensions(), + FittingMode::SCALE_TO_FILL, SamplingMode::NO_FILTER, true ); + if( maskPixelBuffer ) + { + pixelBuffer.ApplyMask( maskPixelBuffer, maskInfo->mContentScaleFactor, maskInfo->mCropToMask ); + } + } if( pixelBuffer ) { PreMultiply( pixelBuffer, preMultiplyOnLoad ); @@ -241,6 +278,7 @@ TextureSet TextureManager::LoadTexture( } else { + maskInfo->mAlphaMaskId = RequestMaskLoad( maskInfo->mAlphaMaskUrl ); textureId = RequestLoad( url, maskInfo->mAlphaMaskId, maskInfo->mContentScaleFactor, @@ -263,6 +301,9 @@ TextureSet TextureManager::LoadTexture( // If we are loading the texture, or waiting for the ready signal handler to complete, inform // caller that they need to wait. loadingStatus = ( loadState == TextureManager::LOADING || + loadState == TextureManager::WAITING_FOR_MASK || + loadState == TextureManager::MASK_APPLYING || + loadState == TextureManager::MASK_APPLIED || loadState == TextureManager::NOT_STARTED || mQueueLoadFlag ); @@ -296,7 +337,7 @@ TextureManager::TextureId TextureManager::RequestLoad( { return RequestLoadInternal( url, INVALID_TEXTURE_ID, 1.0f, desiredSize, fittingMode, samplingMode, useAtlas, false, UPLOAD_TO_TEXTURE, observer, orientationCorrection, reloadPolicy, - preMultiplyOnLoad ); + preMultiplyOnLoad, false ); } TextureManager::TextureId TextureManager::RequestLoad( @@ -315,7 +356,7 @@ TextureManager::TextureId TextureManager::RequestLoad( { return RequestLoadInternal( url, maskTextureId, contentScale, desiredSize, fittingMode, samplingMode, useAtlas, cropToMask, UPLOAD_TO_TEXTURE, observer, orientationCorrection, reloadPolicy, - preMultiplyOnLoad ); + preMultiplyOnLoad, false ); } TextureManager::TextureId TextureManager::RequestMaskLoad( const VisualUrl& maskUrl ) @@ -324,7 +365,7 @@ TextureManager::TextureId TextureManager::RequestMaskLoad( const VisualUrl& mask auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY; return RequestLoadInternal( maskUrl, INVALID_TEXTURE_ID, 1.0f, ImageDimensions(), FittingMode::SCALE_TO_FILL, SamplingMode::NO_FILTER, NO_ATLAS, false, KEEP_PIXEL_BUFFER, NULL, true, - TextureManager::ReloadPolicy::CACHED, preMultiply ); + TextureManager::ReloadPolicy::CACHED, preMultiply, false ); } TextureManager::TextureId TextureManager::RequestLoadInternal( @@ -340,7 +381,8 @@ TextureManager::TextureId TextureManager::RequestLoadInternal( TextureUploadObserver* observer, bool orientationCorrection, TextureManager::ReloadPolicy reloadPolicy, - TextureManager::MultiplyOnLoad& preMultiplyOnLoad) + TextureManager::MultiplyOnLoad& preMultiplyOnLoad, + bool loadPixelBuffer ) { // First check if the requested Texture is cached. const TextureHash textureHash = GenerateHash( url.GetUrl(), desiredSize, fittingMode, samplingMode, useAtlas, @@ -362,6 +404,10 @@ TextureManager::TextureId TextureManager::RequestLoadInternal( ++( mTextureInfoContainer[ cacheIndex ].referenceCount ); } textureId = mTextureInfoContainer[ cacheIndex ].textureId; + + // Update preMultiplyOnLoad value. It should be changed according to preMultiplied value of the cached info. + preMultiplyOnLoad = mTextureInfoContainer[ cacheIndex ].preMultiplied ? TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD : TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY; + DALI_LOG_INFO( gTextureManagerLogFilter, Debug::General, "TextureManager::RequestLoad( url=%s observer=%p ) Using cached texture id@%d, textureId=%d\n", url.GetUrl().c_str(), observer, cacheIndex, textureId ); } @@ -374,7 +420,7 @@ TextureManager::TextureId TextureManager::RequestLoadInternal( mTextureInfoContainer.push_back( TextureInfo( textureId, maskTextureId, url.GetUrl(), desiredSize, contentScale, fittingMode, samplingMode, false, cropToMask, useAtlas, textureHash, orientationCorrection, - preMultiply ) ); + preMultiply, loadPixelBuffer ) ); cacheIndex = mTextureInfoContainer.size() - 1u; DALI_LOG_INFO( gTextureManagerLogFilter, Debug::General, "TextureManager::RequestLoad( url=%s observer=%p ) New texture, cacheIndex:%d, textureId=%d\n", @@ -393,7 +439,11 @@ TextureManager::TextureId TextureManager::RequestLoadInternal( GET_LOAD_STATE_STRING(textureInfo.loadState ) ); // Force reloading of texture by setting loadState unless already loading or cancelled. - if ( TextureManager::ReloadPolicy::FORCED == reloadPolicy && TextureManager::LOADING != textureInfo.loadState && + if ( TextureManager::ReloadPolicy::FORCED == reloadPolicy && + TextureManager::LOADING != textureInfo.loadState && + TextureManager::WAITING_FOR_MASK != textureInfo.loadState && + TextureManager::MASK_APPLYING != textureInfo.loadState && + TextureManager::MASK_APPLIED != textureInfo.loadState && TextureManager::CANCELLED != textureInfo.loadState ) { DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Verbose, "TextureManager::RequestLoad( url=%s observer=%p ) ForcedReload cacheIndex:%d, textureId=%d\n", @@ -412,6 +462,9 @@ TextureManager::TextureId TextureManager::RequestLoadInternal( break; } case TextureManager::LOADING: + case TextureManager::WAITING_FOR_MASK: + case TextureManager::MASK_APPLYING: + case TextureManager::MASK_APPLIED: { ObserveTexture( textureInfo, observer ); break; @@ -433,8 +486,11 @@ TextureManager::TextureId TextureManager::RequestLoadInternal( break; } case TextureManager::LOAD_FINISHED: - case TextureManager::WAITING_FOR_MASK: - // Loading has already completed. Do nothing. + // Loading has already completed. + if( observer && textureInfo.loadPixelBuffer ) + { + LoadOrQueueTexture( textureInfo, observer ); + } break; } @@ -442,7 +498,7 @@ TextureManager::TextureId TextureManager::RequestLoadInternal( return textureId; } -void TextureManager::Remove( const TextureManager::TextureId textureId ) +void TextureManager::Remove( const TextureManager::TextureId textureId, TextureUploadObserver* observer ) { int textureInfoIndex = GetCacheIndexFromId( textureId ); if( textureInfoIndex != INVALID_INDEX ) @@ -450,9 +506,9 @@ void TextureManager::Remove( const TextureManager::TextureId textureId ) TextureInfo& textureInfo( mTextureInfoContainer[ textureInfoIndex ] ); DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, - "TextureManager::Remove(%d) url:%s\n cacheIdx:%d loadState:%s\n", + "TextureManager::Remove(%d) url:%s\n cacheIdx:%d loadState:%s reference count = %d\n", textureId, textureInfo.url.GetUrl().c_str(), - textureInfoIndex, GET_LOAD_STATE_STRING( textureInfo.loadState ) ); + textureInfoIndex, GET_LOAD_STATE_STRING( textureInfo.loadState ), textureInfo.referenceCount ); // Decrement the reference count and check if this is the last user of this Texture. if( --textureInfo.referenceCount <= 0 ) @@ -489,6 +545,19 @@ void TextureManager::Remove( const TextureManager::TextureId textureId ) mTextureInfoContainer.erase( mTextureInfoContainer.begin() + textureInfoIndex ); } } + + if( observer ) + { + // Remove element from the LoadQueue + for( auto&& element : mLoadQueue ) + { + if( element.mObserver == observer ) + { + mLoadQueue.Erase( &element ); + break; + } + } + } } } @@ -648,7 +717,6 @@ void TextureManager::LoadOrQueueTexture( TextureInfo& textureInfo, TextureUpload } break; } - case LOADING: case UPLOADED: { if( mQueueLoadFlag ) @@ -665,9 +733,12 @@ void TextureManager::LoadOrQueueTexture( TextureInfo& textureInfo, TextureUpload } break; } + case LOADING: case CANCELLED: case LOAD_FINISHED: case WAITING_FOR_MASK: + case MASK_APPLYING: + case MASK_APPLIED: { break; } @@ -690,10 +761,13 @@ void TextureManager::LoadTexture( TextureInfo& textureInfo, TextureUploadObserve { auto& loadersContainer = textureInfo.url.IsLocalResource() ? mAsyncLocalLoaders : mAsyncRemoteLoaders; auto loadingHelperIt = loadersContainer.GetNext(); + auto premultiplyOnLoad = ( textureInfo.preMultiplyOnLoad && textureInfo.maskTextureId == INVALID_TEXTURE_ID ) ? + DevelAsyncImageLoader::PreMultiplyOnLoad::ON : DevelAsyncImageLoader::PreMultiplyOnLoad::OFF; DALI_ASSERT_ALWAYS(loadingHelperIt != loadersContainer.End()); loadingHelperIt->Load(textureInfo.textureId, textureInfo.url, textureInfo.desiredSize, textureInfo.fittingMode, - textureInfo.samplingMode, textureInfo.orientationCorrection ); + textureInfo.samplingMode, textureInfo.orientationCorrection, + premultiplyOnLoad ); } ObserveTexture( textureInfo, observer ); } @@ -712,6 +786,10 @@ void TextureManager::ProcessQueuedTextures() textureInfo.useAtlas, textureInfo.atlasRect, textureInfo.preMultiplied ); } + else if ( textureInfo.loadState == LOAD_FINISHED && textureInfo.loadPixelBuffer ) + { + element.mObserver->LoadComplete( true, textureInfo.pixelBuffer, textureInfo.url, textureInfo.preMultiplied ); + } else { LoadTexture( textureInfo, element.mObserver ); @@ -761,7 +839,7 @@ void TextureManager::AsyncLoadComplete( AsyncLoadingInfoContainerType& loadingCo } else { - Remove( textureInfo.textureId ); + Remove( textureInfo.textureId, nullptr ); } } } @@ -777,6 +855,7 @@ void TextureManager::PostLoad( TextureInfo& textureInfo, Devel::PixelBuffer& pix { // No atlas support for now textureInfo.useAtlas = NO_ATLAS; + textureInfo.preMultiplied = pixelBuffer.IsAlphaPreMultiplied(); if( textureInfo.storageType == UPLOAD_TO_TEXTURE ) { @@ -785,18 +864,26 @@ void TextureManager::PostLoad( TextureInfo& textureInfo, Devel::PixelBuffer& pix // wait for the mask to finish loading. if( textureInfo.maskTextureId != INVALID_TEXTURE_ID ) { - LoadState maskLoadState = GetTextureStateInternal( textureInfo.maskTextureId ); - if( maskLoadState == LOADING ) - { - textureInfo.pixelBuffer = pixelBuffer; // Store the pixel buffer temporarily - textureInfo.loadState = WAITING_FOR_MASK; - } - else if( maskLoadState == LOAD_FINISHED ) + if( textureInfo.loadState == MASK_APPLYING ) { - ApplyMask( pixelBuffer, textureInfo.maskTextureId, textureInfo.scaleFactor, textureInfo.cropToMask ); + textureInfo.loadState = MASK_APPLIED; UploadTexture( pixelBuffer, textureInfo ); NotifyObservers( textureInfo, true ); } + else + { + LoadState maskLoadState = GetTextureStateInternal( textureInfo.maskTextureId ); + textureInfo.pixelBuffer = pixelBuffer; // Store the pixel buffer temporarily + if( maskLoadState == LOADING ) + { + textureInfo.loadState = WAITING_FOR_MASK; + } + else if( maskLoadState == LOAD_FINISHED ) + { + // Send New Task to Thread + ApplyMask( textureInfo, textureInfo.maskTextureId ); + } + } } else { @@ -809,6 +896,10 @@ void TextureManager::PostLoad( TextureInfo& textureInfo, Devel::PixelBuffer& pix textureInfo.pixelBuffer = pixelBuffer; // Store the pixel data textureInfo.loadState = LOAD_FINISHED; + if( textureInfo.loadPixelBuffer ) + { + NotifyObservers( textureInfo, true ); + } // Check if there was another texture waiting for this load to complete // (e.g. if this was an image mask, and its load is on a different thread) CheckForWaitingTexture( textureInfo ); @@ -816,7 +907,6 @@ void TextureManager::PostLoad( TextureInfo& textureInfo, Devel::PixelBuffer& pix } else { - DALI_LOG_ERROR( "TextureManager::AsyncImageLoad(%s) failed\n", textureInfo.url.GetUrl().c_str() ); // @todo If the load was unsuccessful, upload the broken image. textureInfo.loadState = LOAD_FAILED; CheckForWaitingTexture( textureInfo ); @@ -836,18 +926,15 @@ void TextureManager::CheckForWaitingTexture( TextureInfo& maskTextureInfo ) mTextureInfoContainer[cacheIndex].loadState == WAITING_FOR_MASK ) { TextureInfo& textureInfo( mTextureInfoContainer[cacheIndex] ); - Devel::PixelBuffer pixelBuffer = textureInfo.pixelBuffer; - textureInfo.pixelBuffer.Reset(); if( maskTextureInfo.loadState == LOAD_FINISHED ) { - ApplyMask( pixelBuffer, maskTextureInfo.textureId, textureInfo.scaleFactor, textureInfo.cropToMask ); - UploadTexture( pixelBuffer, textureInfo ); - NotifyObservers( textureInfo, true ); + // Send New Task to Thread + ApplyMask( textureInfo, maskTextureInfo.textureId ); } else { - DALI_LOG_ERROR( "TextureManager::ApplyMask to %s failed\n", textureInfo.url.GetUrl().c_str() ); + textureInfo.pixelBuffer.Reset(); textureInfo.loadState = LOAD_FAILED; NotifyObservers( textureInfo, false ); } @@ -855,15 +942,24 @@ void TextureManager::CheckForWaitingTexture( TextureInfo& maskTextureInfo ) } } -void TextureManager::ApplyMask( - Devel::PixelBuffer& pixelBuffer, TextureId maskTextureId, - float contentScale, bool cropToMask ) +void TextureManager::ApplyMask( TextureInfo& textureInfo, TextureId maskTextureId ) { int maskCacheIndex = GetCacheIndexFromId( maskTextureId ); if( maskCacheIndex != INVALID_CACHE_INDEX ) { Devel::PixelBuffer maskPixelBuffer = mTextureInfoContainer[maskCacheIndex].pixelBuffer; - pixelBuffer.ApplyMask( maskPixelBuffer, contentScale, cropToMask ); + Devel::PixelBuffer pixelBuffer = textureInfo.pixelBuffer; + textureInfo.pixelBuffer.Reset(); + + DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::ApplyMask(): url:%s sync:%s\n", + textureInfo.url.GetUrl().c_str(), textureInfo.loadSynchronously?"T":"F" ); + + textureInfo.loadState = MASK_APPLYING; + auto& loadersContainer = textureInfo.url.IsLocalResource() ? mAsyncLocalLoaders : mAsyncRemoteLoaders; + auto loadingHelperIt = loadersContainer.GetNext(); + auto premultiplyOnLoad = textureInfo.preMultiplyOnLoad ? DevelAsyncImageLoader::PreMultiplyOnLoad::ON : DevelAsyncImageLoader::PreMultiplyOnLoad::OFF; + DALI_ASSERT_ALWAYS(loadingHelperIt != loadersContainer.End()); + loadingHelperIt->ApplyMask( textureInfo.textureId, pixelBuffer, maskPixelBuffer, textureInfo.scaleFactor, textureInfo.cropToMask, premultiplyOnLoad ); } } @@ -873,13 +969,8 @@ void TextureManager::UploadTexture( Devel::PixelBuffer& pixelBuffer, TextureInfo { DALI_LOG_INFO( gTextureManagerLogFilter, Debug::General, " TextureManager::UploadTexture() New Texture for textureId:%d\n", textureInfo.textureId ); - // If the texture doesn't have an alpha channel, can't pre-multiply it. - // Ensure that we don't change the load parameter (it's used for hashing), and instead set - // the status for use in the observer. - auto preMultiply = textureInfo.preMultiplyOnLoad ? TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD : - TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY; - PreMultiply( pixelBuffer, preMultiply ); - textureInfo.preMultiplied = (preMultiply == TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD ); + // Check if this pixelBuffer is premultiplied + textureInfo.preMultiplied = pixelBuffer.IsAlphaPreMultiplied(); Texture texture = Texture::New( Dali::TextureType::TEXTURE_2D, pixelBuffer.GetPixelFormat(), pixelBuffer.GetWidth(), pixelBuffer.GetHeight() ); @@ -925,10 +1016,22 @@ void TextureManager::NotifyObservers( TextureInfo& textureInfo, bool success ) DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "NotifyObservers() url:%s loadState:%s\n", textureInfo.url.GetUrl().c_str(), GET_LOAD_STATE_STRING(textureInfo.loadState ) ); - observer->UploadComplete( success, info->textureId, info->textureSet, info->useAtlas, info->atlasRect, - info->preMultiplied ); + // It is possible for the observer to be deleted. + // Disconnect and remove the observer first. observer->DestructionSignal().Disconnect( this, &TextureManager::ObserverDestroyed ); + info->observerList.Erase( info->observerList.begin() ); + + if( info->loadPixelBuffer ) + { + observer->LoadComplete( success, info->pixelBuffer, info->url, info->preMultiplied ); + } + else + { + observer->UploadComplete( success, info->textureId, info->textureSet, info->useAtlas, info->atlasRect, + info->preMultiplied ); + } + // Get the textureInfo from the container again as it may have been invalidated. int textureInfoIndex = GetCacheIndexFromId( textureId ); if( textureInfoIndex == INVALID_CACHE_INDEX) @@ -936,20 +1039,15 @@ void TextureManager::NotifyObservers( TextureInfo& textureInfo, bool success ) break; // texture has been removed - can stop. } info = &mTextureInfoContainer[ textureInfoIndex ]; - - // remove the observer that was just triggered if it's still in the list - for( TextureInfo::ObserverListType::Iterator j = info->observerList.Begin(); j != info->observerList.End(); ++j ) - { - if( *j == observer ) - { - info->observerList.Erase( j ); - break; - } - } } mQueueLoadFlag = false; ProcessQueuedTextures(); + + if( info->loadPixelBuffer && info->observerList.Count() == 0 ) + { + Remove( info->textureId, nullptr ); + } } TextureManager::TextureId TextureManager::GenerateUniqueTextureId() @@ -1120,10 +1218,23 @@ void TextureManager::AsyncLoadingHelper::Load(TextureId textureId, ImageDimensions desiredSize, FittingMode::Type fittingMode, SamplingMode::Type samplingMode, - bool orientationCorrection) + bool orientationCorrection, + DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad) +{ + mLoadingInfoContainer.push_back(AsyncLoadingInfo(textureId)); + auto id = DevelAsyncImageLoader::Load( mLoader, url.GetUrl(), desiredSize, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad ); + mLoadingInfoContainer.back().loadId = id; +} + +void TextureManager::AsyncLoadingHelper::ApplyMask( TextureId textureId, + Devel::PixelBuffer pixelBuffer, + Devel::PixelBuffer maskPixelBuffer, + float contentScale, + bool cropToMask, + DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad ) { mLoadingInfoContainer.push_back(AsyncLoadingInfo(textureId)); - auto id = mLoader.Load(url.GetUrl(), desiredSize, fittingMode, samplingMode, orientationCorrection); + auto id = DevelAsyncImageLoader::ApplyMask( mLoader, pixelBuffer, maskPixelBuffer, contentScale, cropToMask, preMultiplyOnLoad ); mLoadingInfoContainer.back().loadId = id; } @@ -1145,9 +1256,9 @@ TextureManager::AsyncLoadingHelper::AsyncLoadingHelper( } void TextureManager::AsyncLoadingHelper::AsyncLoadComplete(uint32_t id, - Devel::PixelBuffer pixelBuffer) + Devel::PixelBuffer pixelBuffer ) { - mTextureManager.AsyncLoadComplete(mLoadingInfoContainer, id, pixelBuffer); + mTextureManager.AsyncLoadComplete( mLoadingInfoContainer, id, pixelBuffer ); } void TextureManager::SetBrokenImageUrl(const std::string& brokenImageUrl)