X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fsvg%2Fsvg-rasterize-thread.h;h=b7bdbfd0e6bacc530c666f1e25f9b60a5e4bd345;hb=4cc02f3e2045755c2c65e64a6f5e126a4c6208ea;hp=46c6966044d637026ebc819e72b2bbae338bc9bb;hpb=cc0aefb3259c6fe818d9949ebf768843cc01e6fd;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/visuals/svg/svg-rasterize-thread.h b/dali-toolkit/internal/visuals/svg/svg-rasterize-thread.h index 46c6966..b7bdbfd 100644 --- a/dali-toolkit/internal/visuals/svg/svg-rasterize-thread.h +++ b/dali-toolkit/internal/visuals/svg/svg-rasterize-thread.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_SVG_RASTERIZE_THREAD_H /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -28,6 +28,7 @@ #include #include #include +#include struct NSVGimage; struct NSVGrasterizer; @@ -65,16 +66,21 @@ public: * @param[in] parsedSvg The parsed svg for rasterizing. * Note, after the task is added to the worker thread, the worker thread takes over the ownership. * When the image is to be deleted, delete it in the worker thread by calling SvgRasterizeThread::DeleteImage( parsedSvg ). + * @param[in] url The URL to svg resource to use. * @param[in] width The rasterization width. * @param[in] height The rasterization height. */ - RasterizingTask( SvgVisual* svgRenderer, NSVGimage* parsedSvg, unsigned int width, unsigned int height ); + RasterizingTask( SvgVisual* svgRenderer, NSVGimage* parsedSvg, const VisualUrl& url, float dpi, unsigned int width, unsigned int height ); /** - * Do the rasterization with the given rasterizer. - *@param[in] rasterizer The rasterizer that rasterize the SVG to a buffer image + * Destructor. + */ + ~RasterizingTask(); + + /** + * Do the rasterization with the mRasterizer. */ - void Rasterize( NSVGrasterizer* rasterizer ); + void Rasterize( ); /** * Get the svg visual @@ -87,8 +93,18 @@ public: */ PixelData GetPixelData() const; -private: + /** + * Get the parsed data. + * @return parsed image data. + */ + NSVGimage* GetParsedImage() const; + /** + * Load svg file + */ + void Load(); + +private: // Undefined RasterizingTask( const RasterizingTask& task ); @@ -96,14 +112,16 @@ private: RasterizingTask& operator=( const RasterizingTask& task ); private: - SvgVisualPtr mSvgVisual; - PixelData mPixelData; + SvgVisualPtr mSvgVisual; NSVGimage* mParsedSvg; + VisualUrl mUrl; + PixelData mPixelData; + float mDpi; unsigned int mWidth; unsigned int mHeight; + NSVGrasterizer* mRasterizer; }; - /** * The worker thread for SVG rasterization. */ @@ -183,7 +201,7 @@ protected: * The entry function of the worker thread. * It fetches task from the Queue, rasterizes the image and apply to the renderer. */ - virtual void Run(); + void Run() override; private: @@ -203,7 +221,6 @@ private: Dali::Mutex mMutex; EventThreadCallback* mTrigger; - NSVGrasterizer* mRasterizer; bool mIsThreadWaiting; };