mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
sw_engine Raster: Add null check for transform
If transform is null, identify matrix is used.
This commit is contained in:
parent
7ec52e6c9e
commit
d8d754e969
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
bool rasterImage(SwSurface* surface, SwImage* image, uint8_t opacity, const Matrix* transform)
|
||||||
{
|
{
|
||||||
Matrix invTransform;
|
Matrix invTransform = { 1, 0, 0, 0, 1, 0, 0, 0, 1 };
|
||||||
_inverse(transform, &invTransform);
|
if (transform) _inverse(transform, &invTransform);
|
||||||
if (image->rle) {
|
if (image->rle) {
|
||||||
if (opacity < 255) return _rasterTranslucentImageRle(surface, image->rle, image->data, opacity, &invTransform, image->width, image->height );
|
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 );
|
return _rasterImageRle(surface, image->rle, image->data, &invTransform, image->width, image->height );
|
||||||
|
|
Loading…
Add table
Reference in a new issue