Chromium Code Reviews| Index: third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp |
| diff --git a/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp b/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp |
| index 734a7b2527bed95be6dc11f960bf2a1024f337ac..7a4bd735feb7ecb21dedf3e8409dad0357fb7601 100644 |
| --- a/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp |
| +++ b/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp |
| @@ -813,9 +813,6 @@ BMPImageReader::ProcessingResult BMPImageReader::processNonRLEData( |
| // until we actually see a non-zero alpha value; at that point, |
| // reset any previously-decoded pixels to fully transparent and |
| // continue decoding based on the real alpha channel values. |
| - // As an optimization, avoid setting "hasAlpha" to true for |
| - // images where all alpha values are 255; opaque images are |
| - // faster to draw. |
| int alpha = getAlpha(pixel); |
| if (!m_seenNonZeroAlphaPixel && !alpha) { |
| m_seenZeroAlphaPixel = true; |
| @@ -825,8 +822,7 @@ BMPImageReader::ProcessingResult BMPImageReader::processNonRLEData( |
| if (m_seenZeroAlphaPixel) { |
| m_buffer->zeroFillPixelData(); |
| m_seenZeroAlphaPixel = false; |
| - } else if (alpha != 255) |
| - m_buffer->setHasAlpha(true); |
|
Peter Kasting
2017/03/16 04:37:14
Removing this is not correct. It will mean any BM
cblume
2017/03/16 09:36:47
You are right that the call to zeroFillPixelData()
|
| + } |
| } |
| setRGBA(getComponent(pixel, 0), getComponent(pixel, 1), |