lottie/render: add new drawRle() api with rle clip support. 77/195277/1
authorsubhransu mohanty <sub.mohanty@samsung.com>
Wed, 12 Dec 2018 06:19:28 +0000 (15:19 +0900)
committersubhransu mohanty <sub.mohanty@samsung.com>
Wed, 12 Dec 2018 06:19:28 +0000 (15:19 +0900)
Change-Id: Ibcc16085e0df06da65f8a9f2367189d25c618a11

src/vector/vpainter.cpp
src/vector/vpainter.h

index 1249e38..3ff3e89 100644 (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;
index 67942a2..cb3ec4e 100644 (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: