svg_loader: applying AlphaMask during scene building
authorMira Grudzinska <m.grudzinska@samsung.com>
Thu, 11 Mar 2021 16:20:41 +0000 (17:20 +0100)
committerJunsuChoi <jsuya.choi@samsung.com>
Mon, 22 Mar 2021 02:19:07 +0000 (11:19 +0900)
The AlphaMask composition case was omitted in the _sceneBuilderHelper().

src/loaders/svg/tvgSvgSceneBuilder.cpp

index af8952a..a32df10 100644 (file)
@@ -378,6 +378,16 @@ unique_ptr<Scene> _sceneBuildHelper(const SvgNode* node, float vx, float vy, flo
                         scene->composite(move(comp), CompositeMethod::ClipPath);
                     }
                 }
+                //Composite AlphaMask
+                if (((int)node->style->comp.flags & (int)SvgCompositeFlags::AlphaMask)) {
+                    auto compNode = node->style->comp.node;
+                    if (compNode->child.count > 0) {
+                        auto comp = Shape::gen();
+                        auto child = compNode->child.data;
+                        for (uint32_t i = 0; i < compNode->child.count; ++i, ++child) _appendChildShape(*child, comp.get(), vx, vy, vw, vh);
+                        scene->composite(move(comp), CompositeMethod::AlphaMask);
+                    }
+                }
             }
             scene->opacity(node->style->opacity);
         }