common initializer: introduce thread count api. 79/241079/2
authorHermet Park <chuneon.park@samsung.com>
Fri, 14 Aug 2020 09:51:38 +0000 (18:51 +0900)
committerHermet Park <chuneon.park@samsung.com>
Fri, 14 Aug 2020 09:53:01 +0000 (18:53 +0900)
this interface controls the number of threads working behind.

default is 0 == only syncrhonous.

Change-Id: I8404f33359e6213acc5e578061568fede50cd9a6

inc/thorvg.h
src/lib/tvgInitializer.cpp

index 9759245..452234d 100644 (file)
@@ -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);
 };
index 2009299..3367603 100644 (file)
@@ -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_ */