UnregisterProcessor();
}
-void SvgRasterizeThread::DeleteImage(VectorImageRenderer vectorRenderer)
-{
- // Lock while adding image to the delete queue
- ConditionalWait::ScopedLock lock(mConditionalWait);
-
- if(mIsThreadWaiting) // no rasterization is ongoing, save to delete
- {
- // TODO: what?
- }
- else // wait to delete until current rasterization completed.
- {
- mDeleteSvg.PushBack(&vectorRenderer);
- }
-}
-
RasterizingTaskPtr SvgRasterizeThread::NextTaskToProcess()
{
// Lock while popping task out from the queue
ConditionalWait::ScopedLock lock(mConditionalWait);
- // Delete the image here to make sure that it is not used in the nsvgRasterize()
- if(!mDeleteSvg.Empty())
- {
- mDeleteSvg.Clear();
- }
-
// conditional wait
while(mRasterizeTasks.empty())
{
void RemoveTask(SvgVisual* visual);
/**
- * Delete the parsed SVG image, called by main thread.
- *
- * The parsed svg should be deleted in worker thread, as the main thread does not know whether a rasterization of this svg is ongoing.
- *
- * @param[in] VectorImage The image to be deleted
- */
- void DeleteImage(VectorImageRenderer vectorImage);
-
- /**
* @copydoc Dali::Integration::Processor::Process()
*/
void Process() override;
private:
std::vector<RasterizingTaskPtr> mRasterizeTasks; //The queue of the tasks waiting to rasterize the SVG image
std::vector<RasterizingTaskPtr> mCompletedTasks; //The queue of the tasks with the SVG rasterization completed
- Vector<VectorImageRenderer*> mDeleteSvg; //The images that the event thread requested to delete
ConditionalWait mConditionalWait;
Dali::Mutex mMutex;