mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
common scene: fix a potential composition bug.
In the current implementation, only a scene with a single shape type is able to skip the composition step. However, a child picture might have multiple children shapes as well, which leads to the bug.
This commit is contained in:
parent
be2de28312
commit
c7d77b3517
1 changed files with 5 additions and 3 deletions
|
@ -100,9 +100,11 @@ struct Scene::Impl
|
||||||
if (opacity == 255) return false;
|
if (opacity == 255) return false;
|
||||||
|
|
||||||
//If scene has several children or only scene, it may require composition.
|
//If scene has several children or only scene, it may require composition.
|
||||||
if (paints.count > 1) return true;
|
//OPTIMIZE: the bitmap type of the picture would not need the composition.
|
||||||
if (paints.count == 1 && (*paints.data)->identifier() == TVG_CLASS_ID_SCENE) return true;
|
//OPTIMIZE: a single paint of a scene would not need the composition.
|
||||||
return false;
|
if (paints.count == 1 && (*paints.data)->identifier() == TVG_CLASS_ID_SHAPE) return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderData update(RenderMethod &renderer, const RenderTransform* transform, uint32_t opacity, Array<RenderData>& clips, RenderUpdateFlag flag, bool clipper)
|
RenderData update(RenderMethod &renderer, const RenderTransform* transform, uint32_t opacity, Array<RenderData>& clips, RenderUpdateFlag flag, bool clipper)
|
||||||
|
|
Loading…
Add table
Reference in a new issue