diff options
Diffstat (limited to 'WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp')
-rw-r--r-- | WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp b/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp index d667795..453efd2 100644 --- a/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp +++ b/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp @@ -44,8 +44,9 @@ namespace WebCore { static const size_t sizeOfDirectory = 6; static const size_t sizeOfDirEntry = 16; -ICOImageDecoder::ICOImageDecoder() - : m_decodedOffset(0) +ICOImageDecoder::ICOImageDecoder(bool premultiplyAlpha) + : ImageDecoder(premultiplyAlpha) + , m_decodedOffset(0) { } @@ -96,8 +97,11 @@ bool ICOImageDecoder::setSize(unsigned width, unsigned height) size_t ICOImageDecoder::frameCount() { decode(0, true); - if (m_frameBufferCache.isEmpty()) + if (m_frameBufferCache.isEmpty()) { m_frameBufferCache.resize(m_dirEntries.size()); + for (size_t i = 0; i < m_dirEntries.size(); ++i) + m_frameBufferCache[i].setPremultiplyAlpha(m_premultiplyAlpha); + } // CAUTION: We must not resize m_frameBufferCache again after this, as // decodeAtIndex() may give a BMPImageReader a pointer to one of the // entries. @@ -197,7 +201,7 @@ bool ICOImageDecoder::decodeAtIndex(size_t index) } if (!m_pngDecoders[index]) { - m_pngDecoders[index].set(new PNGImageDecoder()); + m_pngDecoders[index].set(new PNGImageDecoder(m_premultiplyAlpha)); setDataForPNGDecoderAtIndex(index); } // Fail if the size the PNGImageDecoder calculated does not match the size |