apis: remove deprecated

- Result Picture::bounds(float* x, float* y, float* w, float* h) const
- Result Picture::load(const char* data, uint32_t size, bool copy = false)
- Result Canvas::reserve(uint32_t size)
- Result Scene::reserve(uint32_t size)

@Issue: https://github.com/thorvg/thorvg/issues/1372
This commit is contained in:
Hermet Park 2023-08-21 12:24:44 +09:00
parent b2499739ee
commit 21911fa1c8
5 changed files with 4 additions and 86 deletions

View file

@ -378,22 +378,6 @@ public:
*/ */
Result blend(BlendMethod method) const noexcept; Result blend(BlendMethod method) const noexcept;
/**
* @brief Gets the bounding box of the paint object before any transformation.
*
* @param[out] x The x coordinate of the upper left corner of the object.
* @param[out] y The y coordinate of the upper left corner of the object.
* @param[out] w The width of the object.
* @param[out] h The height of the object.
*
* @return Result::Success when succeed, Result::InsufficientCondition otherwise.
*
* @note The bounding box doesn't indicate the final rendered region. It's the smallest rectangle that encloses the object.
* @see Paint::bounds(float* x, float* y, float* w, float* h, bool transformed);
* @deprecated Use bounds(float* x, float* y, float* w, float* h, bool transformed) instead
*/
TVG_DEPRECATED Result bounds(float* x, float* y, float* w, float* h) const noexcept;
/** /**
* @brief Gets the axis-aligned bounding box of the paint object. * @brief Gets the axis-aligned bounding box of the paint object.
* *
@ -409,7 +393,7 @@ public:
* *
* @note The bounding box doesn't indicate the actual drawing region. It's the smallest rectangle that encloses the object. * @note The bounding box doesn't indicate the actual drawing region. It's the smallest rectangle that encloses the object.
*/ */
Result bounds(float* x, float* y, float* w, float* h, bool transformed) const noexcept; Result bounds(float* x, float* y, float* w, float* h, bool transformed = false) const noexcept;
/** /**
* @brief Duplicates the object. * @brief Duplicates the object.
@ -581,18 +565,6 @@ public:
Canvas(RenderMethod*); Canvas(RenderMethod*);
virtual ~Canvas(); virtual ~Canvas();
/**
* @brief Sets the size of the container, where all the paints pushed into the Canvas are stored.
*
* If the number of objects pushed into the Canvas is known in advance, calling the function
* prevents multiple memory reallocation, thus improving the performance.
*
* @param[in] n The number of objects for which the memory is to be reserved.
*
* @return Result::Success when succeed.
*/
TVG_DEPRECATED Result reserve(uint32_t n) noexcept;
/** /**
* @brief Returns the list of the paints that currently held by the Canvas. * @brief Returns the list of the paints that currently held by the Canvas.
* *
@ -1249,24 +1221,6 @@ public:
*/ */
Result load(const std::string& path) noexcept; Result load(const std::string& path) noexcept;
/**
* @brief Loads a picture data from a memory block of a given size.
*
* @param[in] data A pointer to a memory location where the content of the picture file is stored.
* @param[in] size The size in bytes of the memory occupied by the @p data.
* @param[in] copy Decides whether the data should be copied into the engine local buffer.
*
* @retval Result::Success When succeed.
* @retval Result::InvalidArguments In case no data are provided or the @p size is zero or less.
* @retval Result::NonSupport When trying to load a file with an unknown extension.
* @retval Result::Unknown If an error occurs at a later stage.
*
* @warning: you have responsibility to release the @p data memory if the @p copy is true
* @deprecated Use load(const char* data, uint32_t size, const std::string& mimeType, bool copy) instead.
* @see Result load(const char* data, uint32_t size, const std::string& mimeType, bool copy = false) noexcept
*/
TVG_DEPRECATED Result load(const char* data, uint32_t size, bool copy = false) noexcept;
/** /**
* @brief Loads a picture data from a memory block of a given size. * @brief Loads a picture data from a memory block of a given size.
* *
@ -1280,7 +1234,7 @@ public:
* @retval Result::NonSupport When trying to load a file with an unknown extension. * @retval Result::NonSupport When trying to load a file with an unknown extension.
* @retval Result::Unknown If an error occurs at a later stage. * @retval Result::Unknown If an error occurs at a later stage.
* *
* @warning: It's the user responsibility to release the @p data memory if the @p copy is @c true. * @warning: It's the user responsibility to release the @p data memory.
* *
* @note If you are unsure about the MIME type, you can provide an empty value like @c "", and thorvg will attempt to figure it out. * @note If you are unsure about the MIME type, you can provide an empty value like @c "", and thorvg will attempt to figure it out.
* @since 0.5 * @since 0.5
@ -1411,18 +1365,6 @@ public:
*/ */
Result push(std::unique_ptr<Paint> paint) noexcept; Result push(std::unique_ptr<Paint> paint) noexcept;
/**
* @brief Sets the size of the container, where all the paints pushed into the Scene are stored.
*
* If the number of objects pushed into the scene is known in advance, calling the function
* prevents multiple memory reallocation, thus improving the performance.
*
* @param[in] size The number of objects for which the memory is to be reserved.
*
* @return Result::Success when succeed, Result::FailedAllocation otherwise.
*/
TVG_DEPRECATED Result reserve(uint32_t size) noexcept;
/** /**
* @brief Returns the list of the paints that currently held by the Scene. * @brief Returns the list of the paints that currently held by the Scene.
* *

View file

@ -37,12 +37,6 @@ Canvas::~Canvas()
} }
Result Canvas::reserve(TVG_UNUSED uint32_t n) noexcept
{
return Result::NonSupport;
}
list<Paint*>& Canvas::paints() noexcept list<Paint*>& Canvas::paints() noexcept
{ {
return pImpl->paints; return pImpl->paints;

View file

@ -354,15 +354,9 @@ Matrix Paint::transform() noexcept
} }
TVG_DEPRECATED Result Paint::bounds(float* x, float* y, float* w, float* h) const noexcept Result Paint::bounds(float* x, float* y, float* w, float* h, bool transformed) const noexcept
{ {
return this->bounds(x, y, w, h, false); if (pImpl->bounds(x, y, w, h, transformed, true)) return Result::Success;
}
Result Paint::bounds(float* x, float* y, float* w, float* h, bool transform) const noexcept
{
if (pImpl->bounds(x, y, w, h, transform, true)) return Result::Success;
return Result::InsufficientCondition; return Result::InsufficientCondition;
} }

View file

@ -100,12 +100,6 @@ Result Picture::load(const char* data, uint32_t size, const string& mimeType, bo
} }
TVG_DEPRECATED Result Picture::load(const char* data, uint32_t size, bool copy) noexcept
{
return load(data, size, "", copy);
}
Result Picture::load(uint32_t* data, uint32_t w, uint32_t h, bool copy) noexcept Result Picture::load(uint32_t* data, uint32_t w, uint32_t h, bool copy) noexcept
{ {
if (!data || w <= 0 || h <= 0) return Result::InvalidArguments; if (!data || w <= 0 || h <= 0) return Result::InvalidArguments;

View file

@ -62,12 +62,6 @@ Result Scene::push(unique_ptr<Paint> paint) noexcept
} }
Result Scene::reserve(TVG_UNUSED uint32_t size) noexcept
{
return Result::NonSupport;
}
Result Scene::clear(bool free) noexcept Result Scene::clear(bool free) noexcept
{ {
pImpl->clear(free); pImpl->clear(free);