ignore alphaBit (and mask) for 32bit images, 'cause that seems to break this
ico image
http://images.delta.com.edgesuite.net/delta/misc/favicon.ico
git-svn-id: http://skia.googlecode.com/svn/trunk@2051 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/images/SkImageDecoder_libico.cpp b/src/images/SkImageDecoder_libico.cpp
index 58e018d..bb6bc95 100644
--- a/src/images/SkImageDecoder_libico.cpp
+++ b/src/images/SkImageDecoder_libico.cpp
@@ -24,6 +24,11 @@
virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode);
};
+SkImageDecoder* SkCreateICOImageDecoder();
+SkImageDecoder* SkCreateICOImageDecoder() {
+ return new SkICOImageDecoder;
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
//read bytes starting from the begin-th index in the buffer
@@ -355,6 +360,9 @@
int green = readByte(buf, xorOffset + 4*pixelNo + 1);
int red = readByte(buf, xorOffset + 4*pixelNo + 2);
int alphaBit = (alphaByte & m) >> shift;
+#if 1 // don't trust the alphaBit for 32bit images <mrr>
+ alphaBit = 0;
+#endif
int alpha = readByte(buf, xorOffset + 4*pixelNo + 3) & ((alphaBit-1)&0xFF);
*address = SkPreMultiplyARGB(alpha, red, green, blue);
}