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:
Hermet Park 2025-07-17 14:38:30 +09:00 committed by Hermet Park
parent bc4afd8ef7
commit a80b0aa188

View file

@ -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);