lottie: rename all isEmpty() api to empty() for consistancy. 20/188720/1
authorsub.mohanty@samsung.com <smohantty@gmail.com>
Sun, 9 Sep 2018 02:57:30 +0000 (11:57 +0900)
committersub.mohanty@samsung.com <smohantty@gmail.com>
Sun, 9 Sep 2018 02:57:30 +0000 (11:57 +0900)
Change-Id: Id3dddbd920ff00c7beafe0abd17f6da73442195b

src/lottie/lottieitem.cpp
src/vector/vdasher.cpp
src/vector/vpainter.cpp
src/vector/vpath.cpp
src/vector/vpath.h
src/vector/vpoint.h
src/vector/vraster.cpp
src/vector/vregion.cpp
src/vector/vregion.h
src/vector/vrle.h
test/testsgregion.cpp

index f03eccefe0901b40bffd69b104aae563cc376dc5..80e655ba6077c84116226c07e6780fddfe91cbc9 100644 (file)
@@ -129,7 +129,7 @@ void LOTMaskItem::update(int frameNo, const VMatrix &parentMatrix,
                          float parentAlpha, const DirtyFlag &/*flag*/)
 {
     if (mData->mShape.isStatic()) {
-        if (mLocalPath.isEmpty()) {
+        if (mLocalPath.empty()) {
             mData->mShape.value(frameNo).toPath(mLocalPath);
         }
     } else {
@@ -167,7 +167,7 @@ void LOTLayerItem::render(VPainter *painter, const VRle &inheritMask, const VRle
             matteRle = matteRle + i->rle();
         }
 
-        if (!inheritMatte.isEmpty())
+        if (!inheritMatte.empty())
             matteRle = matteRle & inheritMatte;
     } else {
         matteRle = inheritMatte;
@@ -178,10 +178,10 @@ void LOTLayerItem::render(VPainter *painter, const VRle &inheritMask, const VRle
     VRle mask;
     if (hasMask()) {
         mask = maskRle(painter->clipBoundingRect());
-        if (!inheritMask.isEmpty())
+        if (!inheritMask.empty())
             mask = mask & inheritMask;
         // if resulting mask is empty then return.
-        if (mask.isEmpty())
+        if (mask.empty())
             return;
     } else {
         mask = inheritMask;
@@ -190,11 +190,11 @@ void LOTLayerItem::render(VPainter *painter, const VRle &inheritMask, const VRle
     for (auto &i : mDrawableList) {
         painter->setBrush(i->mBrush);
         VRle rle = i->rle();
-        if (!mask.isEmpty()) rle = rle & mask;
+        if (!mask.empty()) rle = rle & mask;
 
-        if (rle.isEmpty()) continue;
+        if (rle.empty()) continue;
 
-        if (!matteRle.isEmpty()) {
+        if (!matteRle.empty()) {
             if (mLayerData->mMatteType == MatteType::AlphaInv) {
                 rle = rle - matteRle;
             } else {
@@ -215,7 +215,7 @@ VRle LOTLayerItem::maskRle(const VRect &clipRect)
             break;
         }
         case LOTMaskData::Mode::Substarct: {
-            if (rle.isEmpty() && !clipRect.empty())
+            if (rle.empty() && !clipRect.empty())
                 rle = VRle::toRle(clipRect);
             rle = rle - i->rle();
             break;
@@ -359,7 +359,7 @@ void LOTCompLayerItem::render(VPainter *painter, const VRle &inheritMask, const
             matteRle = matteRle + i->rle();
         }
 
-        if (!inheritMatte.isEmpty())
+        if (!inheritMatte.empty())
             matteRle = matteRle & inheritMatte;
     } else {
         matteRle = inheritMatte;
@@ -368,10 +368,10 @@ void LOTCompLayerItem::render(VPainter *painter, const VRle &inheritMask, const
     VRle mask;
     if (hasMask()) {
         mask = maskRle(painter->clipBoundingRect());
-        if (!inheritMask.isEmpty())
+        if (!inheritMask.empty())
             mask = mask & inheritMask;
         // if resulting mask is empty then return.
-        if (mask.isEmpty())
+        if (mask.empty())
             return;
     } else {
         mask = inheritMask;
index eedae3aa2d2f309ff120390062676da3a033b7b9..987668e5e9b84c1c4f8afe9da3deedced5f66239 100644 (file)
@@ -160,7 +160,7 @@ void VDasher::cubicTo(const VPointF &cp1, const VPointF &cp2, const VPointF &e)
 
 VPath VDasher::dashed(const VPath &path)
 {
-    if (path.isEmpty()) return VPath();
+    if (path.empty()) return VPath();
 
     mResult = VPath();
     mIndex = 0;
index 064f6345a07c348ca9d0bc0a4bd0d35b507e57a3..1249e3859062742a988befeec6c295485bd1d297 100644 (file)
@@ -14,7 +14,7 @@ public:
 
 void VPainterImpl::drawRle(const VPoint &pos, const VRle &rle)
 {
-    if (rle.isEmpty()) return;
+    if (rle.empty()) return;
     // mSpanData.updateSpanFunc();
 
     if (!mSpanData.mUnclippedBlendFunc) return;
index 57d4b4b31dcbc6a8c4c6e53003c16a596b234702..efb8a6c5bd881f8c85ef65699bca116e05ceac24 100644 (file)
@@ -79,7 +79,7 @@ void  VPath::VPathData::cubicTo(float cx1, float cy1, float cx2, float cy2,
 
 void VPath::VPathData::close()
 {
-    if (isEmpty()) return;
+    if (empty()) return;
 
     const VPointF &lastPt = m_points.back();
     if (!fuzzyCompare(mStartPoint, lastPt)) {
@@ -91,7 +91,7 @@ void VPath::VPathData::close()
 
 void VPath::VPathData::reset()
 {
-    if (isEmpty()) return;
+    if (empty()) return;
 
     m_elements.clear();
     m_points.clear();
@@ -123,7 +123,7 @@ void VPath::VPathData::arcTo(const VRectF &rect, float startAngle,
         curvesForArc(rect, startAngle, sweepLength, pts, &point_count);
 
     reserve(point_count + 1, point_count / 3 + 1);
-    if (isEmpty() || forceMoveTo) {
+    if (empty() || forceMoveTo) {
         moveTo(curve_start.x(), curve_start.y());
     } else {
         lineTo(curve_start.x(), curve_start.y());
index 24fce594a7315ff36c3072cd0fd4702d138a3259..567d99c8a6d3fc1a4e65559503e690ebf4064077 100644 (file)
@@ -14,7 +14,7 @@ public:
     enum class Direction { CCW, CW };
 
     enum class Element : uchar { MoveTo, LineTo, CubicTo, Close };
-    bool  isEmpty() const;
+    bool  empty() const;
     void  moveTo(const VPointF &p);
     void  moveTo(float x, float y);
     void  lineTo(const VPointF &p);
@@ -50,7 +50,7 @@ public:
 
 private:
     struct VPathData {
-        bool  isEmpty() const { return m_elements.empty(); }
+        bool  empty() const { return m_elements.empty(); }
         void  moveTo(float x, float y);
         void  lineTo(float x, float y);
         void  cubicTo(float cx1, float cy1, float cx2, float cy2, float ex, float ey);
@@ -89,9 +89,9 @@ private:
     vcow_ptr<VPathData> d;
 };
 
-inline bool VPath::isEmpty() const
+inline bool VPath::empty() const
 {
-    return d->isEmpty();
+    return d->empty();
 }
 
 inline void VPath::moveTo(const VPointF &p)
@@ -203,9 +203,9 @@ inline void VPath::addPolygon(float points, float radius, float roundness,
 
 inline void VPath::addPath(const VPath &path)
 {
-    if (path.isEmpty()) return;
+    if (path.empty()) return;
 
-    if (isEmpty()) {
+    if (empty()) {
         *this = path;
     } else {
         d.write().addPath(path.d.read());
index 3eb8ed5d663dafbdf72eb63c0b77ef1bb136d571..22bd8890be2dd892622ee52fe0a2ecfa88650203 100644 (file)
@@ -142,7 +142,7 @@ class VSize {
 public:
     VSize() = default;
     constexpr inline VSize(int w, int h) noexcept : mw(w), mh(h) {}
-    bool isEmpty() const {return (mw <= 0 || mh <= 0);}
+    bool empty() const {return (mw <= 0 || mh <= 0);}
     constexpr inline int  width() const noexcept { return mw; }
     constexpr inline int  height() const noexcept { return mh; }
     inline void           setWidth(int w) { mw = w; }
index 7d20723f787b6886a480567c16e565949bfc6781..b5e58f4ea1cf7da34868b52184e4057c8fe94601 100644 (file)
@@ -387,7 +387,7 @@ static RleTaskScheduler raster_scheduler;
 std::future<VRle> VRaster::generateFillInfo(VPath &&path, VRle &&rle,
                                             FillRule     fillRule)
 {
-    if (path.isEmpty()) {
+    if (path.empty()) {
         std::promise<VRle> promise;
         promise.set_value(VRle());
         return promise.get_future();
@@ -399,7 +399,7 @@ std::future<VRle> VRaster::generateStrokeInfo(VPath &&path, VRle &&rle, CapStyle
                                               JoinStyle join, float width,
                                               float meterLimit)
 {
-    if (path.isEmpty()) {
+    if (path.empty()) {
         std::promise<VRle> promise;
         promise.set_value(VRle());
         return promise.get_future();
index b5eab50895691e266b241f923435a76977a452b0..5944b63473256bb597bcc194d14e00b8ad28298a 100644 (file)
@@ -1868,14 +1868,14 @@ VRegion::~VRegion()
     if (!d->ref.deref()) cleanUp(d);
 }
 
-bool VRegion::isEmpty() const
+bool VRegion::empty() const
 {
     return d == &shared_empty || !PREFIX(_not_empty)(d->rgn);
 }
 
 void VRegion::translate(const VPoint &p)
 {
-    if (p == VPoint() || isEmpty()) return;
+    if (p == VPoint() || empty()) return;
 
     detach();
     PREFIX(_translate)(d->rgn, p.x(), p.y());
@@ -1910,7 +1910,7 @@ bool VRegion::contains(const VRect &r) const
 
 VRegion VRegion::united(const VRect &r) const
 {
-    if (isEmpty()) return r;
+    if (empty()) return r;
 
     if (contains(r)) {
         return *this;
@@ -1927,8 +1927,8 @@ VRegion VRegion::united(const VRect &r) const
 
 VRegion VRegion::united(const VRegion &r) const
 {
-    if (isEmpty()) return r;
-    if (r.isEmpty()) return *this;
+    if (empty()) return r;
+    if (r.empty()) return *this;
     if (d == r.d || PREFIX(_equal)(d->rgn, r.d->rgn)) return *this;
     VRegion result;
     result.detach();
@@ -1938,7 +1938,7 @@ VRegion VRegion::united(const VRegion &r) const
 
 VRegion VRegion::intersected(const VRect &r) const
 {
-    if (isEmpty() || r.empty()) return VRegion();
+    if (empty() || r.empty()) return VRegion();
 
     /* this is fully contained in r */
     if (within(r)) return *this;
@@ -1955,7 +1955,7 @@ VRegion VRegion::intersected(const VRect &r) const
 
 VRegion VRegion::intersected(const VRegion &r) const
 {
-    if (isEmpty() || r.isEmpty()) return VRegion();
+    if (empty() || r.empty()) return VRegion();
 
     VRegion result;
     result.detach();
@@ -1966,7 +1966,7 @@ VRegion VRegion::intersected(const VRegion &r) const
 
 VRegion VRegion::subtracted(const VRegion &r) const
 {
-    if (isEmpty() || r.isEmpty()) return *this;
+    if (empty() || r.empty()) return *this;
     if (d == r.d || PREFIX(_equal)(d->rgn, r.d->rgn)) return VRegion();
 
     VRegion result;
@@ -1977,7 +1977,7 @@ VRegion VRegion::subtracted(const VRegion &r) const
 
 int VRegion::rectCount() const
 {
-    if (isEmpty()) return 0;
+    if (empty()) return 0;
     return PREFIX(_n_rects)(d->rgn);
 }
 
@@ -2008,7 +2008,7 @@ VRegion VRegion::operator-(const VRegion &r) const
 
 VRegion &VRegion::operator+=(const VRect &r)
 {
-    if (isEmpty()) return *this = r;
+    if (empty()) return *this = r;
     if (r.empty()) return *this;
 
     if (contains(r)) {
@@ -2025,8 +2025,8 @@ VRegion &VRegion::operator+=(const VRect &r)
 
 VRegion &VRegion::operator+=(const VRegion &r)
 {
-    if (isEmpty()) return *this = r;
-    if (r.isEmpty()) return *this;
+    if (empty()) return *this = r;
+    if (r.empty()) return *this;
     if (d == r.d || PREFIX(_equal)(d->rgn, r.d->rgn)) return *this;
 
     detach();
@@ -2041,8 +2041,8 @@ VRegion &VRegion::operator-=(const VRegion &r)
 
 bool VRegion::operator==(const VRegion &r) const
 {
-    if (isEmpty()) return r.isEmpty();
-    if (r.isEmpty()) return isEmpty();
+    if (empty()) return r.empty();
+    if (r.empty()) return empty();
 
     if (d == r.d)
         return true;
@@ -2052,7 +2052,7 @@ bool VRegion::operator==(const VRegion &r) const
 
 VRect VRegion::boundingRect() const noexcept
 {
-    if (isEmpty()) return {};
+    if (empty()) return {};
     return box_to_rect(&d->rgn->extents);
 }
 
@@ -2064,7 +2064,7 @@ inline bool rect_intersects(const VRect &r1, const VRect &r2)
 
 bool VRegion::intersects(const VRegion &r) const
 {
-    if (isEmpty() || r.isEmpty()) return false;
+    if (empty() || r.empty()) return false;
 
     return PREFIX(_intersects)(d->rgn, r.d->rgn);
 }
index b312e68be7541b006c1e3e3463355a3e76410d40..e341b3525a107c87bca8b8e3e120fe104845b2c5 100644 (file)
@@ -20,7 +20,7 @@ public:
     ~VRegion();
     VRegion &      operator=(const VRegion &);
     VRegion &      operator=(VRegion &&);
-    bool           isEmpty() const;
+    bool           empty() const;
     bool           contains(const VRect &r) const;
     VRegion        united(const VRect &r) const;
     VRegion        united(const VRegion &r) const;
index e5ecc367b3e746fa239ffa3415b3a28dc9cd01fa..8790497582c3041d31d7d74bd8ff66b763bbb6a7 100644 (file)
@@ -19,7 +19,7 @@ public:
     };
     typedef void (*VRleSpanCb)(int count, const VRle::Span *spans,
                                void *userData);
-    bool  isEmpty() const;
+    bool  empty() const;
     VRect boundingRect() const;
     void  addSpan(const VRle::Span *span, int count);
 
@@ -44,7 +44,7 @@ private:
             Add,
             Xor
         };
-        bool  isEmpty() const { return mSpans.empty(); }
+        bool  empty() const { return mSpans.empty(); }
         void  addSpan(const VRle::Span *span, int count);
         void  updateBbox() const;
         VRect bbox() const;
@@ -66,9 +66,9 @@ private:
     vcow_ptr<VRleData> d;
 };
 
-inline bool VRle::isEmpty() const
+inline bool VRle::empty() const
 {
-    return d->isEmpty();
+    return d->empty();
 }
 
 inline void VRle::addSpan(const VRle::Span *span, int count)
@@ -93,7 +93,7 @@ inline void VRle::operator*=(int alpha)
 
 inline VRle VRle::operator&(const VRle &o) const
 {
-    if (isEmpty() || o.isEmpty()) return VRle();
+    if (empty() || o.empty()) return VRle();
 
     VRle result;
     result.d.write().opIntersect(d.read(), o.d.read());
@@ -103,8 +103,8 @@ inline VRle VRle::operator&(const VRle &o) const
 
 inline VRle VRle::operator+(const VRle &o) const
 {
-    if (isEmpty()) return o;
-    if (o.isEmpty()) return *this;
+    if (empty()) return o;
+    if (o.empty()) return *this;
 
     VRle result;
     result.d.write().opGeneric(d.read(), o.d.read(), VRleData::OpCode::Add);
@@ -114,8 +114,8 @@ inline VRle VRle::operator+(const VRle &o) const
 
 inline VRle VRle::operator^(const VRle &o) const
 {
-    if (isEmpty()) return o;
-    if (o.isEmpty()) return *this;
+    if (empty()) return o;
+    if (o.empty()) return *this;
 
     VRle result;
     result.d.write().opGeneric(d.read(), o.d.read(), VRleData::OpCode::Xor);
@@ -125,8 +125,8 @@ inline VRle VRle::operator^(const VRle &o) const
 
 inline VRle VRle::operator-(const VRle &o) const
 {
-    if (isEmpty()) return VRle();
-    if (o.isEmpty()) return *this;
+    if (empty()) return VRle();
+    if (o.empty()) return *this;
 
     VRle result;
     result.d.write().opSubstract(d.read(), o.d.read());
index ecaae0f65acd2c464e7cca60488cb668522f02f5..abdc4225b227392eefe06d195f689217194a3364 100644 (file)
@@ -42,16 +42,16 @@ TEST_F(VRegionTest, moveSemantics) {
     rgn1 = rect1;
     VRegion tmp;
     tmp = std::move(rgn1);
-    ASSERT_TRUE(rgn1.isEmpty());
+    ASSERT_TRUE(rgn1.empty());
 
     // move construction
     rgn1 = rect1;
     VRegion mvrgn = std::move(rgn1);
-    ASSERT_TRUE(rgn1.isEmpty());
+    ASSERT_TRUE(rgn1.empty());
     ASSERT_TRUE(mvrgn == rect1);
 }
 TEST_F(VRegionTest, isEmpty) {
-    ASSERT_TRUE(emptyRgn.isEmpty());
+    ASSERT_TRUE(emptyRgn.empty());
     ASSERT_TRUE(emptyRgn == VRegion());
     ASSERT_TRUE(emptyRgn.rectCount() == 0);
     ASSERT_TRUE(emptyRgn.boundingRect() == VRect());