lottie: remove the combined alpha value and method from path item

Alpha(opacity) values are not applied to path items.
Fill, Stroke and etc will handle opacity.

Change-Id: I8e05989e7f85797a00508c7ca151b1805d44f454
This commit is contained in:
Youngbok Shin
2018-08-21 18:56:06 +09:00
committed by Subhransu Mohanty
parent 25784d646a
commit 318151a35d
2 changed files with 4 additions and 12 deletions

View File

@@ -648,12 +648,11 @@ void LOTPathDataItem::addTrimOperation(std::vector<LOTTrimItem *> &list)
}
void LOTPathDataItem::update(int frameNo, const VMatrix &parentMatrix,
float parentAlpha, const DirtyFlag &flag)
float, const DirtyFlag &flag)
{
VPath tempPath;
mPathChanged = false;
mCombinedAlpha = parentAlpha;
// 1. update the local path if needed
if (!(mInit && mStaticPath) && hasChanged(frameNo)) {
@@ -825,10 +824,8 @@ void LOTFillItem::updateRenderNode(LOTPathDataItem *pathNode,
VDrawable *drawable, bool sameParent)
{
VColor color = mColor;
if (sameParent)
color.setAlpha(color.a * pathNode->combinedAlpha());
else
color.setAlpha(color.a * parentAlpha() * pathNode->combinedAlpha());
color.setAlpha(color.a * parentAlpha());
VBrush brush(color);
drawable->setBrush(brush);
drawable->setFillRule(mFillRule);
@@ -889,11 +886,8 @@ void LOTStrokeItem::updateRenderNode(LOTPathDataItem *pathNode,
VDrawable *drawable, bool sameParent)
{
VColor color = mColor;
if (sameParent)
color.setAlpha(color.a * pathNode->combinedAlpha());
else
color.setAlpha(color.a * parentAlpha() * pathNode->combinedAlpha());
color.setAlpha(color.a * parentAlpha());
VBrush brush(color);
drawable->setBrush(brush);
float scale = getScale(mParentMatrix);

View File

@@ -208,7 +208,6 @@ public:
void update(int frameNo, const VMatrix &parentMatrix, float parentAlpha, const DirtyFlag &flag) final;
VPath path() const;
void addTrimOperation(std::vector<LOTTrimItem *> &list);
inline float combinedAlpha() const{ return mCombinedAlpha;}
void renderList(std::vector<VDrawable *> &list) final;
private:
std::vector<LOTTrimItem *> mTrimNodeRefs;
@@ -219,7 +218,6 @@ private:
VPath mLocalPath;
VPath mFinalPath;
bool mPathChanged;
float mCombinedAlpha;
protected:
virtual void updatePath(VPath& path, int frameNo) = 0;
virtual bool hasChanged(int frameNo) = 0;