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

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

Issue 2756463003: Remove opaque alpha channel special case (Closed)
Patch Set: Fix gif detecting if a frame claims to have transparency 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
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..e12e9c0867a490651b18b222dd300ce9471cfb4d 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,7 +822,7 @@ BMPImageReader::ProcessingResult BMPImageReader::processNonRLEData(
if (m_seenZeroAlphaPixel) {
m_buffer->zeroFillPixelData();
m_seenZeroAlphaPixel = false;
- } else if (alpha != 255)
+ } else
Peter Kasting 2017/03/22 23:37:46 I think removing this will cause all non-RLE BMPs
cblume 2017/05/08 10:28:02 Hrmmm I think you might be right. GetAlpha() uses
m_buffer->setHasAlpha(true);
}

Powered by Google App Engine
This is Rietveld 408576698