summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/image-decoders/ImageDecoder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/image-decoders/ImageDecoder.cpp')
-rw-r--r--Source/WebCore/platform/image-decoders/ImageDecoder.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/WebCore/platform/image-decoders/ImageDecoder.cpp b/Source/WebCore/platform/image-decoders/ImageDecoder.cpp
index 24a9f90..504eb08 100644
--- a/Source/WebCore/platform/image-decoders/ImageDecoder.cpp
+++ b/Source/WebCore/platform/image-decoders/ImageDecoder.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2008-2009 Torch Mobile, Inc.
* Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
+ * Copyright (C) 2012, Sony Ericsson Mobile Communications AB
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -94,10 +95,10 @@ bool matchesCURSignature(char* contents)
}
-#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.
+// WebGL: Activated the GIF and PNG image decoders for Android.
ImageDecoder* ImageDecoder::create(const SharedBuffer& data, ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption)
{
static const unsigned lengthOfLongestSignature = 14; // To wit: "RIFF????WEBPVP"
@@ -109,9 +110,12 @@ ImageDecoder* ImageDecoder::create(const SharedBuffer& data, ImageSource::AlphaO
if (matchesGIFSignature(contents))
return new GIFImageDecoder(alphaOption, gammaAndColorProfileOption);
+#if !OS(ANDROID) || ENABLE(WEBGL)
if (matchesPNGSignature(contents))
return new PNGImageDecoder(alphaOption, gammaAndColorProfileOption);
+#endif
+#if !OS(ANDROID)
if (matchesJPEGSignature(contents))
return new JPEGImageDecoder(alphaOption, gammaAndColorProfileOption);
@@ -125,10 +129,10 @@ ImageDecoder* ImageDecoder::create(const SharedBuffer& data, ImageSource::AlphaO
if (matchesICOSignature(contents) || matchesCURSignature(contents))
return new ICOImageDecoder(alphaOption, gammaAndColorProfileOption);
+#endif // !OS(ANDROID)
return 0;
}
-#endif // !OS(ANDROID)
#if !USE(SKIA)