diff --git a/project/src/graphics/utils/ImageDataUtil.cpp b/project/src/graphics/utils/ImageDataUtil.cpp index d019cc8e7..379d360ec 100644 --- a/project/src/graphics/utils/ImageDataUtil.cpp +++ b/project/src/graphics/utils/ImageDataUtil.cpp @@ -250,9 +250,21 @@ namespace lime { PixelFormat format = image->buffer->format; bool premultiplied = image->buffer->premultiplied; + RGBA fillColor (color); + + if (rect->x == 0 && rect->y == 0 && rect->width == image->width && rect->height == image->height) { + + if (fillColor.a == fillColor.r && fillColor.r == fillColor.g && fillColor.g == fillColor.b) { + + memset (data, fillColor.a, image->buffer->data->byteLength); + return; + + } + + } + ImageDataView dataView = ImageDataView (image, rect); int row; - RGBA fillColor (color); if (premultiplied) fillColor.MultiplyAlpha ();