#define DALI_TOOLKIT_VECTOR_IMAGE_RASTERIZE_THREAD_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
*/
// EXTERNAL INCLUDES
-//#include <dali/devel-api/adaptor-framework/event-thread-callback.h>
#include <dali/devel-api/threading/conditional-wait.h>
#include <dali/devel-api/threading/thread.h>
-#include <dali/integration-api/adaptors/log-factory-interface.h>
-#include <vector>
+#include <dali/integration-api/adaptor-framework/log-factory-interface.h>
#include <memory>
-//#include <string>
+#include <vector>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.h>
namespace Dali
{
-
namespace Toolkit
{
-
namespace Internal
{
-
/**
* The worker thread for vector image rasterization.
*/
class VectorRasterizeThread : public Thread
{
public:
-
/**
* @brief Constructor.
*/
/**
* @brief Destructor.
*/
- virtual ~VectorRasterizeThread();
+ ~VectorRasterizeThread() override;
/**
* The callback is called from the rasterize thread after the rasterization is completed.
* @param[in] callBack The function to call.
*/
- void SetCompletedCallback( CallbackBase* callback );
+ void SetCompletedCallback(CallbackBase* callback);
/**
* Add a task to rasterize.
*
* @param[in] task The task to rasterize
*/
- void AddTask( VectorAnimationTaskPtr task );
+ void AddTask(VectorAnimationTaskPtr task);
protected:
-
/**
* @brief The entry function of the worker thread.
* It rasterizes the vector image.
void Run() override;
private:
-
/**
* Rasterizes the tasks.
*/
void Rasterize();
private:
-
// Undefined
- VectorRasterizeThread( const VectorRasterizeThread& thread ) = delete;
+ VectorRasterizeThread(const VectorRasterizeThread& thread) = delete;
// Undefined
- VectorRasterizeThread& operator=( const VectorRasterizeThread& thread ) = delete;
+ VectorRasterizeThread& operator=(const VectorRasterizeThread& thread) = delete;
private:
-
- std::vector< VectorAnimationTaskPtr > mRasterizeTasks;
- ConditionalWait mConditionalWait;
- std::unique_ptr< CallbackBase > mCompletedCallback;
- bool mDestroyThread; ///< Whether the thread be destroyed
- bool mIsThreadStarted;
- const Dali::LogFactoryInterface& mLogFactory; ///< The log factory
-
+ std::vector<VectorAnimationTaskPtr> mRasterizeTasks;
+ ConditionalWait mConditionalWait;
+ std::unique_ptr<CallbackBase> mCompletedCallback;
+ bool mDestroyThread; ///< Whether the thread be destroyed
+ bool mIsThreadStarted;
+ const Dali::LogFactoryInterface& mLogFactory; ///< The log factory
};
} // namespace Internal