tvg_loader interpreter: tiny optmization

skip memory copy as possible.
This commit is contained in:
Hermet Park 2021-11-02 19:46:00 +09:00
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.

View file

@ -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: {