sw_engine shape/image: substituting logical 'and' with 'or'
authorMira Grudzinska <m.grudzinska@samsung.com>
Sun, 7 Mar 2021 11:01:32 +0000 (12:01 +0100)
committerHermet Park <chuneon.park@samsung.com>
Thu, 11 Mar 2021 10:03:00 +0000 (19:03 +0900)
In the case when the height or width of the bounding box is 0
it is not necessary to calculate Rle.

Change-Id: Ib5351cf43d68530b83efd71d4c2dd71caf67c904

src/lib/sw_engine/tvgSwImage.cpp
src/lib/sw_engine/tvgSwShape.cpp

index 5a58443..0c25b5b 100644 (file)
@@ -68,7 +68,7 @@ static bool _updateBBox(const SwOutline* outline, SwBBox& bbox, const SwSize& cl
     bbox.max.x = min(bbox.max.x, clip.w);
     bbox.max.y = min(bbox.max.y, clip.h);
 
-    if (xMax - xMin < 1 && yMax - yMin < 1) return false;
+    if (xMax - xMin < 1 || yMax - yMin < 1) return false;
 
     return true;
 }
index 02284ff..e749aac 100644 (file)
@@ -193,7 +193,7 @@ static bool _updateBBox(const SwOutline* outline, SwBBox& bbox)
     bbox.min.y = yMin >> 6;
     bbox.max.y = (yMax + 63) >> 6;
 
-    if (xMax - xMin < 1 && yMax - yMin < 1) return false;
+    if (xMax - xMin < 1 || yMax - yMin < 1) return false;
 
     return true;
 }