| Index: Source/core/platform/image-decoders/webp/WEBPImageDecoder.cpp
|
| diff --git a/Source/core/platform/image-decoders/webp/WEBPImageDecoder.cpp b/Source/core/platform/image-decoders/webp/WEBPImageDecoder.cpp
|
| index 26171f55dae281d37ebcb21ce8f08c8b957750ed..744e17d9e0d518f4ecfb87f5406dc1df85620b8a 100644
|
| --- a/Source/core/platform/image-decoders/webp/WEBPImageDecoder.cpp
|
| +++ b/Source/core/platform/image-decoders/webp/WEBPImageDecoder.cpp
|
| @@ -194,8 +194,16 @@ void WEBPImageDecoder::applyColorProfile(const uint8_t* data, size_t dataSize, I
|
| if (qcms_transform* transform = colorTransform())
|
| qcms_transform_data_type(transform, row, row, width, QCMS_OUTPUT_RGBX);
|
| uint8_t* pixel = row;
|
| - for (int x = 0; x < width; ++x, pixel += 4)
|
| - buffer.setRGBA(x, y, pixel[0], pixel[1], pixel[2], pixel[3]);
|
| +
|
| + // Do not merge the loops below. They are hand rolled for each case for maximal peformace.
|
| + ImageFrame::PixelData* dst = buffer.getAddr(0, y);
|
| + if (buffer.premultiplyAlpha()) {
|
| + for (int x = 0; x < width; ++x, pixel += 4)
|
| + buffer.setRGBAPremultiply(dst + x, pixel[0], pixel[1], pixel[2], pixel[3]);
|
| + } else {
|
| + for (int x = 0; x < width; ++x, pixel += 4)
|
| + buffer.setRGBANoPremultiply(dst + x, pixel[0], pixel[1], pixel[2], pixel[3]);
|
| + }
|
| }
|
|
|
| m_decodedHeight = decodedHeight;
|
|
|