lottie: save extra memory allocation by reusing FtOutline object. 69/185369/1
authorsubhransu mohanty <sub.mohanty@samsung.com>
Mon, 30 Jul 2018 05:22:11 +0000 (14:22 +0900)
committersubhransu mohanty <sub.mohanty@samsung.com>
Mon, 30 Jul 2018 05:22:11 +0000 (14:22 +0900)
Change-Id: Ib3574052524cd38cd106ba27620ac825eb6a3f2a

src/vector/vraster.cpp

index 19d2b07..5d8bb51 100644 (file)
@@ -260,10 +260,9 @@ VRle RleTask::operator()(FTOutline &outRef, SW_FT_Stroker &stroker)
         SW_FT_Stroker_ParseOutline(stroker, &outRef.ft, !outRef.ftClosed);
         SW_FT_Stroker_GetCounts(stroker, &points, &contors);
 
-        FTOutline strokeOutline;
-        strokeOutline.grow(points, contors);
+        outRef.grow(points, contors);
 
-        SW_FT_Stroker_Export(stroker, &strokeOutline.ft);
+        SW_FT_Stroker_Export(stroker, &outRef.ft);
 
         VRle                rle;
         SW_FT_Raster_Params params;
@@ -271,7 +270,7 @@ VRle RleTask::operator()(FTOutline &outRef, SW_FT_Stroker &stroker)
         params.flags = SW_FT_RASTER_FLAG_DIRECT | SW_FT_RASTER_FLAG_AA;
         params.gray_spans = &rleGenerationCb;
         params.user = &rle;
-        params.source = &strokeOutline;
+        params.source = &outRef;
 
         sw_ft_grays_raster.raster_render(nullptr, &params);