lottie/render: add new drawRle() api with rle clip support.

Change-Id: Ibcc16085e0df06da65f8a9f2367189d25c618a11
This commit is contained in:
subhransu mohanty
2018-12-12 15:19:28 +09:00
parent 98b3a18265
commit 7e774a7bcd
2 changed files with 19 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ V_BEGIN_NAMESPACE
class VPainterImpl {
public:
void drawRle(const VPoint &pos, const VRle &rle);
void drawRle(const VRle &rle, const VRle &clip);
public:
VRasterBuffer mBuffer;
@@ -26,6 +27,17 @@ void VPainterImpl::drawRle(const VPoint &pos, const VRle &rle)
&mSpanData);
}
void VPainterImpl::drawRle(const VRle &rle, const VRle &clip)
{
if (rle.empty() || clip.empty()) return;
if (!mSpanData.mUnclippedBlendFunc) return;
rle.intersect(clip, mSpanData.mUnclippedBlendFunc,
&mSpanData);
}
VPainter::~VPainter()
{
delete mImpl;
@@ -61,6 +73,12 @@ void VPainter::drawRle(const VPoint &pos, const VRle &rle)
mImpl->drawRle(pos, rle);
}
void VPainter::drawRle(const VRle &rle, const VRle &clip)
{
mImpl->drawRle(rle, clip);
}
VRect VPainter::clipBoundingRect() const
{
return mImpl->mSpanData.mSystemClip;

View File

@@ -19,6 +19,7 @@ public:
void end();
void setBrush(const VBrush &brush);
void drawRle(const VPoint &pos, const VRle &rle);
void drawRle(const VRle &rle, const VRle &clip);
VRect clipBoundingRect() const;
private: