interface: updated Graident structure naming. 07/192807/2
authorHermet Park <hermetpark@gmail.com>
Fri, 9 Nov 2018 11:18:37 +0000 (20:18 +0900)
committerHermet Park <hermetpark@gmail.com>
Fri, 9 Nov 2018 11:21:52 +0000 (20:21 +0900)
Change-Id: Ib4b316afd353b0c4762c051bae0f3f277393cac2

example/lottieview.cpp
inc/lottiecommon.h
src/lottie/lottieitem.cpp

index bc7eb40..be9f2a1 100644 (file)
@@ -60,7 +60,7 @@ void LottieView::createVgNode(LOTNode *node, Efl_VG *parent)
         //evas_vg_shape_stroke_meter_limit_set(shape, node->mStroke.meterLimit);
     }
     // update paint info
-    if (node->mType == LOTBrushType::BrushSolid) {
+    if (node->mBrushType == LOTBrushType::BrushSolid) {
         int r = (node->mColor.r * node->mColor.a)/255;
         int g = (node->mColor.g * node->mColor.a)/255;
         int b = (node->mColor.b * node->mColor.a)/255;
@@ -71,7 +71,7 @@ void LottieView::createVgNode(LOTNode *node, Efl_VG *parent)
            evas_vg_node_color_set(shape, r, g, b, a);
         }
 
-    } else if (node->mType == LOTBrushType::BrushGradient) {
+    } else if (node->mBrushType == LOTBrushType::BrushGradient) {
         //TODO fill the gradient info
     }
 }
index dd65f9b..48db67e 100644 (file)
@@ -71,11 +71,11 @@ typedef enum
     GradientRadial
 } LOTGradientType;
 
-typedef struct
+typedef struct LOTGradientStop
 {
     float         pos;
     unsigned char r, g, b, a;
-}GradientStop;
+} LOTGradientStop;
 
 typedef struct LOTNode {
 
@@ -107,7 +107,7 @@ typedef struct LOTNode {
 
     struct {
         LOTGradientType type;
-        GradientStop *stopPtr;
+        LOTGradientStop *stopPtr;
         unsigned int stopCount;
         struct {
             float x, y;
@@ -117,7 +117,7 @@ typedef struct LOTNode {
     } mGradient;
 
     int       mFlag;
-    LOTBrushType mType;
+    LOTBrushType mBrushType;
     LOTFillRule  mFillRule;
 } LOTNode;
 
index bf9ffac..be40d97 100644 (file)
@@ -998,10 +998,10 @@ static void updateGStops(LOTNode *n, const VGradient *grad)
         if (n->mGradient.stopCount)
             free(n->mGradient.stopPtr);
         n->mGradient.stopCount = grad->mStops.size();
-        n->mGradient.stopPtr = (GradientStop *) malloc(n->mGradient.stopCount * sizeof(GradientStop));
+        n->mGradient.stopPtr = (LOTGradientStop *) malloc(n->mGradient.stopCount * sizeof(LOTGradientStop));
     }
 
-    GradientStop *ptr = n->mGradient.stopPtr;
+    LOTGradientStop *ptr = n->mGradient.stopPtr;
     for (const auto &i : grad->mStops) {
         ptr->pos = i.first;
         ptr->a = i.second.alpha() * grad->alpha();
@@ -1089,14 +1089,14 @@ void LOTDrawable::sync()
 
     switch (mBrush.type()) {
     case VBrush::Type::Solid:
-        mCNode->mType = LOTBrushType::BrushSolid;
+        mCNode->mBrushType = LOTBrushType::BrushSolid;
         mCNode->mColor.r = mBrush.mColor.r;
         mCNode->mColor.g = mBrush.mColor.g;
         mCNode->mColor.b = mBrush.mColor.b;
         mCNode->mColor.a = mBrush.mColor.a;
         break;
     case VBrush::Type::LinearGradient:
-        mCNode->mType = LOTBrushType::BrushGradient;
+        mCNode->mBrushType = LOTBrushType::BrushGradient;
         mCNode->mGradient.type = LOTGradientType::GradientLinear;
         mCNode->mGradient.start.x = mBrush.mGradient->linear.x1;
         mCNode->mGradient.start.y = mBrush.mGradient->linear.y1;
@@ -1105,7 +1105,7 @@ void LOTDrawable::sync()
         updateGStops(mCNode.get(), mBrush.mGradient);
         break;
     case VBrush::Type::RadialGradient:
-        mCNode->mType = LOTBrushType::BrushGradient;
+        mCNode->mBrushType = LOTBrushType::BrushGradient;
         mCNode->mGradient.type = LOTGradientType::GradientRadial;
         mCNode->mGradient.center.x = mBrush.mGradient->radial.cx;
         mCNode->mGradient.center.y = mBrush.mGradient->radial.cy;