mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +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();
|
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();
|
if (paint) dup->paint = paint->duplicate();
|
||||||
|
|
||||||
dup->loader = loader;
|
if (loader) {
|
||||||
++dup->loader->sharing;
|
dup->loader = loader;
|
||||||
|
++dup->loader->sharing;
|
||||||
|
}
|
||||||
|
|
||||||
if (surface) {
|
if (surface) {
|
||||||
dup->surface = new Surface;
|
dup->surface = new Surface;
|
||||||
|
@ -219,7 +221,7 @@ struct Picture::Impl
|
||||||
memcpy(dup->rm.triangles, rm.triangles, sizeof(Polygon) * rm.triangleCnt);
|
memcpy(dup->rm.triangles, rm.triangles, sizeof(Polygon) * rm.triangleCnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret.release();
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterator* iterator()
|
Iterator* iterator()
|
||||||
|
|
|
@ -212,9 +212,8 @@ struct Scene::Impl
|
||||||
|
|
||||||
Paint* duplicate()
|
Paint* duplicate()
|
||||||
{
|
{
|
||||||
auto ret = Scene::gen();
|
auto ret = Scene::gen().release();
|
||||||
|
auto dup = ret->pImpl;
|
||||||
auto dup = ret.get()->pImpl;
|
|
||||||
|
|
||||||
for (auto paint : paints) {
|
for (auto paint : paints) {
|
||||||
auto cdup = paint->duplicate();
|
auto cdup = paint->duplicate();
|
||||||
|
@ -222,7 +221,7 @@ struct Scene::Impl
|
||||||
dup->paints.push_back(cdup);
|
dup->paints.push_back(cdup);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret.release();
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear(bool free)
|
void clear(bool free)
|
||||||
|
|
|
@ -338,9 +338,9 @@ struct Shape::Impl
|
||||||
|
|
||||||
Paint* duplicate()
|
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;
|
dup->rs.rule = rs.rule;
|
||||||
|
|
||||||
//Color
|
//Color
|
||||||
|
@ -376,7 +376,7 @@ struct Shape::Impl
|
||||||
dup->flag |= RenderUpdateFlag::Gradient;
|
dup->flag |= RenderUpdateFlag::Gradient;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret.release();
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterator* iterator()
|
Iterator* iterator()
|
||||||
|
|
Loading…
Add table
Reference in a new issue