mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-02 17:16:58 +00:00
lottie/render: add new drawRle() api with rle clip support.
Change-Id: Ibcc16085e0df06da65f8a9f2367189d25c618a11
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user