From e784143ff8ecd75421c3211df520b7e5ef07a848 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Thu, 23 Sep 2021 16:50:08 +0900 Subject: [PATCH] api: remove the redundant api, Picture::paint(). 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 | 6 ------ src/lib/tvgPicture.cpp | 12 +----------- src/loaders/tvg/tvgTvgBinInterpreter.cpp | 7 +------ 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/inc/thorvg.h b/inc/thorvg.h index 36713293..fcab2ab3 100644 --- a/inc/thorvg.h +++ b/inc/thorvg.h @@ -1076,12 +1076,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) noexcept; - /** * @brief Loads a raw data from a memory block with a given size. * diff --git a/src/lib/tvgPicture.cpp b/src/lib/tvgPicture.cpp index 790ac974..a00cde6d 100644 --- a/src/lib/tvgPicture.cpp +++ b/src/lib/tvgPicture.cpp @@ -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) 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 diff --git a/src/loaders/tvg/tvgTvgBinInterpreter.cpp b/src/loaders/tvg/tvgTvgBinInterpreter.cpp index 9695fa14..6dc20438 100644 --- a/src/loaders/tvg/tvgTvgBinInterpreter.cpp +++ b/src/loaders/tvg/tvgTvgBinInterpreter.cpp @@ -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)); - return true; - } - + //Vector Picture won't be requested since Saver replaces it with the Scene return false; }