api: remove the redundant api, Picture::paint().
authorHermet Park <chuneon.park@samsung.com>
Thu, 23 Sep 2021 07:50:08 +0000 (16:50 +0900)
committerHermet Park <chuneon.park@samsung.com>
Mon, 27 Sep 2021 02:21:11 +0000 (11:21 +0900)
tvg::Picture is replaced to tvg::Scene if the picture has the vector tree,
Thus it's useless since it won't be reached logically.

inc/thorvg.h
src/lib/tvgPicture.cpp
src/loaders/tvg/tvgTvgBinInterpreter.cpp

index 3671329..fcab2ab 100644 (file)
@@ -1077,12 +1077,6 @@ public:
     const uint32_t* data(uint32_t* w, uint32_t* h) const noexcept;
 
     /**
-     * Must remove it!
-     * @BETA_API
-     */
-    Result paint(std::unique_ptr<Paint> paint) noexcept;
-
-    /**
      * @brief Loads a raw data from a memory block with a given size.
      *
      * @warning Please do not use it, this API is not official one. It could be modified in the next version.
index 790ac97..a00cde6 100644 (file)
@@ -110,14 +110,4 @@ const uint32_t* Picture::data(uint32_t* w, uint32_t* h) const noexcept
         if (h) *h = 0;
     }
     return pImpl->pixels;
-}
-
-
-Result Picture::paint(unique_ptr<Paint> paint) noexcept
-{
-    if (pImpl->paint) return Result::InsufficientCondition;
-    auto p = paint.release();
-    if (!p) return Result::MemoryCorruption;
-    pImpl->paint = p;
-    return Result::Success;
-}
+}
\ No newline at end of file
index 9695fa1..6dc2043 100644 (file)
@@ -347,12 +347,7 @@ static bool _parsePicture(TvgBinBlock block, Paint* paint)
     //Case2: Base Paint Properties
     if (_parsePaintProperty(block, picture)) return true;
 
-    //Case3: Vector Picture
-    if (auto paint = _parsePaint(block)) {
-        picture->paint(unique_ptr<Paint>(paint));
-        return true;
-    }
-
+    //Vector Picture won't be requested since Saver replaces it with the Scene
     return false;
 }