Bug 1527235 - Fix how the alpha channel was missing from pasted clipboard images. r=tnikkel

In order to get the alpha channel when encoding BMP images from a
surface, we need to supply bmp=32 in the encoder options.

Differential Revision: https://phabricator.services.mozilla.com/D19835
This commit is contained in:
Andrew Osmond 2019-02-14 13:01:40 -05:00
Родитель 5fcf117d2c
Коммит 1b7b334f50
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -825,7 +825,7 @@ nsDataObj::GetDib(const nsACString& inFlavor, FORMATETC& aFormat,
nsCOMPtr<imgITools> imgTools =
do_CreateInstance("@mozilla.org/image/tools;1");
nsAutoString options;
nsAutoString options(NS_LITERAL_STRING("bpp=32;"));
if (aFormat.cfFormat == CF_DIBV5) {
options.AppendLiteral("version=5");
} else {
@ -1445,7 +1445,7 @@ HRESULT nsDataObj::DropImage(FORMATETC& aFE, STGMEDIUM& aSTG) {
do_CreateInstance("@mozilla.org/image/tools;1");
nsCOMPtr<nsIInputStream> inputStream;
rv = imgTools->EncodeImage(image, NS_LITERAL_CSTRING(IMAGE_BMP),
NS_LITERAL_STRING("version=3"),
NS_LITERAL_STRING("bpp=32;version=3"),
getter_AddRefs(inputStream));
if (NS_FAILED(rv) || !inputStream) {
return E_FAIL;