svg_loader: No skip luma mask when composition node is image 58/289758/1
authorJunsuChoi <jsuya.choi@samsung.com>
Wed, 31 Aug 2022 09:07:40 +0000 (18:07 +0900)
committerMichal Szczecinski <mihashco89@gmail.com>
Tue, 14 Mar 2023 06:44:25 +0000 (07:44 +0100)
Improved to skip Luma Mask when conditions are the same
as AlphaMask for optimization in e409bb29.
If the composition node is an image, it is not skipped because
it is not known for sure whether to skip it.

Change-Id: I82d1c5ab0ad4bf9624913a574556ea7ae7709a7e

src/loaders/svg/tvgSvgSceneBuilder.cpp

index a898473..ae0e498 100644 (file)
@@ -659,7 +659,10 @@ static unique_ptr<Scene> _sceneBuildHelper(const SvgNode* node, const Box& vBox,
                         scene->push(_sceneBuildHelper(*child, vBox, svgPath, false, isMaskWhite));
                 } else if ((*child)->type == SvgNodeType::Image) {
                     auto image = _imageBuildHelper(*child, vBox, svgPath);
-                    if (image) scene->push(move(image));
+                    if (image) {
+                        scene->push(move(image));
+                        if (isMaskWhite) *isMaskWhite = false;
+                    }
                 } else if ((*child)->type != SvgNodeType::Mask) {
                     auto shape = _shapeBuildHelper(*child, vBox, svgPath);
                     if (shape) {