mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +00:00
renderer: minor optimization.
reduce the binary size.
This commit is contained in:
parent
c8833e970d
commit
2efdae710d
3 changed files with 13 additions and 12 deletions
|
@ -196,13 +196,15 @@ struct Picture::Impl
|
|||
{
|
||||
load();
|
||||
|
||||
auto ret = Picture::gen();
|
||||
auto ret = Picture::gen().release();
|
||||
auto dup = ret->pImpl;
|
||||
|
||||
auto dup = ret.get()->pImpl;
|
||||
if (paint) dup->paint = paint->duplicate();
|
||||
|
||||
dup->loader = loader;
|
||||
++dup->loader->sharing;
|
||||
if (loader) {
|
||||
dup->loader = loader;
|
||||
++dup->loader->sharing;
|
||||
}
|
||||
|
||||
if (surface) {
|
||||
dup->surface = new Surface;
|
||||
|
@ -219,7 +221,7 @@ struct Picture::Impl
|
|||
memcpy(dup->rm.triangles, rm.triangles, sizeof(Polygon) * rm.triangleCnt);
|
||||
}
|
||||
|
||||
return ret.release();
|
||||
return ret;
|
||||
}
|
||||
|
||||
Iterator* iterator()
|
||||
|
|
|
@ -212,9 +212,8 @@ struct Scene::Impl
|
|||
|
||||
Paint* duplicate()
|
||||
{
|
||||
auto ret = Scene::gen();
|
||||
|
||||
auto dup = ret.get()->pImpl;
|
||||
auto ret = Scene::gen().release();
|
||||
auto dup = ret->pImpl;
|
||||
|
||||
for (auto paint : paints) {
|
||||
auto cdup = paint->duplicate();
|
||||
|
@ -222,7 +221,7 @@ struct Scene::Impl
|
|||
dup->paints.push_back(cdup);
|
||||
}
|
||||
|
||||
return ret.release();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void clear(bool free)
|
||||
|
|
|
@ -338,9 +338,9 @@ struct Shape::Impl
|
|||
|
||||
Paint* duplicate()
|
||||
{
|
||||
auto ret = Shape::gen();
|
||||
auto ret = Shape::gen().release();
|
||||
auto dup = ret->pImpl;
|
||||
|
||||
auto dup = ret.get()->pImpl;
|
||||
dup->rs.rule = rs.rule;
|
||||
|
||||
//Color
|
||||
|
@ -376,7 +376,7 @@ struct Shape::Impl
|
|||
dup->flag |= RenderUpdateFlag::Gradient;
|
||||
}
|
||||
|
||||
return ret.release();
|
||||
return ret;
|
||||
}
|
||||
|
||||
Iterator* iterator()
|
||||
|
|
Loading…
Add table
Reference in a new issue