mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 20:14:37 +00:00
renderer: rectified render update flags.
Image update flag has been missed, when the image is copied with a surface. This fixed it. Also try to skip update if any properties were not changed.
This commit is contained in:
parent
eb86ac539c
commit
9ecb296b99
2 changed files with 8 additions and 4 deletions
|
@ -92,18 +92,19 @@ struct Picture::Impl
|
|||
|
||||
RenderData update(RenderMethod* renderer, const RenderTransform* pTransform, Array<RenderData>& clips, uint8_t opacity, RenderUpdateFlag pFlag, bool clipper)
|
||||
{
|
||||
auto flag = load();
|
||||
auto flag = static_cast<RenderUpdateFlag>(pFlag | load());
|
||||
|
||||
if (surface) {
|
||||
if (flag == RenderUpdateFlag::None) return rd;
|
||||
auto transform = resizeTransform(pTransform);
|
||||
rd = renderer->prepare(surface, &rm, rd, &transform, clips, opacity, static_cast<RenderUpdateFlag>(pFlag | flag));
|
||||
rd = renderer->prepare(surface, &rm, rd, &transform, clips, opacity, flag);
|
||||
} else if (paint) {
|
||||
if (resizing) {
|
||||
loader->resize(paint, w, h);
|
||||
resizing = false;
|
||||
}
|
||||
needComp = needComposition(opacity) ? true : false;
|
||||
rd = paint->pImpl->update(renderer, pTransform, clips, opacity, static_cast<RenderUpdateFlag>(pFlag | flag), clipper);
|
||||
rd = paint->pImpl->update(renderer, pTransform, clips, opacity, flag, clipper);
|
||||
}
|
||||
return rd;
|
||||
}
|
||||
|
@ -200,6 +201,7 @@ struct Picture::Impl
|
|||
if (loader) {
|
||||
dup->loader = loader;
|
||||
++dup->loader->sharing;
|
||||
PP(ret)->renderFlag |= RenderUpdateFlag::Image;
|
||||
}
|
||||
|
||||
dup->surface = surface;
|
||||
|
|
|
@ -96,7 +96,9 @@ struct Shape::Impl
|
|||
}
|
||||
|
||||
RenderData update(RenderMethod* renderer, const RenderTransform* transform, Array<RenderData>& clips, uint8_t opacity, RenderUpdateFlag pFlag, bool clipper)
|
||||
{
|
||||
{
|
||||
if (static_cast<RenderUpdateFlag>(pFlag | flag) == RenderUpdateFlag::None) return rd;
|
||||
|
||||
if ((needComp = needComposition(opacity))) {
|
||||
/* Overriding opacity value. If this scene is half-translucent,
|
||||
It must do intermediate composition with that opacity value. */
|
||||
|
|
Loading…
Add table
Reference in a new issue