vector: Add name member in VDrawable
authorJunsuChoi <jsuya.choi@samsung.com>
Tue, 10 Mar 2020 09:31:55 +0000 (18:31 +0900)
committerHermet Park <chuneon.park@samsung.com>
Thu, 12 Mar 2020 10:01:31 +0000 (19:01 +0900)
for expose of keypath.

Change-Id: I907fcdcc76b0f66e294e4df5073de39bb8bba549

src/vector/vdrawable.cpp
src/vector/vdrawable.h

index 7245d5fa565d541d564a68836ad54cd451038cde..2102e82ab61248c8ad4504fc355fc20644e84809 100644 (file)
@@ -34,6 +34,7 @@ VDrawable::~VDrawable()
             delete mStrokeInfo;
         }
     }
+    if (mName) free(mName);
 }
 
 void VDrawable::setType(VDrawable::Type type)
index 6120efce3976181ceefe3793f8767b7f94738390..56aefa71f6d8ed54ea7981d3bfa265a86e3130f2 100644 (file)
@@ -19,6 +19,7 @@
 #ifndef VDRAWABLE_H
 #define VDRAWABLE_H
 #include <future>
+#include <cstring>
 #include "vbrush.h"
 #include "vpath.h"
 #include "vrle.h"
@@ -54,6 +55,11 @@ public:
     void preprocess(const VRect &clip);
     void applyDashOp();
     VRle rle();
+    void setName(const char *name)
+    {
+        if (name) mName = strdup(name);
+    }
+    char* name() const { return mName; }
 
 public:
     struct StrokeInfo {
@@ -76,6 +82,8 @@ public:
     DirtyFlag                mFlag{DirtyState::All};
     FillRule                 mFillRule{FillRule::Winding};
     VDrawable::Type          mType{Type::Fill};
+
+    char                     *mName{nullptr};
 };
 
 #endif  // VDRAWABLE_H