common: nothing was rendered after an empty masked node came across
[platform/core/graphics/tizenvg.git] / src / lib / tvgFill.h
index bb6377a..4251849 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2020-2021 Samsung Electronics Co., Ltd. All rights reserved.
 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -50,6 +50,7 @@ struct FillDup : DuplicateMethod<Fill>
 struct Fill::Impl
 {
     ColorStop* colorStops = nullptr;
+    Matrix* transform = nullptr;
     uint32_t cnt = 0;
     FillSpread spread;
     DuplicateMethod<Fill>* dup = nullptr;
@@ -57,7 +58,8 @@ struct Fill::Impl
     ~Impl()
     {
         if (dup) delete(dup);
-        if (colorStops) free(colorStops);
+        free(colorStops);
+        free(transform);
     }
 
     void method(DuplicateMethod<Fill>* dup)
@@ -74,7 +76,10 @@ struct Fill::Impl
         ret->pImpl->spread = spread;
         ret->pImpl->colorStops = static_cast<ColorStop*>(malloc(sizeof(ColorStop) * cnt));
         memcpy(ret->pImpl->colorStops, colorStops, sizeof(ColorStop) * cnt);
-
+        if (transform) {
+            ret->pImpl->transform = static_cast<Matrix*>(malloc(sizeof(Matrix)));
+            *ret->pImpl->transform = *transform;
+        }
         return ret;
     }
 };