summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsubhransu mohanty <sub.mohanty@samsung.com>2017-12-20 14:12:03 +0900
committersubhransu mohanty <sub.mohanty@samsung.com>2018-04-12 13:51:52 +0900
commit48fa47e5ffbc3502d6c031159373e43450d310e1 (patch)
tree4dd01fc629f3c1155c39d8f19693ae2e363ada36
parent7fc9a6060c71b6781f948a3d4e3f9c378cdd4062 (diff)
lottie: make all path objects derive from drawable object.
-rw-r--r--ssg/src/lottie/lottiemodel.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/ssg/src/lottie/lottiemodel.h b/ssg/src/lottie/lottiemodel.h
index 29e8fbe65b..8b6c562207 100644
--- a/ssg/src/lottie/lottiemodel.h
+++ b/ssg/src/lottie/lottiemodel.h
@@ -279,25 +279,34 @@ public:
279 std::shared_ptr<LottieShapeData> mShapeData; 279 std::shared_ptr<LottieShapeData> mShapeData;
280}; 280};
281 281
282class LottieShapeObject : public LottieObject 282class LottieDrawableObject : public LottieObject
283{
284public:
285 LottieDrawableObject(LottieObject::Type type):LottieObject(type){}
286public:
287 std::vector<std::shared_ptr<LottieObject>> mPathOperations;
288 std::vector<std::shared_ptr<LottieObject>> mPaintOperations;
289};
290
291class LottieShapeObject : public LottieDrawableObject
283{ 292{
284public: 293public:
285 void accept(LottieObjectVisitor *visitor) final 294 void accept(LottieObjectVisitor *visitor) final
286 {visitor->visit(this);} 295 {visitor->visit(this);}
287 void process(); 296 void process();
288 LottieShapeObject():LottieObject(LottieObject::Type::Shape){} 297 LottieShapeObject():LottieDrawableObject(LottieObject::Type::Shape){}
289 LottieObject *copy() {return new LottieShapeObject(*this);} 298 LottieObject *copy() {return new LottieShapeObject(*this);}
290public: 299public:
291 LottieAnimatable<LottieShape> mShape; 300 LottieAnimatable<LottieShape> mShape;
292 bool mClosed = false; 301 bool mClosed = false;
293}; 302};
294 303
295class LottieRectObject : public LottieObject 304class LottieRectObject : public LottieDrawableObject
296{ 305{
297public: 306public:
298 void accept(LottieObjectVisitor *visitor) final 307 void accept(LottieObjectVisitor *visitor) final
299 {visitor->visit(this);} 308 {visitor->visit(this);}
300 LottieRectObject():LottieObject(LottieObject::Type::Rect), 309 LottieRectObject():LottieDrawableObject(LottieObject::Type::Rect),
301 mPos(SGPointF(0,0)), 310 mPos(SGPointF(0,0)),
302 mSize(SGPointF(0,0)), 311 mSize(SGPointF(0,0)),
303 mRound(0){} 312 mRound(0){}
@@ -308,12 +317,12 @@ public:
308 LottieAnimatable<float> mRound; 317 LottieAnimatable<float> mRound;
309}; 318};
310 319
311class LottieEllipseObject : public LottieObject 320class LottieEllipseObject : public LottieDrawableObject
312{ 321{
313public: 322public:
314 void accept(LottieObjectVisitor *visitor) final 323 void accept(LottieObjectVisitor *visitor) final
315 {visitor->visit(this);} 324 {visitor->visit(this);}
316 LottieEllipseObject():LottieObject(LottieObject::Type::Ellipse), 325 LottieEllipseObject():LottieDrawableObject(LottieObject::Type::Ellipse),
317 mPos(SGPointF(0,0)), 326 mPos(SGPointF(0,0)),
318 mSize(SGPointF(0,0)){} 327 mSize(SGPointF(0,0)){}
319 LottieObject *copy() {return new LottieEllipseObject(*this);} 328 LottieObject *copy() {return new LottieEllipseObject(*this);}