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
Add post processor
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
visuals
/
animated-vector-image
/
vector-rasterize-thread.cpp
diff --git
a/dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.cpp
b/dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.cpp
index
cb2d08a
..
9a3f909
100644
(file)
--- a/
dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.cpp
+++ b/
dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 20
19
Samsung Electronics Co., Ltd.
+ * Copyright (c) 20
21
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,25
+20,21
@@
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/thread-settings.h>
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/thread-settings.h>
+#include <dali/integration-api/adaptor-framework/adaptor.h>
#include <dali/integration-api/debug.h>
#include <chrono>
#include <thread>
#include <dali/integration-api/debug.h>
#include <chrono>
#include <thread>
-#include <dali/integration-api/adaptor-framework/adaptor.h>
namespace Dali
{
namespace Dali
{
-
namespace Toolkit
{
namespace Toolkit
{
-
namespace Internal
{
namespace Internal
{
-
namespace
{
namespace
{
-
#if defined(DEBUG_ENABLED)
#if defined(DEBUG_ENABLED)
-Debug::Filter* gVectorAnimationLogFilter = Debug::Filter::New(
Debug::NoLogging, false, "LOG_VECTOR_ANIMATION"
);
+Debug::Filter* gVectorAnimationLogFilter = Debug::Filter::New(
Debug::NoLogging, false, "LOG_VECTOR_ANIMATION"
);
#endif
} // unnamed namespace
#endif
} // unnamed namespace
@@
-47,9
+43,9
@@
VectorRasterizeThread::VectorRasterizeThread()
: mRasterizeTasks(),
mConditionalWait(),
mCompletedCallback(),
: mRasterizeTasks(),
mConditionalWait(),
mCompletedCallback(),
- mDestroyThread(
false
),
- mIsThreadStarted(
false
),
- mLogFactory(
Dali::Adaptor::Get().GetLogFactory()
)
+ mDestroyThread(
false
),
+ mIsThreadStarted(
false
),
+ mLogFactory(
Dali::Adaptor::Get().GetLogFactory()
)
{
}
{
}
@@
-57,49
+53,49
@@
VectorRasterizeThread::~VectorRasterizeThread()
{
// Stop the thread
{
{
// Stop the thread
{
- ConditionalWait::ScopedLock lock(
mConditionalWait
);
+ ConditionalWait::ScopedLock lock(
mConditionalWait
);
mDestroyThread = true;
mDestroyThread = true;
- mConditionalWait.Notify(
lock
);
+ mConditionalWait.Notify(
lock
);
}
}
- DALI_LOG_INFO(
gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::~VectorRasterizeThread: Join [%p]\n", this
);
+ DALI_LOG_INFO(
gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::~VectorRasterizeThread: Join [%p]\n", this
);
Join();
}
Join();
}
-void VectorRasterizeThread::SetCompletedCallback(
CallbackBase* callback
)
+void VectorRasterizeThread::SetCompletedCallback(
CallbackBase* callback
)
{
{
- ConditionalWait::ScopedLock lock(
mConditionalWait
);
+ ConditionalWait::ScopedLock lock(
mConditionalWait
);
- mCompletedCallback = std::unique_ptr<
CallbackBase >( callback
);
+ mCompletedCallback = std::unique_ptr<
CallbackBase>(callback
);
}
}
-void VectorRasterizeThread::AddTask(
VectorAnimationTaskPtr task
)
+void VectorRasterizeThread::AddTask(
VectorAnimationTaskPtr task
)
{
{
- if( !mIsThreadStarted )
+ // Lock while adding task to the queue
+ ConditionalWait::ScopedLock lock(mConditionalWait);
+
+ if(!mIsThreadStarted)
{
Start();
mIsThreadStarted = true;
}
{
Start();
mIsThreadStarted = true;
}
- // Lock while adding task to the queue
- ConditionalWait::ScopedLock lock( mConditionalWait );
-
- if( mRasterizeTasks.end() == std::find( mRasterizeTasks.begin(), mRasterizeTasks.end(), task ) )
+ if(mRasterizeTasks.end() == std::find(mRasterizeTasks.begin(), mRasterizeTasks.end(), task))
{
{
- mRasterizeTasks.push_back(
task
);
+ mRasterizeTasks.push_back(
task
);
// wake up the animation thread
// wake up the animation thread
- mConditionalWait.Notify(
lock
);
+ mConditionalWait.Notify(
lock
);
}
}
void VectorRasterizeThread::Run()
{
}
}
void VectorRasterizeThread::Run()
{
- SetThreadName(
"VectorRasterizeThread"
);
+ SetThreadName(
"VectorRasterizeThread"
);
mLogFactory.InstallLogFunction();
mLogFactory.InstallLogFunction();
- while(
!mDestroyThread
)
+ while(
!mDestroyThread
)
{
Rasterize();
}
{
Rasterize();
}
@@
-110,30
+106,30
@@
void VectorRasterizeThread::Rasterize()
VectorAnimationTaskPtr nextTask;
{
// Lock while popping task out from the queue
VectorAnimationTaskPtr nextTask;
{
// Lock while popping task out from the queue
- ConditionalWait::ScopedLock lock(
mConditionalWait
);
+ ConditionalWait::ScopedLock lock(
mConditionalWait
);
// conditional wait
// conditional wait
- if(
mRasterizeTasks.empty()
)
+ if(
mRasterizeTasks.empty()
)
{
{
- mConditionalWait.Wait(
lock
);
+ mConditionalWait.Wait(
lock
);
}
// pop out the next task from the queue
}
// pop out the next task from the queue
- if(
!mRasterizeTasks.empty()
)
+ if(
!mRasterizeTasks.empty()
)
{
{
- std::vector<
VectorAnimationTaskPtr
>::iterator next = mRasterizeTasks.begin();
- nextTask = *next;
- mRasterizeTasks.erase(
next
);
+ std::vector<
VectorAnimationTaskPtr
>::iterator next = mRasterizeTasks.begin();
+ nextTask
= *next;
+ mRasterizeTasks.erase(
next
);
}
}
}
}
- if(
nextTask
)
+ if(
nextTask
)
{
bool keepAnimation = nextTask->Rasterize();
{
bool keepAnimation = nextTask->Rasterize();
- if(
mCompletedCallback
)
+ if(
mCompletedCallback
)
{
{
- CallbackBase::Execute(
*mCompletedCallback, nextTask, keepAnimation
);
+ CallbackBase::Execute(
*mCompletedCallback, nextTask, keepAnimation
);
}
}
}
}
}
}