sw_engine: fixing overlapping masks
authorMira Grudzinska <m.grudzinska@samsung.com>
Wed, 28 Apr 2021 12:10:25 +0000 (14:10 +0200)
committerHermet Park <chuneon.park@samsung.com>
Fri, 30 Apr 2021 10:31:22 +0000 (19:31 +0900)
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.

src/lib/tvgPaint.cpp

index b40b529..987ddae 100644 (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);