examples: terminate the same engine as was initialized 02/289002/1
authorMira Grudzinska <m.grudzinska@samsung.com>
Fri, 21 Jan 2022 22:45:03 +0000 (23:45 +0100)
committerMichal Szczecinski <mihashco89@gmail.com>
Mon, 27 Feb 2023 08:25:13 +0000 (09:25 +0100)
Change-Id: I3e1b3cbee003fa18fdec8b554588d3420473aa08

14 files changed:
src/examples/AnimateMasking.cpp
src/examples/GradientMasking.cpp
src/examples/GradientStroke.cpp
src/examples/InvMasking.cpp
src/examples/LumaMasking.cpp
src/examples/Masking.cpp
src/examples/MultiCanvas.cpp
src/examples/PictureJpg.cpp
src/examples/PicturePng.cpp
src/examples/PictureRaw.cpp
src/examples/Stress.cpp
src/examples/Svg.cpp
src/examples/Svg2.cpp
src/examples/Tvg.cpp

index 7f1ba23..48cbe70 100644 (file)
@@ -103,7 +103,7 @@ void tvgUpdateCmds(tvg::Canvas* canvas, float progress)
        You can update only necessary properties of this shape,
        while retaining other properties. */
 
-    // Translate mask object with its stroke & update 
+    // Translate mask object with its stroke & update
     pMaskShape->translate(0 , progress * 300);
     pMask->translate(0 , progress * 300);
 
index bafc21a..b8b88ea 100644 (file)
@@ -47,7 +47,7 @@ void tvgDrawCmds(tvg::Canvas* canvas)
     colorStops[1] = {1,255,255,255,255};
     fill->colorStops(colorStops,2);
     shape->fill(move(fill));
+
     shape->composite(move(mask), tvg::CompositeMethod::AlphaMask);
     canvas->push(move(shape));
 
@@ -79,7 +79,7 @@ void tvgDrawCmds(tvg::Canvas* canvas)
     colorStops1[1] = {1,1,255,255,255};
     fill1->colorStops(colorStops1,2);
     shape1->fill(move(fill1));
+
     shape1->composite(move(mask1), tvg::CompositeMethod::AlphaMask);
     canvas->push(move(shape1));
 
@@ -237,7 +237,7 @@ int main(int argc, char **argv)
         elm_shutdown();
 
         //Terminate ThorVG Engine
-        tvg::Initializer::term(tvg::CanvasEngine::Sw);
+        tvg::Initializer::term(tvgEngine);
 
     } else {
         cout << "engine is not supported" << endl;
index 8b04aa2..6e2b97e 100644 (file)
@@ -77,7 +77,7 @@ void tvgDrawCmds(tvg::Canvas* canvas)
 
     if (canvas->push(move(shape1)) != tvg::Result::Success) return;
 
-    // radial gradient stroke + duplicate 
+    // radial gradient stroke + duplicate
     auto shape2 = tvg::Shape::gen();
     shape2->appendCircle(600, 175, 100, 60);
     shape2->stroke(80);
index cd4b0a3..4b6eb31 100644 (file)
@@ -212,7 +212,7 @@ int main(int argc, char **argv)
         elm_shutdown();
 
         //Terminate ThorVG Engine
-        tvg::Initializer::term(tvg::CanvasEngine::Sw);
+        tvg::Initializer::term(tvgEngine);
 
     } else {
         cout << "engine is not supported" << endl;
index 45b1548..cb32d1b 100644 (file)
@@ -208,7 +208,7 @@ int main(int argc, char **argv)
         elm_shutdown();
 
         //Terminate ThorVG Engine
-        tvg::Initializer::term(tvg::CanvasEngine::Sw);
+        tvg::Initializer::term(tvgEngine);
 
     } else {
         cout << "engine is not supported" << endl;
index 8b63b0b..88be49a 100644 (file)
@@ -212,7 +212,7 @@ int main(int argc, char **argv)
         elm_shutdown();
 
         //Terminate ThorVG Engine
-        tvg::Initializer::term(tvg::CanvasEngine::Sw);
+        tvg::Initializer::term(tvgEngine);
 
     } else {
         cout << "engine is not supported" << endl;
index 006223f..f622a05 100644 (file)
@@ -178,7 +178,7 @@ void tvgGlTest(const char* name, const char* path, void* data)
     objData->name = strdup(name);
     objData->path = strdup(path);
 
-    Eo* win = (Eo*) data;   
+    Eo* win = (Eo*) data;
 
     Eo* view = elm_glview_add(win);
     elm_glview_mode_set(view, ELM_GLVIEW_ALPHA);
@@ -189,7 +189,7 @@ void tvgGlTest(const char* name, const char* path, void* data)
     evas_object_data_set(view, "objdata", reinterpret_cast<void*>(objData));
     evas_object_event_callback_add(view, EVAS_CALLBACK_DEL, gl_del, objData);
     evas_object_resize(view, SIZE, SIZE);
-    evas_object_move(view, (count % NUM_PER_LINE) * SIZE, SIZE * (count / NUM_PER_LINE)); 
+    evas_object_move(view, (count % NUM_PER_LINE) * SIZE, SIZE * (count / NUM_PER_LINE));
     evas_object_show(view);
 }
 
@@ -238,7 +238,7 @@ int main(int argc, char **argv)
         elm_shutdown();
 
         //Terminate ThorVG Engine
-        tvg::Initializer::term(tvg::CanvasEngine::Sw);
+        tvg::Initializer::term(tvgEngine);
 
     } else {
         cout << "engine is not supported" << endl;
index df56f3e..c04b34b 100644 (file)
@@ -169,7 +169,7 @@ int main(int argc, char **argv)
         elm_shutdown();
 
         //Terminate ThorVG Engine
-        tvg::Initializer::term(tvg::CanvasEngine::Sw);
+        tvg::Initializer::term(tvgEngine);
 
 
     } else {
index 0cbaedb..b43926a 100644 (file)
@@ -31,7 +31,7 @@ void tvgDrawCmds(tvg::Canvas* canvas)
 {
     if (!canvas) return;
 
-    //Background                            
+    //Background
     auto bg = tvg::Shape::gen();
     bg->appendRect(0, 0, WIDTH, HEIGHT, 0, 0);    //x, y, w, h, rx, ry
     bg->fill(255, 255, 255, 255);                 //r, g, b, a
@@ -175,7 +175,7 @@ int main(int argc, char **argv)
         elm_shutdown();
 
         //Terminate ThorVG Engine
-        tvg::Initializer::term(tvg::CanvasEngine::Sw);
+        tvg::Initializer::term(tvgEngine);
 
 
     } else {
index dcb86fc..ea6de16 100644 (file)
@@ -169,7 +169,7 @@ int main(int argc, char **argv)
         elm_shutdown();
 
         //Terminate ThorVG Engine
-        tvg::Initializer::term(tvg::CanvasEngine::Sw);
+        tvg::Initializer::term(tvgEngine);
 
     } else {
         cout << "engine is not supported" << endl;
index 004561b..cd8843d 100644 (file)
@@ -236,7 +236,7 @@ int main(int argc, char **argv)
         elm_shutdown();
 
         //Terminate ThorVG Engine
-        tvg::Initializer::term(tvg::CanvasEngine::Sw);
+        tvg::Initializer::term(tvgEngine);
 
     } else {
         cout << "engine is not supported" << endl;
index be4f357..53e9502 100644 (file)
@@ -181,7 +181,7 @@ int main(int argc, char **argv)
         elm_shutdown();
 
         //Terminate ThorVG Engine
-        tvg::Initializer::term(tvg::CanvasEngine::Sw);
+        tvg::Initializer::term(tvgEngine);
 
     } else {
         cout << "engine is not supported" << endl;
index a7c97da..011816e 100644 (file)
@@ -147,7 +147,7 @@ int main(int argc, char **argv)
         elm_shutdown();
 
         //Terminate ThorVG Engine
-        tvg::Initializer::term(tvg::CanvasEngine::Sw);
+        tvg::Initializer::term(tvgEngine);
 
     } else {
         cout << "engine is not supported" << endl;
index 51c6af8..5512f43 100644 (file)
@@ -181,7 +181,7 @@ int main(int argc, char **argv)
         elm_shutdown();
 
         //Terminate ThorVG Engine
-        tvg::Initializer::term(tvg::CanvasEngine::Sw);
+        tvg::Initializer::term(tvgEngine);
 
     } else {
         cout << "engine is not supported" << endl;