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

Side by Side Diff: Source/platform/image-decoders/bmp/BMPImageReader.cpp

Issue 733063005: Don't decode AND mask for an icon that already has alpha information (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Also rebaseline virtual deferred test. Created 6 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/images/resources/icon-without-and-bitmap.ico ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. 2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 if ((m_infoHeader.biCompression != RLE4) && (m_infoHeader.biCompression != RLE8) && (m_infoHeader.biCompression != RLE24)) { 131 if ((m_infoHeader.biCompression != RLE4) && (m_infoHeader.biCompression != RLE8) && (m_infoHeader.biCompression != RLE24)) {
132 const ProcessingResult result = processNonRLEData(false, 0); 132 const ProcessingResult result = processNonRLEData(false, 0);
133 if (result != Success) 133 if (result != Success)
134 return (result == Failure) ? m_parent->setFailed() : false; 134 return (result == Failure) ? m_parent->setFailed() : false;
135 } else if (!processRLEData()) 135 } else if (!processRLEData())
136 return false; 136 return false;
137 } 137 }
138 138
139 // If the image has an AND mask and there was no alpha data, process the 139 // If the image has an AND mask and there was no alpha data, process the
140 // mask. 140 // mask.
141 if (m_isInICO && !m_decodingAndMask && !m_buffer->hasAlpha()) { 141 if (m_isInICO && !m_decodingAndMask && (!m_bitMasks[3] || !m_seenNonZeroAlph aPixel)) {
142 // Reset decoding coordinates to start of image. 142 // Reset decoding coordinates to start of image.
143 m_coord.setX(0); 143 m_coord.setX(0);
144 m_coord.setY(m_isTopDown ? 0 : (m_parent->size().height() - 1)); 144 m_coord.setY(m_isTopDown ? 0 : (m_parent->size().height() - 1));
145 145
146 // The AND mask is stored as 1-bit data. 146 // The AND mask is stored as 1-bit data.
147 m_infoHeader.biBitCount = 1; 147 m_infoHeader.biBitCount = 1;
148 148
149 m_decodingAndMask = true; 149 m_decodingAndMask = true;
150 } 150 }
151 if (m_decodingAndMask) { 151 if (m_decodingAndMask) {
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 // Finished decoding whole image. 792 // Finished decoding whole image.
793 return Success; 793 return Success;
794 } 794 }
795 795
796 void BMPImageReader::moveBufferToNextRow() 796 void BMPImageReader::moveBufferToNextRow()
797 { 797 {
798 m_coord.move(-m_coord.x(), m_isTopDown ? 1 : -1); 798 m_coord.move(-m_coord.x(), m_isTopDown ? 1 : -1);
799 } 799 }
800 800
801 } // namespace blink 801 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/images/resources/icon-without-and-bitmap.ico ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698