From: joogab.yun Date: Fri, 22 Nov 2024 22:37:22 +0000 (+0900) Subject: Consider alpha values for complex shapes. X-Git-Tag: accepted/tizen/7.0/unified/20241125.162320^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_7.0;p=platform%2Fcore%2Fuifw%2Flottie-player.git Consider alpha values for complex shapes. Change-Id: I1c7a0a3d1c7aa730dc7f615e524f78e778447ae7 --- diff --git a/src/lottie/lottieitem.h b/src/lottie/lottieitem.h index d826def..9959771 100644 --- a/src/lottie/lottieitem.h +++ b/src/lottie/lottieitem.h @@ -220,6 +220,8 @@ public: void setParentLayer(Layer *parent) { mParentLayer = parent; } void setComplexContent(bool value) { mComplexContent = value; } bool complexContent() const { return mComplexContent; } + void setComplexShape(bool value) { mComplexShape = value; } + bool isComplexShape() { return mComplexShape; } virtual void update(int frameNo, const VMatrix &parentMatrix, float parentAlpha); VMatrix matrix(int frameNo) const; @@ -268,6 +270,7 @@ protected: bool mComplexContent{false}; std::unique_ptr mCApiData; bool mHasDynamicValue{false}; + bool mComplexShape{false}; }; class CompLayer final : public Layer { @@ -323,15 +326,12 @@ public: LOTVariant &value) override; void render(VPainter *painter, const VRle &mask, const VRle &matteRle, SurfaceCache &cache) final; - void setComplexShape(bool value) { mComplexShpae = value; } - bool isComplexShape() { return mComplexShpae; } protected: void preprocessStage(const VRect &clip) final; void updateContent() final; std::vector mDrawableList; Group * mRoot{nullptr}; - bool mComplexShpae{false}; }; class NullLayer final : public Layer { diff --git a/src/lottie/lottieitem_capi.cpp b/src/lottie/lottieitem_capi.cpp index 31ca54a..7bb3dba 100644 --- a/src/lottie/lottieitem_capi.cpp +++ b/src/lottie/lottieitem_capi.cpp @@ -89,6 +89,7 @@ void renderer::Layer::buildLayerNode() clayer().keypath = name(); } if (complexContent()) clayer().mAlpha = uint8_t(combinedAlpha() * 255.f); + if (isComplexShape()) clayer().mAlpha = uint8_t(combinedAlpha() * 255.f); clayer().mVisible = visible(); // update matte if (hasMatte()) {