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

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

Issue 2756463003: Remove opaque alpha channel special case (Closed)
Patch Set: Code review comments Created 3 years, 7 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.h
diff --git a/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.h b/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.h
index c5bf44b401205a428dcf0f7e6aa4460a2c2221d1..72be7e1b2b2ce8e4119e04174653d9cc13e05a23 100644
--- a/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.h
+++ b/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.h
@@ -241,9 +241,10 @@ class PLATFORM_EXPORT BMPImageReader final {
: value;
}
+ inline bool IsAlphaSupported() const { return !bit_masks_[3]; }
+
inline unsigned GetAlpha(uint32_t pixel) const {
- // For images without alpha, return alpha of 0xff.
- return bit_masks_[3] ? GetComponent(pixel, 3) : 0xff;
+ return GetComponent(pixel, 3);
scroggo_chromium 2017/05/08 14:56:36 Previously, this was only called if (bit_masks_[3]
cblume 2017/05/25 09:45:37 Huh. Yeah. IIUC, bit_masks_[3] is initialized at
}
// Sets the current pixel to the color given by |color_index|. This also

Powered by Google App Engine
This is Rietveld 408576698