projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move MultiplyColorByAlpha() from main thread to resource thread
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
image-loader
/
image-load-thread.cpp
diff --git
a/dali-toolkit/internal/image-loader/image-load-thread.cpp
b/dali-toolkit/internal/image-loader/image-load-thread.cpp
index
7e0a181
..
320911d
100644
(file)
--- a/
dali-toolkit/internal/image-loader/image-load-thread.cpp
+++ b/
dali-toolkit/internal/image-loader/image-load-thread.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 201
5
Samsung Electronics Co., Ltd.
+ * Copyright (c) 201
7
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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-20,6
+20,8
@@
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/image-loading.h>
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/image-loading.h>
+#include <dali/integration-api/adaptors/adaptor.h>
+#include <dali/devel-api/adaptor-framework/thread-settings.h>
namespace Dali
{
namespace Dali
{
@@
-31,14
+33,15
@@
namespace Internal
{
LoadingTask::LoadingTask( uint32_t id, const VisualUrl& url, ImageDimensions dimensions,
{
LoadingTask::LoadingTask( uint32_t id, const VisualUrl& url, ImageDimensions dimensions,
- FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection )
+ FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection
, DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad
)
: pixelBuffer(),
url( url ),
id( id ),
dimensions( dimensions ),
fittingMode( fittingMode ),
samplingMode( samplingMode ),
: pixelBuffer(),
url( url ),
id( id ),
dimensions( dimensions ),
fittingMode( fittingMode ),
samplingMode( samplingMode ),
- orientationCorrection( orientationCorrection )
+ orientationCorrection( orientationCorrection ),
+ preMultiplyOnLoad( preMultiplyOnLoad )
{
}
{
}
@@
-52,11
+55,20
@@
void LoadingTask::Load()
{
pixelBuffer = Dali::DownloadImageSynchronously ( url.GetUrl(), dimensions, fittingMode, samplingMode, orientationCorrection );
}
{
pixelBuffer = Dali::DownloadImageSynchronously ( url.GetUrl(), dimensions, fittingMode, samplingMode, orientationCorrection );
}
+
+ if( pixelBuffer && Pixel::HasAlpha( pixelBuffer.GetPixelFormat() ) )
+ {
+ if( preMultiplyOnLoad == DevelAsyncImageLoader::PreMultiplyOnLoad::ON )
+ {
+ pixelBuffer.MultiplyColorByAlpha();
+ }
+ }
}
ImageLoadThread::ImageLoadThread( EventThreadCallback* trigger )
}
ImageLoadThread::ImageLoadThread( EventThreadCallback* trigger )
-: mTrigger( trigger )
+: mTrigger( trigger ),
+ mLogFactory( Dali::Adaptor::Get().GetLogFactory() )
{
}
{
}
@@
-72,6
+84,9
@@
ImageLoadThread::~ImageLoadThread()
void ImageLoadThread::Run()
{
void ImageLoadThread::Run()
{
+ SetThreadName( "ImageLoadThread" );
+ mLogFactory.InstallLogFunction();
+
while( LoadingTask* task = NextTaskToProcess() )
{
task->Load();
while( LoadingTask* task = NextTaskToProcess() )
{
task->Load();