diff options
Diffstat (limited to 'WebCore/platform/image-decoders/ImageDecoder.cpp')
-rw-r--r-- | WebCore/platform/image-decoders/ImageDecoder.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/WebCore/platform/image-decoders/ImageDecoder.cpp b/WebCore/platform/image-decoders/ImageDecoder.cpp index 43ff33b..a9d5131 100644 --- a/WebCore/platform/image-decoders/ImageDecoder.cpp +++ b/WebCore/platform/image-decoders/ImageDecoder.cpp @@ -53,11 +53,15 @@ static unsigned copyFromSharedBuffer(char* buffer, unsigned bufferLength, const return bytesExtracted; } +<<<<<<< HEAD #if !OS(ANDROID) // This method requires BMPImageDecoder, PNGImageDecoder, ICOImageDecoder and // JPEGDecoder, which aren't used on Android, and which don't all compile. // TODO: Find a better fix. ImageDecoder* ImageDecoder::create(const SharedBuffer& data, bool premultiplyAlpha) +======= +ImageDecoder* ImageDecoder::create(const SharedBuffer& data, bool premultiplyAlpha, bool ignoreGammaAndColorProfile) +>>>>>>> webkit.org at r72274 { // We need at least 4 bytes to figure out what kind of image we're dealing // with. @@ -69,15 +73,15 @@ ImageDecoder* ImageDecoder::create(const SharedBuffer& data, bool premultiplyAlp // GIFs begin with GIF8(7 or 9). if (strncmp(contents, "GIF8", 4) == 0) - return new GIFImageDecoder(premultiplyAlpha); + return new GIFImageDecoder(premultiplyAlpha, ignoreGammaAndColorProfile); // Test for PNG. if (!memcmp(contents, "\x89\x50\x4E\x47", 4)) - return new PNGImageDecoder(premultiplyAlpha); + return new PNGImageDecoder(premultiplyAlpha, ignoreGammaAndColorProfile); // JPEG if (!memcmp(contents, "\xFF\xD8\xFF", 3)) - return new JPEGImageDecoder(premultiplyAlpha); + return new JPEGImageDecoder(premultiplyAlpha, ignoreGammaAndColorProfile); #if USE(WEBP) if (!memcmp(contents, "RIFF", 4)) { @@ -87,19 +91,19 @@ ImageDecoder* ImageDecoder::create(const SharedBuffer& data, bool premultiplyAlp unsigned length = copyFromSharedBuffer(header, webpExtraMarker, data, webpExtraMarkeroffset); if (length >= webpExtraMarker) { if (!memcmp(header, "WEBPVP", webpExtraMarker)) - return new WEBPImageDecoder(premultiplyAlpha); + return new WEBPImageDecoder(premultiplyAlpha, ignoreGammaAndColorProfile); } } #endif // BMP if (strncmp(contents, "BM", 2) == 0) - return new BMPImageDecoder(premultiplyAlpha); + return new BMPImageDecoder(premultiplyAlpha, ignoreGammaAndColorProfile); // ICOs always begin with a 2-byte 0 followed by a 2-byte 1. // CURs begin with 2-byte 0 followed by 2-byte 2. if (!memcmp(contents, "\x00\x00\x01\x00", 4) || !memcmp(contents, "\x00\x00\x02\x00", 4)) - return new ICOImageDecoder(premultiplyAlpha); + return new ICOImageDecoder(premultiplyAlpha, ignoreGammaAndColorProfile); // Give up. We don't know what the heck this is. return 0; @@ -148,7 +152,7 @@ void RGBA32Buffer::zeroFill() m_hasAlpha = true; } -#if !PLATFORM(CF) +#if !PLATFORM(CG) void RGBA32Buffer::copyReferenceToBitmapData(const RGBA32Buffer& other) { |