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

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

Issue 2756463003: Remove opaque alpha channel special case (Closed)
Patch Set: 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..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),

Powered by Google App Engine
This is Rietveld 408576698