1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 23:18:26 +00:00

Use existing image decoders to handle clipboard BMP data.

This gets rid of the old nsImageClipboard widget code in favor of using
the nsBMPDecoder in imglib.
This commit is contained in:
wolfbeast
2019-02-07 22:06:24 +01:00
committed by Roy Tam
parent 84cc1f3239
commit c15f982d7a
11 changed files with 150 additions and 652 deletions
+7
View File
@@ -58,6 +58,10 @@ DecoderFactory::GetDecoderType(const char* aMimeType)
} else if (!strcmp(aMimeType, IMAGE_BMP_MS)) {
type = DecoderType::BMP;
// BMP_CLIPBOARD
} else if (!strcmp(aMimeType, IMAGE_BMP_MS_CLIPBOARD)) {
type = DecoderType::BMP_CLIPBOARD;
// ICO
} else if (!strcmp(aMimeType, IMAGE_ICO)) {
type = DecoderType::ICO;
@@ -100,6 +104,9 @@ DecoderFactory::GetDecoder(DecoderType aType,
case DecoderType::BMP:
decoder = new nsBMPDecoder(aImage);
break;
case DecoderType::BMP_CLIPBOARD:
decoder = new nsBMPDecoder(aImage, /* aForClipboard */ true);
break;
case DecoderType::ICO:
decoder = new nsICODecoder(aImage);
break;