summaryrefslogtreecommitdiff
path: root/image/src
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2016-09-01 14:52:32 +0200
committerwolfbeast <mcwerewolf@gmail.com>2016-09-01 14:52:32 +0200
commitafa5fec2c6923ad3e2f355601a1ee4393253cebe (patch)
tree7fd3b3a997c71c0a550b776962e80910a8208954 /image/src
parent3d8ce1a11a7347cc94a937719c4bc8df46fb8d14 (diff)
downloadpalemoon-gre-afa5fec2c6923ad3e2f355601a1ee4393253cebe.tar.gz
Base import of Tycho-libwebp-work branch
Diffstat (limited to 'image/src')
-rw-r--r--image/src/Image.cpp4
-rw-r--r--image/src/Image.h3
-rw-r--r--image/src/RasterImage.cpp4
3 files changed, 10 insertions, 1 deletions
diff --git a/image/src/Image.cpp b/image/src/Image.cpp
index 63850ba5e..6cc21e8d3 100644
--- a/image/src/Image.cpp
+++ b/image/src/Image.cpp
@@ -50,6 +50,10 @@ Image::GetDecoderType(const char *aMimeType)
else if (!strcmp(aMimeType, IMAGE_JPG))
rv = eDecoderType_jpeg;
+ // WEBP
+ else if (!strcmp(aMimeType, IMAGE_WEBP))
+ rv = eDecoderType_webp;
+
// BMP
else if (!strcmp(aMimeType, IMAGE_BMP))
rv = eDecoderType_bmp;
diff --git a/image/src/Image.h b/image/src/Image.h
index c45354575..49046f003 100644
--- a/image/src/Image.h
+++ b/image/src/Image.h
@@ -31,7 +31,8 @@ public:
eDecoderType_bmp = 3,
eDecoderType_ico = 4,
eDecoderType_icon = 5,
- eDecoderType_unknown = 6
+ eDecoderType_webp = 6,
+ eDecoderType_unknown = 7
};
static eDecoderType GetDecoderType(const char* aMimeType);
diff --git a/image/src/RasterImage.cpp b/image/src/RasterImage.cpp
index e79130202..5f1472091 100644
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -30,6 +30,7 @@
#include "nsBMPDecoder.h"
#include "nsICODecoder.h"
#include "nsIconDecoder.h"
+#include "nsWEBPDecoder.h"
#include "gfxContext.h"
@@ -1340,6 +1341,9 @@ RasterImage::CreateDecoder(const Maybe<nsIntSize>& aSize, uint32_t aFlags)
case eDecoderType_icon:
decoder = new nsIconDecoder(this);
break;
+ case eDecoderType_webp:
+ decoder = new nsWEBPDecoder(this);
+ break;
default:
MOZ_ASSERT_UNREACHABLE("Unknown decoder type");
}