}
VPainter painter(&bitmap);
- VRle mask;
- mRootLayer->render(&painter, mask, nullptr);
+ mRootLayer->render(&painter, {}, {}, nullptr);
return true;
}
return mRle;
}
-void LOTLayerItem::render(VPainter *painter, const VRle &inheritMask, LOTLayerItem *matteSource)
+void LOTLayerItem::render(VPainter *painter, const VRle &inheritMask, const VRle &inheritMatte, LOTLayerItem *matteSource)
{
VRle matteRle;
if (matteSource) {
for (auto &i : mDrawableList) {
matteRle = matteRle + i->rle();
}
+
+ if (!inheritMatte.isEmpty())
+ matteRle = matteRle & inheritMatte;
+ } else {
+ matteRle = inheritMatte;
}
mDrawableList.clear();
renderList(mDrawableList);
}
}
-void LOTCompLayerItem::render(VPainter *painter, const VRle &inheritMask, LOTLayerItem *matteSource)
+void LOTCompLayerItem::render(VPainter *painter, const VRle &inheritMask, const VRle &inheritMatte, LOTLayerItem *matteSource)
{
VRle matteRle;
if (matteSource) {
for (auto &i : mDrawableList) {
matteRle = matteRle + i->rle();
}
+
+ if (!inheritMatte.isEmpty())
+ matteRle = matteRle & inheritMatte;
+ } else {
+ matteRle = inheritMatte;
}
VRle mask;
}
if (matteLayer) {
- matteLayer->render(painter, mask, layer);
+ matteLayer->render(painter, mask, matteRle, layer);
matteLayer = nullptr;
} else {
- layer->render(painter, mask, nullptr);
+ layer->render(painter, mask, matteRle, nullptr);
}
}
}
VMatrix matrix(int frameNo) const;
virtual void renderList(std::vector<VDrawable *> &list){}
virtual void updateStaticProperty();
- virtual void render(VPainter *painter, const VRle &mask, LOTLayerItem *matteSource);
+ virtual void render(VPainter *painter, const VRle &mask, const VRle &inheritMatte, LOTLayerItem *matteSource);
bool hasMatte() { if (mLayerData->mMatteType == MatteType::None) return false; return true; }
protected:
LOTCompLayerItem(LOTLayerData *layerData);
void renderList(std::vector<VDrawable *> &list)final;
void updateStaticProperty() final;
- void render(VPainter *painter, const VRle &mask, LOTLayerItem *matteSource) final;
+ void render(VPainter *painter, const VRle &mask, const VRle &inheritMatte, LOTLayerItem *matteSource) final;
protected:
void updateContent() final;
private: