mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-18 20:36:43 +00:00
renderer: propagate picture blending to internal scene
Users can regard a picture and its nested scene as a single entity, so blending options can be properly applied to the actual visual paint object.
This commit is contained in:
parent
bc4afd8ef7
commit
a80b0aa188
1 changed files with 5 additions and 3 deletions
|
@ -98,6 +98,7 @@ struct PictureImpl : Picture
|
||||||
resizing = false;
|
resizing = false;
|
||||||
}
|
}
|
||||||
needComposition(opacity);
|
needComposition(opacity);
|
||||||
|
vector->blend(pImpl->blendMethod); //propagate blend method to nested vector scene
|
||||||
return vector->pImpl->update(renderer, transform, clips, opacity, flag, false);
|
return vector->pImpl->update(renderer, transform, clips, opacity, flag, false);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -248,10 +249,11 @@ struct PictureImpl : Picture
|
||||||
bool render(RenderMethod* renderer)
|
bool render(RenderMethod* renderer)
|
||||||
{
|
{
|
||||||
auto ret = true;
|
auto ret = true;
|
||||||
renderer->blend(impl.blendMethod);
|
|
||||||
|
|
||||||
if (bitmap) return renderer->renderImage(impl.rd);
|
if (bitmap) {
|
||||||
else if (vector) {
|
renderer->blend(impl.blendMethod);
|
||||||
|
return renderer->renderImage(impl.rd);
|
||||||
|
} else if (vector) {
|
||||||
RenderCompositor* cmp = nullptr;
|
RenderCompositor* cmp = nullptr;
|
||||||
if (impl.cmpFlag) {
|
if (impl.cmpFlag) {
|
||||||
cmp = renderer->target(bounds(renderer), renderer->colorSpace(), impl.cmpFlag);
|
cmp = renderer->target(bounds(renderer), renderer->colorSpace(), impl.cmpFlag);
|
||||||
|
|
Loading…
Add table
Reference in a new issue