mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
tvg_loader interpreter: tiny optmization
skip memory copy as possible.
This commit is contained in:
parent
6b132d77e8
commit
c31c77c0fb
4 changed files with 4 additions and 6 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -87,9 +87,8 @@ static bool _parsePaintProperty(TvgBinBlock block, Paint *paint)
|
|||
}
|
||||
case TVG_TAG_PAINT_TRANSFORM: {
|
||||
if (block.length != SIZE(Matrix)) return false;
|
||||
Matrix matrix;
|
||||
memcpy(&matrix, block.data, SIZE(Matrix));
|
||||
paint->transform(matrix);
|
||||
auto transform = (Matrix*)(block.data);
|
||||
paint->transform(*transform);
|
||||
return true;
|
||||
}
|
||||
case TVG_TAG_PAINT_CMP_TARGET: {
|
||||
|
@ -227,9 +226,8 @@ static unique_ptr<Fill> _parseShapeFill(const char *ptr, const char *end)
|
|||
}
|
||||
case TVG_TAG_FILL_TRANSFORM: {
|
||||
if (!fillGrad || block.length != SIZE(Matrix)) return nullptr;
|
||||
Matrix gradTransform;
|
||||
memcpy(&gradTransform, block.data, SIZE(Matrix));
|
||||
fillGrad->transform(gradTransform);
|
||||
auto transform = (Matrix*)(block.data);
|
||||
fillGrad->transform(*transform);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
|
Loading…
Add table
Reference in a new issue