common saver: change to instance based for future sync/async behavior.
authorHermet Park <chuneon.park@samsung.com>
Mon, 19 Jul 2021 11:32:31 +0000 (20:32 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Thu, 22 Jul 2021 08:24:22 +0000 (17:24 +0900)
reserve sync() method TODO

inc/thorvg.h
src/examples/images/test.tvg
src/lib/tvgSaver.cpp

index e172570..48380b0 100644 (file)
@@ -1403,9 +1403,11 @@ public:
      * @retval Result::MemoryCorruption When casting in the internal function implementation failed.
      * @retval Result::Unknown Others.
      *
-     * @BETA_API
      */
-    static Result save(std::unique_ptr<Paint> paint, const std::string& path) noexcept;
+    Result save(std::unique_ptr<Paint> paint, const std::string& path) noexcept;
+    Result sync() noexcept;
+
+    static std::unique_ptr<Saver> gen() noexcept;
 
     _TVG_DECLARE_PRIVATE(Saver);
 };
index 3deaea6..9fcda9e 100644 (file)
Binary files a/src/examples/images/test.tvg and b/src/examples/images/test.tvg differ
index 761c571..1768ca4 100644 (file)
@@ -59,3 +59,16 @@ Result Saver::save(std::unique_ptr<Paint> paint, const std::string& path) noexce
     delete p;
     return Result::Unknown;
 }
+
+
+Result Saver::sync() noexcept
+{
+    //TODO:
+    return Result::Success;
+}
+
+
+unique_ptr<Saver> Saver::gen() noexcept
+{
+    return unique_ptr<Saver>(new Saver);
+}
\ No newline at end of file