summaryrefslogtreecommitdiff
path: root/thirdparty/thorvg/src/lib/tvgPicture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/thorvg/src/lib/tvgPicture.cpp')
-rw-r--r--thirdparty/thorvg/src/lib/tvgPicture.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/thirdparty/thorvg/src/lib/tvgPicture.cpp b/thirdparty/thorvg/src/lib/tvgPicture.cpp
index 1e04e25435..ad9db96245 100644
--- a/thirdparty/thorvg/src/lib/tvgPicture.cpp
+++ b/thirdparty/thorvg/src/lib/tvgPicture.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020 - 2022 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2020 - 2023 the ThorVG project. All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -107,7 +107,7 @@ Result Picture::size(float* w, float* h) const noexcept
const uint32_t* Picture::data(uint32_t* w, uint32_t* h) const noexcept
{
//Try it, If not loaded yet.
- pImpl->reload();
+ pImpl->load();
if (pImpl->loader) {
if (w) *w = static_cast<uint32_t>(pImpl->loader->w);
@@ -116,6 +116,23 @@ const uint32_t* Picture::data(uint32_t* w, uint32_t* h) const noexcept
if (w) *w = 0;
if (h) *h = 0;
}
- if (pImpl->surface) return pImpl->surface->buffer;
+ if (pImpl->surface) return pImpl->surface->buf32;
else return nullptr;
}
+
+
+Result Picture::mesh(const Polygon* triangles, uint32_t triangleCnt) noexcept
+{
+ if (!triangles && triangleCnt > 0) return Result::InvalidArguments;
+ if (triangles && triangleCnt == 0) return Result::InvalidArguments;
+
+ pImpl->mesh(triangles, triangleCnt);
+ return Result::Success;
+}
+
+
+uint32_t Picture::mesh(const Polygon** triangles) const noexcept
+{
+ if (triangles) *triangles = pImpl->rm.triangles;
+ return pImpl->rm.triangleCnt;
+}