sw_engine: fixing overlapping masks

The buffer to which the mask is rastered is only partially cleared.
If the object to which the mask is applied overlaps an area where
another mask was used, an erroneous image is generated. The buffer
clearing area has been increased to the size of the object to which
the mask is applied.
This commit is contained in:
Mira Grudzinska 2021-04-28 14:10:25 +02:00 committed by Hermet Park
parent d7b3f0103e
commit 6601c93899

View file

@ -167,7 +167,7 @@ bool Paint::Impl::render(RenderMethod& renderer)
/* Note: only ClipPath is processed in update() step.
Create a composition image. */
if (cmpTarget && cmpMethod != CompositeMethod::ClipPath) {
auto region = cmpTarget->pImpl->bounds(renderer);
auto region = smethod->bounds(renderer);
if (region.w == 0 || region.h == 0) return false;
cmp = renderer.target(region);
renderer.beginComposite(cmp, CompositeMethod::None, 255);