lottie/vector: added reset() api to VRle class.

Change-Id: Iace73912f6ab4510c0adb15387029e2038ad15be
This commit is contained in:
subhransu mohanty
2018-08-01 11:43:37 +09:00
parent 14f66bb3b5
commit 79af60fc2f
2 changed files with 16 additions and 0 deletions

View File

@@ -291,6 +291,7 @@ public:
void translate(const VPoint &pt);
void opAdd(const VRleImpl &other, VRleImpl &res);
VRect bbox();
void reset();
public:
VRect m_bbox;
@@ -327,6 +328,14 @@ VRect VRleImpl::bbox()
return m_bbox;
}
void VRleImpl::reset()
{
m_spans.clear();
m_bbox = VRect();
mOffset = VPoint();
mBboxDirty = false;
}
void VRleImpl::translate(const VPoint &pt)
{
// take care of last offset if applied
@@ -759,6 +768,12 @@ const VRle::Span *VRle::data() const
return d->impl.m_spans.data();
}
void VRle::reset()
{
detach();
d->impl.reset();
}
VRle VRle::toRle(const VRect &rect)
{
if (rect.isEmpty()) return VRle();

View File

@@ -35,6 +35,7 @@ public:
VRle &intersect(const VRect &r);
int size() const;
const VRle::Span * data() const;
void reset();
VRle operator~() const;
VRle operator+(const VRle &o) const;
VRle operator-(const VRle &o) const;