sw_engine Raster: Add null check for transform
authorJunsuChoi <jsuya.choi@samsung.com>
Mon, 30 Nov 2020 06:20:49 +0000 (15:20 +0900)
committerHermet Park <chuneon.park@samsung.com>
Mon, 30 Nov 2020 06:38:17 +0000 (15:38 +0900)
If transform is null, identify matrix is used.

Change-Id: Ia01b687c3894354cafd80fc4fe944c0b4756718d

src/lib/sw_engine/tvgSwRaster.cpp

index 55e808b..4557d42 100644 (file)
@@ -258,8 +258,8 @@ static bool _rasterImage(SwSurface* surface, uint32_t *img, const SwBBox& region
 
 bool rasterImage(SwSurface* surface, SwImage* image, uint8_t opacity, const Matrix* transform)
 {
-    Matrix invTransform;
-    _inverse(transform, &invTransform);
+    Matrix invTransform = { 1, 0, 0, 0, 1, 0, 0, 0, 1 };
+    if (transform) _inverse(transform, &invTransform);
     if (image->rle) {
         if (opacity < 255) return _rasterTranslucentImageRle(surface, image->rle, image->data, opacity, &invTransform, image->width, image->height );
         return _rasterImageRle(surface, image->rle, image->data, &invTransform, image->width, image->height );