Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp

Issue 2762643004: Separate zeroing pixel data from setting alpha (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c1df73bbdede3312ea968881f8d4876bc1dd6216 100644
--- a/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp
@@ -124,10 +124,6 @@ bool BMPImageReader::decodeBMP(bool onlySize) {
}
m_buffer->zeroFillPixelData();
m_buffer->setStatus(ImageFrame::FramePartial);
- // setSize() calls eraseARGB(), which resets the alpha flag, so we force
- // it back to false here. We'll set it true below in all cases where
- // these 0s could actually show through.
- m_buffer->setHasAlpha(false);
// For BMPs, the frame always fills the entire image.
m_buffer->setOriginalFrameRect(IntRect(IntPoint(), m_parent->size()));
@@ -824,6 +820,7 @@ BMPImageReader::ProcessingResult BMPImageReader::processNonRLEData(
m_seenNonZeroAlphaPixel = true;
if (m_seenZeroAlphaPixel) {
m_buffer->zeroFillPixelData();
+ m_buffer->setHasAlpha(true);
m_seenZeroAlphaPixel = false;
} else if (alpha != 255)
m_buffer->setHasAlpha(true);
« no previous file with comments | « third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698