From: Hermet Park Date: Fri, 14 Aug 2020 09:51:38 +0000 (+0900) Subject: common initializer: introduce thread count api. X-Git-Tag: accepted/tizen/unified/20200820.034622~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F79%2F241079%2F2;p=platform%2Fcore%2Fgraphics%2Ftizenvg.git common initializer: introduce thread count api. this interface controls the number of threads working behind. default is 0 == only syncrhonous. Change-Id: I8404f33359e6213acc5e578061568fede50cd9a6 --- diff --git a/inc/thorvg.h b/inc/thorvg.h index 9759245..452234d 100644 --- a/inc/thorvg.h +++ b/inc/thorvg.h @@ -365,6 +365,8 @@ public: */ static Result init(CanvasEngine engine) noexcept; static Result term(CanvasEngine engine) noexcept; + static Result threads(uint32_t cnt) noexcept; + static uint32_t threads() noexcept; _TVG_DISABLE_CTOR(Initializer); }; diff --git a/src/lib/tvgInitializer.cpp b/src/lib/tvgInitializer.cpp index 2009299..3367603 100644 --- a/src/lib/tvgInitializer.cpp +++ b/src/lib/tvgInitializer.cpp @@ -38,6 +38,8 @@ /* Internal Class Implementation */ /************************************************************************/ +static uint32_t threadCnt = 0; + /************************************************************************/ /* External Class Implementation */ /************************************************************************/ @@ -93,4 +95,18 @@ Result Initializer::term(CanvasEngine engine) noexcept return Result::Success; } + +Result Initializer::threads(uint32_t cnt) noexcept +{ + threadCnt = cnt; + + return Result::Success; +} + + +uint32_t Initializer::threads() noexcept +{ + return threadCnt; +} + #endif /* _TVG_INITIALIZER_CPP_ */