remove print/cout logs. 96/241196/1
authorHermet Park <chuneon.park@samsung.com>
Tue, 18 Aug 2020 11:35:13 +0000 (20:35 +0900)
committerHermet Park <chuneon.park@samsung.com>
Tue, 18 Aug 2020 11:35:13 +0000 (20:35 +0900)
we need a comprehensive logging interface for this.

right now, leave as "LOG:" to replace later.

Change-Id: I25321223cd48ec13a1de5e4140cfea75a2f42866

src/lib/sw_engine/tvgSwFill.cpp
src/lib/sw_engine/tvgSwRle.cpp
src/lib/sw_engine/tvgSwStroke.cpp
src/lib/tvgPictureImpl.h
src/loaders/svg/tvgSvgLoader.cpp

index e748651..1539c17 100644 (file)
@@ -300,7 +300,7 @@ bool fillGenColorTable(SwFill* fill, const Fill* fdata, const Matrix* transform,
         return _prepareRadial(fill, static_cast<const RadialGradient*>(fdata), transform);
     }
 
-    cout << "What type of gradient?!" << endl;
+    //LOG: What type of gradient?!
 
     return false;
 }
index 6f1f2f2..fb4b87b 100644 (file)
@@ -193,11 +193,11 @@ static void _horizLine(RleWorker& rw, SwCoord x, SwCoord y, SwCoord area, SwCoor
 
     //span has ushort coordinates. check limit overflow
     if (x >= SHRT_MAX) {
-        cout << "x(" << x << ") coordinate overflow!" <<  endl;
+        //LOG: x coordinate overflow!
         x = SHRT_MAX;
     }
     if (y >= SHRT_MAX) {
-        cout << "y(" << y << ") coordinate overflow!" <<  endl;
+        //LOG: y coordinate overflow!
         y = SHRT_MAX;
     }
 
@@ -616,7 +616,7 @@ static bool _decomposeOutline(RleWorker& rw)
     return true;
 
 invalid_outline:
-    cout << "Invalid Outline!" << endl;
+    //LOG: Invalid Outline!
     return false;
 }
 
index fbe28c1..94c738c 100644 (file)
@@ -812,7 +812,9 @@ static void _exportBorderOutline(SwStroke& stroke, SwOutline* outline, uint32_t
 
         if (*src & SW_STROKE_TAG_POINT) *tags = SW_CURVE_TYPE_POINT;
         else if (*src & SW_STROKE_TAG_CUBIC) *tags = SW_CURVE_TYPE_CUBIC;
-        else cout << "what type of stroke outline??" << endl;
+        else {
+            //LOG: What type of stroke outline??
+        }
 
         if (*src & SW_STROKE_TAG_END) {
             *cntrs = idx;
index 5ab9618..d430de4 100644 (file)
@@ -86,7 +86,7 @@ struct Picture::Impl
         if (loader) loader->close();
         loader = LoaderMgr::loader();
         if (!loader || !loader->open(path.c_str())) {
-            cout << "Non supported format: " << path.c_str() << endl;
+            //LOG: Non supported format
             return Result::NonSupport;
         }
         if (!loader->read()) return Result::Unknown;
@@ -98,7 +98,7 @@ struct Picture::Impl
         if (loader) loader->close();
         loader = LoaderMgr::loader();
         if (!loader || !loader->open(data, size)) {
-            cout << "Non supported load data" << endl;
+            //LOG: Non supported load data
             return Result::NonSupport;
         }
         if (!loader->read()) return Result::Unknown;
index 1579390..f1d9432 100644 (file)
@@ -1118,7 +1118,7 @@ static SvgNode* _createEllipseNode(SvgLoaderData* loader, SvgNode* parent, const
 }
 
 
-static void _attrParsePolygonPoints(const char* str, float** points, int* ptCount)
+static bool _attrParsePolygonPoints(const char* str, float** points, int* ptCount)
 {
     float tmp[50];
     int tmpCount = 0;
@@ -1147,11 +1147,11 @@ static void _attrParsePolygonPoints(const char* str, float** points, int* ptCoun
     }
     *ptCount = count;
     *points = pointArray;
-    return;
+    return true;
 
 error_alloc:
-    printf("ERR : allocation for point array failed. out of memory");
-    abort();
+    //LOG: allocation for point array failed. out of memory
+    return false;
 }
 
 
@@ -1168,7 +1168,7 @@ static bool _attrParsePolygonNode(void* data, const char* key, const char* value
     else polygon = &(node->node.polyline);
 
     if (!strcmp(key, "points")) {
-        _attrParsePolygonPoints(value, &polygon->points, &polygon->pointsCount);
+        return _attrParsePolygonPoints(value, &polygon->points, &polygon->pointsCount);
     } else if (!strcmp(key, "style")) {
         return simpleXmlParseW3CAttribute(value, _parseStyleAttr, loader);
     } else if (!strcmp(key, "id")) {
@@ -2298,7 +2298,7 @@ bool SvgLoader::header()
         this->vw = loaderData.doc->node.doc.vw;
         this->vh = loaderData.doc->node.doc.vh;
     } else {
-        cout << "ERROR : No SVG File. There is no <svg/>" <<endl;
+        //LOG: No SVG File. There is no <svg/>
         return false;
     }
 
@@ -2322,7 +2322,7 @@ bool SvgLoader::open(const char* path)
 
     if (!f.is_open())
     {
-        cout << "ERROR: Failed to open file = " << path;
+        //LOG: Failed to open file
         return false;
     } else {
         getline(f, filePath, '\0');