lottie/vector: move all vector objects to its own namesapce 48/184148/3
authorsubhransu sekhar mohanty <smohantty@subhransus-MacBook-Air.local>
Sun, 15 Jul 2018 02:59:30 +0000 (11:59 +0900)
committerHermet Park <chuneon.park@samsung.com>
Mon, 16 Jul 2018 12:17:13 +0000 (12:17 +0000)
Change-Id: I1f7ebc743b45d2ae0857f5d645ca1495e382b3c3

30 files changed:
src/lottie/lottieitem.h
src/lottie/lottiemodel.h
src/vector/vbezier.cpp
src/vector/vbezier.h
src/vector/vbitmap.cpp
src/vector/vbitmap.h
src/vector/vbrush.cpp
src/vector/vbrush.h
src/vector/vdasher.cpp
src/vector/vdasher.h
src/vector/vdrawhelper.h
src/vector/vglobal.h
src/vector/vinterpolator.cpp
src/vector/vinterpolator.h
src/vector/vmatrix.cpp
src/vector/vmatrix.h
src/vector/vpainter.cpp
src/vector/vpainter.h
src/vector/vpath.cpp
src/vector/vpath.h
src/vector/vpathmesure.cpp
src/vector/vpathmesure.h
src/vector/vpoint.h
src/vector/vraster.cpp
src/vector/vraster.h
src/vector/vrect.h
src/vector/vregion.cpp
src/vector/vregion.h
src/vector/vrle.cpp
src/vector/vrle.h

index 829ac07..d6e9261 100644 (file)
@@ -12,6 +12,8 @@
 #include"vbrush.h"
 #include"vpainter.h"
 
+V_USE_NAMESPACE
+
 enum class DirtyFlagBit
 {
    None   = 0x0001,
index 80cca54..e6c5d9d 100644 (file)
@@ -12,6 +12,7 @@
 #include"vbrush.h"
 #include"vpath.h"
 
+V_USE_NAMESPACE
 
 class LOTCompositionData;
 class LOTLayerData;
index 3ae1e1d..34e5093 100644 (file)
@@ -2,6 +2,8 @@
 
 #include<cmath>
 
+V_BEGIN_NAMESPACE
+
 // Approximate sqrt(x*x + y*y) using the alpha max plus beta min algorithm.
 // This uses alpha = 1, beta = 3/8, which results in a maximum error of less
 // than 7% compared to the correct value.
@@ -112,5 +114,5 @@ VBezier::splitAtLength(float len, VBezier *left, VBezier *right)
    right->parameterSplitLeft(t, left);
 }
 
-
+V_END_NAMESPACE
 
index 92f4418..dd3f4cf 100644 (file)
@@ -3,6 +3,8 @@
 
 #include <vpoint.h>
 
+V_BEGIN_NAMESPACE
+
 class  VBezier
 {
 public:
@@ -106,5 +108,6 @@ inline void VBezier::split(VBezier *firstHalf, VBezier *secondHalf) const
     firstHalf->y4 = secondHalf->y1 = (firstHalf->y3 + secondHalf->y2)*.5;
 }
 
+V_END_NAMESPACE
 
 #endif //VBEZIER_H
index 4746df9..a8edd23 100644 (file)
@@ -2,6 +2,8 @@
 #include "vglobal.h"
 #include<string.h>
 
+V_BEGIN_NAMESPACE
+
 struct VBitmapData
 {
     ~VBitmapData();
@@ -280,3 +282,4 @@ void VBitmap::fill(uint pixel)
         return;
 }
 
+V_END_NAMESPACE
index 5017063..ca3f2a1 100644 (file)
@@ -3,6 +3,8 @@
 
 #include "vrect.h"
 
+V_BEGIN_NAMESPACE
+
 struct VBitmapData;
 typedef void (*VBitmapCleanupFunction)(void *);
 class VBitmap
@@ -44,4 +46,6 @@ private:
     VBitmapData    *d;
 };
 
+V_END_NAMESPACE
+
 #endif // VBITMAP_H
index aa8ba96..55b015d 100644 (file)
@@ -1,5 +1,7 @@
 #include"vbrush.h"
 
+V_BEGIN_NAMESPACE
+
 VGradient::VGradient(VGradient::Type type):mType(type), mSpread(VGradient::Spread::Pad), mMode(VGradient::Mode::Absolute)
 {
 
@@ -75,3 +77,5 @@ VBrush::VBrush(const VGradient *gradient):mType(VBrush::Type::NoBrush)
         mType = VBrush::Type::RadialGradient;
     }
 }
+
+V_END_NAMESPACE
index e93c9b1..772019f 100644 (file)
@@ -6,6 +6,8 @@
 #include"vmatrix.h"
 #include<vector>
 
+V_BEGIN_NAMESPACE
+
 typedef std::pair<float, VColor>  VGradientStop;
 typedef std::vector<VGradientStop> VGradientStops;
 class VGradient
@@ -79,4 +81,6 @@ public:
     const VGradient   *mGradient;
 };
 
+V_END_NAMESPACE
+
 #endif // VBRUSH_H
index f819bf9..8c9f738 100644 (file)
@@ -1,6 +1,8 @@
 #include"vdasher.h"
 #include"vbezier.h"
 
+V_BEGIN_NAMESPACE
+
 class VLine
 {
 public:
@@ -238,3 +240,4 @@ VPath VDasher::dashed(const VPath &path)
     return mDashedPath;
 }
 
+V_END_NAMESPACE
index ed97558..5b5c66d 100644 (file)
@@ -1,6 +1,9 @@
 #ifndef VDASHER_H
 #define VDASHER_H
 #include "vpath.h"
+
+V_BEGIN_NAMESPACE
+
 class VDasher
 {
  public:
@@ -26,4 +29,7 @@ private:
     float                  mDashOffset;
     VPath                 mDashedPath;
 };
+
+V_END_NAMESPACE
+
 #endif // VDASHER_H
index 0826f00..b480705 100644 (file)
@@ -9,6 +9,8 @@
 #include"assert.h"
 #include<cstring>
 
+V_USE_NAMESPACE
+
 struct VSpanData;
 struct Operator;
 
index fb96f30..aa9e617 100644 (file)
@@ -12,6 +12,20 @@ typedef uint16_t         ushort;
 typedef uint8_t          uchar;
 
 
+#if !defined(V_NAMESPACE)
+
+# define V_USE_NAMESPACE
+# define V_BEGIN_NAMESPACE
+# define V_END_NAMESPACE
+
+#else /* user namespace */
+
+# define V_USE_NAMESPACE using namespace ::V_NAMESPACE;
+# define V_BEGIN_NAMESPACE namespace V_NAMESPACE {
+# define V_END_NAMESPACE }
+
+#endif
+
 #define V_UNUSED __attribute__((__unused__))
 #define V_REQUIRED_RESULT __attribute__ ((__warn_unused_result__))
 
index 5c285f6..90f0936 100644 (file)
@@ -1,6 +1,8 @@
 #include"vinterpolator.h"
 #include<cmath>
 
+V_BEGIN_NAMESPACE
+
 #define NEWTON_ITERATIONS          4
 #define NEWTON_MIN_SLOPE           0.02
 #define SUBDIVISION_PRECISION      0.0000001
@@ -128,3 +130,5 @@ VInterpolator::BinarySubdivide(float aX, float aA, float aB) const
 
   return currentT;
 }
+
+V_END_NAMESPACE
index 23c78e8..f609d0c 100644 (file)
@@ -3,6 +3,8 @@
 
 #include "vpoint.h"
 
+V_BEGIN_NAMESPACE
+
 class VInterpolator
 {
 public:
@@ -76,4 +78,7 @@ private:
     float mSampleValues[kSplineTableSize];
     static const float kSampleStepSize;
 };
+
+V_END_NAMESPACE
+
 #endif // VINTERPOLATOR_H
index 9f47484..ad5192d 100644 (file)
@@ -4,6 +4,8 @@
 #include<cassert>
 #include<vglobal.h>
 
+V_BEGIN_NAMESPACE
+
 /*  m11  m21  mtx
  *  m12  m22  mty
  *  m13  m23  m33
@@ -832,4 +834,5 @@ float VMatrix::m33()const
     return d->m33;
 }
 
+V_END_NAMESPACE
 
index 4e43b47..10c632a 100644 (file)
@@ -4,6 +4,8 @@
 #include "vregion.h"
 #include "vglobal.h"
 
+V_BEGIN_NAMESPACE
+
 struct VMatrixData;
 class  VMatrix
 {
@@ -89,4 +91,6 @@ inline VPointF VMatrix::map(float x, float y) const
     return map(VPointF(x, y));
 }
 
+V_END_NAMESPACE
+
 #endif // VMATRIX_H
index 5d3f4eb..56fbf41 100644 (file)
@@ -1,6 +1,8 @@
 #include"vpainter.h"
 #include"vdrawhelper.h"
 
+V_BEGIN_NAMESPACE
+
 class VPainterImpl
 {
 public:
@@ -62,3 +64,5 @@ void VPainter::drawRle(const VPoint &pos, const VRle &rle)
 {
     mImpl->drawRle(pos, rle);
 }
+
+V_END_NAMESPACE
index 740f732..d7977fb 100644 (file)
@@ -5,6 +5,8 @@
 #include"vrle.h"
 #include"vbrush.h"
 
+V_BEGIN_NAMESPACE
+
 class VBitmap;
 class VPainterImpl;
 class VPainter {
@@ -24,4 +26,6 @@ private:
     VPainterImpl  *mImpl;
 };
 
+V_END_NAMESPACE
+
 #endif //VPAINTER_H
index 60f4c92..4df2918 100644 (file)
@@ -5,6 +5,8 @@
 #include"vbezier.h"
 #include "vrect.h"
 
+V_BEGIN_NAMESPACE
+
 struct VPathData
 {
     void copy(VPathData *o);
@@ -733,3 +735,5 @@ void VPath::transform(const VMatrix &m)
     detach();
     d->transform(m);
 }
+
+V_END_NAMESPACE
index 93c4f53..2fe0b9d 100644 (file)
@@ -5,6 +5,8 @@
 #include "vmatrix.h"
 #include<vector>
 
+V_BEGIN_NAMESPACE
+
 struct VPathData;
 class VPath
 {
@@ -77,4 +79,6 @@ inline void VPath::cubicTo(float c1x, float c1y, float c2x, float c2y, float ex,
       cubicTo(VPointF(c1x, c1y), VPointF(c2x, c2y), VPointF(ex, ey));
 }
 
+V_END_NAMESPACE
+
 #endif // VPATH_H
index 358721c..cabbe42 100644 (file)
@@ -1,6 +1,10 @@
 #include"vpathmesure.h"
 
+V_BEGIN_NAMESPACE
+
 class VPathMesureData
 {
    VPath      *path;
-};
\ No newline at end of file
+};
+
+V_END_NAMESPACE
index 98605f7..0a97fc1 100644 (file)
@@ -3,6 +3,8 @@
 
 #include "vpath.h"
 
+V_BEGIN_NAMESPACE
+
 class VPathMesureData;
 class VPathMesure
 {
@@ -15,4 +17,6 @@ private:
     VPathMesureData *d;
 };
 
+V_END_NAMESPACE
+
 #endif // VPATHMESURE_H
index 7eb2af5..9206856 100644 (file)
@@ -3,6 +3,8 @@
 
 #include"vglobal.h"
 
+V_BEGIN_NAMESPACE
+
 class  VPointF
 {
 public:
@@ -144,4 +146,6 @@ inline VSize &VSize::operator+=(const VSize &p) noexcept
 inline VSize &VSize::operator-=(const VSize &p) noexcept
 { mw-=p.mw; mh-=p.mh; return *this;  }
 
+V_END_NAMESPACE
+
 #endif // VPOINT_H
index 0bd3a2c..3328977 100644 (file)
@@ -6,6 +6,8 @@
 #include<cstring>
 #include"vdebug.h"
 
+V_BEGIN_NAMESPACE
+
 struct FTOutline
 {
 public:
@@ -312,3 +314,5 @@ VRle VRaster::generateStrokeInfo(const FTOutline *outline, CapStyle cap, JoinSty
     return d->generateStrokeInfoAsync(&outline->ft, ftCap, ftJoin,
                                       ftWidth, ftMeterLimit, ftbool);
 }
+
+V_END_NAMESPACE
index 7beda50..5b8d0ad 100644 (file)
@@ -3,6 +3,8 @@
 #include"vrle.h"
 #include<future>
 
+V_BEGIN_NAMESPACE
+
 struct FTOutline;
 class VPath;
 
@@ -30,4 +32,7 @@ private:
     VRaster();
     VRasterPrivate *d;
 };
+
+V_END_NAMESPACE
+
 #endif // VRASTER_H
index 0f002df..c16ecab 100644 (file)
@@ -3,6 +3,8 @@
 #include"vglobal.h"
 #include"vpoint.h"
 
+V_BEGIN_NAMESPACE
+
 class  VRect
 {
 public:
@@ -181,4 +183,6 @@ V_CONSTEXPR inline float VRectF::width() const
 V_CONSTEXPR inline float VRectF::height() const
 { return y2 - y1; }
 
+V_END_NAMESPACE
+
 #endif // VRECT_H
index 3db9ad2..a0cd00e 100644 (file)
@@ -2041,6 +2041,8 @@ typedef region_type_t VRegionPrivate;
 
 #include "vregion.h"
 
+V_BEGIN_NAMESPACE
+
 static VRegionPrivate regionPrivate = {{0,0,0,0}, NULL};
 const VRegion::VRegionData VRegion::shared_empty = {RefCount(-1), &regionPrivate};
 
@@ -2366,3 +2368,5 @@ VDebug& operator<<(VDebug& os, const VRegion& o)
 
 }
 
+V_END_NAMESPACE
+
index 75e7c38..e5986af 100644 (file)
@@ -6,6 +6,8 @@
 #include<vpoint.h>
 #include<utility>
 
+V_BEGIN_NAMESPACE
+
 typedef struct pixman_region  region_type_t;
 typedef region_type_t VRegionPrivate;
 
@@ -70,4 +72,7 @@ inline VRegion VRegion::translated(int dx, int dy) const
 {
     return translated(VPoint(dx,dy));
 }
+
+V_END_NAMESPACE
+
 #endif //VREGION_H
index a7a70de..df0f24e 100644 (file)
@@ -8,6 +8,8 @@
 #include"vdebug.h"
 #include"vregion.h"
 
+V_BEGIN_NAMESPACE
+
 struct VRleHelper
 {
    ushort        alloc;
@@ -804,6 +806,7 @@ VDebug& operator<<(VDebug& os, const VRle& o)
     return os;
 }
 
+V_END_NAMESPACE
 
 
 
index 4697b1f..0fe3bcf 100644 (file)
@@ -4,6 +4,8 @@
 #include<vrect.h>
 #include<vpoint.h>
 
+V_BEGIN_NAMESPACE
+
 struct VRleData;
 class VRle
 {
@@ -59,4 +61,6 @@ inline VRle operator*(int alpha, const VRle &rle)
     return (rle * alpha);
 }
 
+V_END_NAMESPACE
+
 #endif // VRLE_H