diff --git a/test/testAsync.cpp b/test/testAsync.cpp index 4530f1d9..edc6dde7 100644 --- a/test/testAsync.cpp +++ b/test/testAsync.cpp @@ -10,6 +10,8 @@ static unsigned cnt = 0; bool tvgUpdateCmds(tvg::Canvas* canvas) { + if (!canvas) return false; + auto t = ecore_time_get(); //Explicitly clear all retained paint nodes. diff --git a/test/testBlending.cpp b/test/testBlending.cpp index 7db82019..5477b3b6 100644 --- a/test/testBlending.cpp +++ b/test/testBlending.cpp @@ -6,6 +6,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) { + if (!canvas) return; + canvas->reserve(5); //Prepare Round Rectangle diff --git a/test/testBoundary.cpp b/test/testBoundary.cpp index a2bb1d8e..57a3d6c6 100644 --- a/test/testBoundary.cpp +++ b/test/testBoundary.cpp @@ -6,6 +6,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) { + if (!canvas) return; + canvas->reserve(5); //reserve 5 shape nodes (optional) //Prepare Shape1 diff --git a/test/testCommon.h b/test/testCommon.h index f1769566..13ac86ab 100644 --- a/test/testCommon.h +++ b/test/testCommon.h @@ -12,14 +12,13 @@ using namespace std; /************************************************************************/ void tvgSwTest(uint32_t* buffer); +void drawSwView(void* data, Eo* obj); void win_del(void *data, Evas_Object *o, void *ev) { elm_exit(); } -void drawSwView(void* data, Eo* obj); - static Eo* createSwView() { static uint32_t buffer[WIDTH * HEIGHT]; diff --git a/test/testCustomTransform.cpp b/test/testCustomTransform.cpp index 00a3bc30..f95e41ef 100644 --- a/test/testCustomTransform.cpp +++ b/test/testCustomTransform.cpp @@ -7,6 +7,8 @@ tvg::Shape* pShape = nullptr; void tvgDrawCmds(tvg::Canvas* canvas) { + if (!canvas) return; + //Shape1 auto shape = tvg::Shape::gen(); @@ -33,6 +35,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) void tvgUpdateCmds(tvg::Canvas* canvas, float progress) { + if (!canvas) return; + /* Update shape directly. You can update only necessary properties of this shape, while retaining other properties. */ @@ -202,4 +206,4 @@ int main(int argc, char **argv) cout << "engine is not supported" << endl; } return 0; -} \ No newline at end of file +} diff --git a/test/testDirectUpdate.cpp b/test/testDirectUpdate.cpp index 164ff612..3c275b62 100644 --- a/test/testDirectUpdate.cpp +++ b/test/testDirectUpdate.cpp @@ -7,6 +7,8 @@ tvg::Shape* pShape = nullptr; void tvgDrawCmds(tvg::Canvas* canvas) { + if (!canvas) return; + //Shape auto shape = tvg::Shape::gen(); @@ -26,6 +28,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) void tvgUpdateCmds(tvg::Canvas* canvas, float progress) { + if (!canvas) return; + /* Update shape directly. You can update only necessary properties of this shape, while retaining other properties. */ diff --git a/test/testGradientTransform.cpp b/test/testGradientTransform.cpp index a97ec70d..4fa426be 100644 --- a/test/testGradientTransform.cpp +++ b/test/testGradientTransform.cpp @@ -9,6 +9,8 @@ tvg::Shape* pShape3 = nullptr; void tvgDrawCmds(tvg::Canvas* canvas) { + if (!canvas) return; + //Shape1 auto shape = tvg::Shape::gen(); @@ -83,6 +85,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) void tvgUpdateCmds(tvg::Canvas* canvas, float progress) { + if (!canvas) return; + /* Update shape directly. You can update only necessary properties of this shape, while retaining other properties. */ @@ -230,4 +234,4 @@ int main(int argc, char **argv) cout << "engine is not supported" << endl; } return 0; -} \ No newline at end of file +} diff --git a/test/testLinearGradient.cpp b/test/testLinearGradient.cpp index 90656fce..f98fc970 100644 --- a/test/testLinearGradient.cpp +++ b/test/testLinearGradient.cpp @@ -6,6 +6,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) { + if (!canvas) return; + canvas->reserve(3); //reserve 3 shape nodes (optional) //Prepare Round Rectangle diff --git a/test/testMultiShapes.cpp b/test/testMultiShapes.cpp index d81f7098..5a6d34f9 100644 --- a/test/testMultiShapes.cpp +++ b/test/testMultiShapes.cpp @@ -6,6 +6,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) { + if (!canvas) return; + canvas->reserve(3); //reserve 3 shape nodes (optional) //Prepare Round Rectangle diff --git a/test/testPath.cpp b/test/testPath.cpp index b3a265ea..52c56efb 100644 --- a/test/testPath.cpp +++ b/test/testPath.cpp @@ -6,6 +6,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) { + if (!canvas) return; + //Star auto shape1 = tvg::Shape::gen(); diff --git a/test/testPathCopy.cpp b/test/testPathCopy.cpp index 724b8b4f..0ae364b7 100644 --- a/test/testPathCopy.cpp +++ b/test/testPathCopy.cpp @@ -6,6 +6,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) { + if (!canvas) return; + /* Star */ //Prepare Path Commands @@ -182,4 +184,4 @@ int main(int argc, char **argv) cout << "engine is not supported" << endl; } return 0; -} \ No newline at end of file +} diff --git a/test/testRadialGradient.cpp b/test/testRadialGradient.cpp index c80cb03f..a6c10ba1 100644 --- a/test/testRadialGradient.cpp +++ b/test/testRadialGradient.cpp @@ -6,6 +6,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) { + if (!canvas) return; + canvas->reserve(3); //reserve 3 shape nodes (optional) //Prepare Round Rectangle @@ -168,4 +170,4 @@ int main(int argc, char **argv) cout << "engine is not supported" << endl; } return 0; -} \ No newline at end of file +} diff --git a/test/testScene.cpp b/test/testScene.cpp index c835a921..5b12020e 100644 --- a/test/testScene.cpp +++ b/test/testScene.cpp @@ -6,6 +6,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) { + if (!canvas) return; + //Create a Scene auto scene = tvg::Scene::gen(); scene->reserve(3); //reserve 3 shape nodes (optional) @@ -175,4 +177,4 @@ int main(int argc, char **argv) cout << "engine is not supported" << endl; } return 0; -} \ No newline at end of file +} diff --git a/test/testSceneTransform.cpp b/test/testSceneTransform.cpp index 9597101d..0d0be8e7 100644 --- a/test/testSceneTransform.cpp +++ b/test/testSceneTransform.cpp @@ -8,6 +8,8 @@ tvg::Scene* pScene2 = nullptr; void tvgDrawCmds(tvg::Canvas* canvas) { + if (!canvas) return; + //Create a Scene1 auto scene = tvg::Scene::gen(); pScene1 = scene.get(); @@ -90,6 +92,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) void tvgUpdateCmds(tvg::Canvas* canvas, float progress) { + if (!canvas) return; + /* Update scene directly. You can update only necessary properties of this scene, while retaining other properties. */ @@ -226,4 +230,4 @@ int main(int argc, char **argv) cout << "engine is not supported" << endl; } return 0; -} \ No newline at end of file +} diff --git a/test/testShape.cpp b/test/testShape.cpp index 7788817f..88519d05 100644 --- a/test/testShape.cpp +++ b/test/testShape.cpp @@ -6,6 +6,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) { + if (!canvas) return; + //Prepare a Shape (Rectangle + Rectangle + Circle + Circle) auto shape1 = tvg::Shape::gen(); shape1->appendRect(0, 0, 200, 200, 0, 0); //x, y, w, h, rx, ry @@ -118,4 +120,4 @@ int main(int argc, char **argv) cout << "engine is not supported" << endl; } return 0; -} \ No newline at end of file +} diff --git a/test/testStroke.cpp b/test/testStroke.cpp index 36f2a948..91748727 100644 --- a/test/testStroke.cpp +++ b/test/testStroke.cpp @@ -6,6 +6,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) { + if (!canvas) return; + //Shape 1 auto shape1 = tvg::Shape::gen(); shape1->appendRect(50, 50, 200, 200, 0, 0); @@ -165,4 +167,4 @@ int main(int argc, char **argv) cout << "engine is not supported" << endl; } return 0; -} \ No newline at end of file +} diff --git a/test/testStrokeLine.cpp b/test/testStrokeLine.cpp index 894c6950..445f8406 100644 --- a/test/testStrokeLine.cpp +++ b/test/testStrokeLine.cpp @@ -6,6 +6,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) { + if (!canvas) return; + //Test for Stroke Width for (int i = 0; i < 10; ++i) { auto shape = tvg::Shape::gen(); @@ -202,4 +204,4 @@ int main(int argc, char **argv) cout << "engine is not supported" << endl; } return 0; -} \ No newline at end of file +} diff --git a/test/testSvg.cpp b/test/testSvg.cpp index 65fe9d7a..b8eb2ba2 100644 --- a/test/testSvg.cpp +++ b/test/testSvg.cpp @@ -31,6 +31,8 @@ void svgDirCallback(const char* name, const char* path, void* data) void tvgDrawCmds(tvg::Canvas* canvas) { + if (!canvas) return; + //Background auto shape = tvg::Shape::gen(); shape->appendRect(0, 0, WIDTH, HEIGHT, 0, 0); //x, y, w, h, rx, ry @@ -142,4 +144,4 @@ int main(int argc, char **argv) cout << "engine is not supported" << endl; } return 0; -} \ No newline at end of file +} diff --git a/test/testTransform.cpp b/test/testTransform.cpp index 6d0edbf1..7529d140 100644 --- a/test/testTransform.cpp +++ b/test/testTransform.cpp @@ -9,6 +9,8 @@ tvg::Shape* pShape3 = nullptr; void tvgDrawCmds(tvg::Canvas* canvas) { + if (!canvas) return; + //Shape1 auto shape = tvg::Shape::gen(); @@ -46,6 +48,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) void tvgUpdateCmds(tvg::Canvas* canvas, float progress) { + if (!canvas) return; + /* Update shape directly. You can update only necessary properties of this shape, while retaining other properties. */ @@ -193,4 +197,4 @@ int main(int argc, char **argv) cout << "engine is not supported" << endl; } return 0; -} \ No newline at end of file +} diff --git a/test/testUpdate.cpp b/test/testUpdate.cpp index 0d007381..9c213436 100644 --- a/test/testUpdate.cpp +++ b/test/testUpdate.cpp @@ -6,6 +6,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) { + if (!canvas) return; + //Shape auto shape = tvg::Shape::gen(); shape->appendRect(-100, -100, 200, 200, 0, 0); @@ -15,6 +17,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) void tvgUpdateCmds(tvg::Canvas* canvas, float progress) { + if (!canvas) return; + //Explicitly clear all retained paint nodes. if (canvas->clear() != tvg::Result::Success) return; @@ -154,4 +158,4 @@ int main(int argc, char **argv) cout << "engine is not supported" << endl; } return 0; -} \ No newline at end of file +}