mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-09 06:04:03 +00:00
tvg_loader: code refactoring.
renamed internal functions, no logical changes.
This commit is contained in:
parent
88a85c68fa
commit
26fd6b5dfd
3 changed files with 7 additions and 7 deletions
|
@ -504,14 +504,14 @@ static LoaderResult _parsePaint(tvgBlock base_block, Paint **paint)
|
||||||
/* External Class Implementation */
|
/* External Class Implementation */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
bool tvgValidateTvgHeader(const char *ptr, uint32_t size)
|
bool tvgValidateData(const char *ptr, uint32_t size)
|
||||||
{
|
{
|
||||||
auto end = ptr + size;
|
auto end = ptr + size;
|
||||||
if (!_readTvgHeader(&ptr) || ptr >= end) return false;
|
if (!_readTvgHeader(&ptr) || ptr >= end) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
unique_ptr<Scene> tvgLoadTvgData(const char *ptr, uint32_t size)
|
unique_ptr<Scene> tvgLoadData(const char *ptr, uint32_t size)
|
||||||
{
|
{
|
||||||
auto end = ptr + size;
|
auto end = ptr + size;
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "tvgCommon.h"
|
#include "tvgCommon.h"
|
||||||
#include "tvgBinaryDesc.h"
|
#include "tvgBinaryDesc.h"
|
||||||
|
|
||||||
bool tvgValidateTvgHeader(const char *ptr, uint32_t size);
|
bool tvgValidateData(const char *ptr, uint32_t size);
|
||||||
unique_ptr<Scene> tvgLoadTvgData(const char *ptr, uint32_t size);
|
unique_ptr<Scene> tvgLoadData(const char *ptr, uint32_t size);
|
||||||
|
|
||||||
#endif //_TVG_TVG_LOAD_PARSER_H_
|
#endif //_TVG_TVG_LOAD_PARSER_H_
|
||||||
|
|
|
@ -79,7 +79,7 @@ bool TvgLoader::open(const string &path)
|
||||||
|
|
||||||
pointer = buffer;
|
pointer = buffer;
|
||||||
|
|
||||||
return tvgValidateTvgHeader(pointer, size);
|
return tvgValidateData(pointer, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TvgLoader::open(const char *data, uint32_t size)
|
bool TvgLoader::open(const char *data, uint32_t size)
|
||||||
|
@ -89,7 +89,7 @@ bool TvgLoader::open(const char *data, uint32_t size)
|
||||||
this->pointer = data;
|
this->pointer = data;
|
||||||
this->size = size;
|
this->size = size;
|
||||||
|
|
||||||
return tvgValidateTvgHeader(pointer, size);
|
return tvgValidateData(pointer, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TvgLoader::read()
|
bool TvgLoader::read()
|
||||||
|
@ -111,7 +111,7 @@ bool TvgLoader::close()
|
||||||
void TvgLoader::run(unsigned tid)
|
void TvgLoader::run(unsigned tid)
|
||||||
{
|
{
|
||||||
if (root) root.reset();
|
if (root) root.reset();
|
||||||
root = tvgLoadTvgData(pointer, size);
|
root = tvgLoadData(pointer, size);
|
||||||
if (!root) clearBuffer();
|
if (!root) clearBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue