VRle mask = inheritMask;
if (hasMask()) {
if (mask.isEmpty())
- mask = maskRle();
+ mask = maskRle(painter->clipBoundingRect());
else
mask = mask & inheritMask;
}
}
}
-VRle LOTLayerItem::maskRle()
+VRle LOTLayerItem::maskRle(const VRect &clipRect)
{
VRle rle;
for (auto &i : mMasks) {
break;
}
case LOTMaskData::Mode::Substarct: {
- if (rle.isEmpty() && !mBoundingRect.isEmpty())
- rle = VRle::toRle(mBoundingRect);
+ if (rle.isEmpty() && !clipRect.isEmpty())
+ rle = VRle::toRle(clipRect);
rle = rle - i->mRle;
break;
}
if (hasMask()) {
if (mask.isEmpty())
- mask = maskRle();
+ mask = maskRle(painter->clipBoundingRect());
else
mask = mask & inheritMask;
}
float opacity(int frameNo) const;
bool visible() const;
inline DirtyFlag flag() const {return mDirtyFlag;}
- VRle maskRle();
+ VRle maskRle(const VRect &clipRect);
bool hasMask() const {return !mMasks.empty();}
protected:
std::vector<std::unique_ptr<LOTMaskItem>> mMasks;
float mCombinedAlpha;
int mFrameNo;
DirtyFlag mDirtyFlag;
- VRectF mBoundingRect;
bool mVisible;
bool mStatic;
};
mImpl->drawRle(pos, rle);
}
+VRect VPainter::clipBoundingRect() const
+{
+ return mImpl->mSpanData.mSystemClip;
+}
+
V_END_NAMESPACE
void end();
void setBrush(const VBrush &brush);
void drawRle(const VPoint &pos, const VRle &rle);
+ VRect clipBoundingRect() const;
private:
VPainterImpl *mImpl;
};
return d->impl.m_spans.data();
}
-VRle VRle::toRle(const VRectF &rect)
+VRle VRle::toRle(const VRect &rect)
{
if (rect.isEmpty()) return VRle();
VRle operator+(const VRle &o) const;
VRle operator-(const VRle &o) const;
VRle operator&(const VRle &o) const;
- static VRle toRle(const VRectF &rect);
+ static VRle toRle(const VRect &rect);
friend VRle operator*(const VRle &, int alpha);
inline friend VRle operator*(int alpha, const VRle &);
friend VDebug& operator<<(VDebug& os, const VRle& object);