Commit 6090276b authored by Florian Will's avatar Florian Will Committed by Alexandre Julliard

gdiplus: Disable PNG encoding filters.

This speeds up the encoding process, sometimes at the cost of increased PNG file sizes. PNGs created using gdiplus on Windows 10 have filters disabled, too, according to pngcheck. The application "ZusiDisplay" encodes finished frames in PNG format and sends them through a named pipe for "Zusi 3" to use as an in-game texture, so performance matters for that use case to improve "embedded display" FPS. Signed-off-by: 's avatarFlorian Will <florian.will@gmail.com> Signed-off-by: 's avatarEsme Povirk <esme@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 513feedf
MODULE = gdiplus.dll
IMPORTLIB = gdiplus
IMPORTS = uuid shlwapi ole32 user32 gdi32
IMPORTS = uuid shlwapi ole32 oleaut32 user32 gdi32
DELAYIMPORTS = windowscodecs
C_SRCS = \
......
......@@ -4544,6 +4544,7 @@ static GpStatus encode_frame_wic(IWICBitmapEncoder *encoder, GpImage *image)
GpBitmap *bitmap;
IWICBitmapFrameEncode *frameencode;
IPropertyBag2 *encoderoptions;
GUID container_format;
HRESULT hr;
UINT width, height;
PixelFormat gdipformat=0;
......@@ -4570,6 +4571,19 @@ static GpStatus encode_frame_wic(IWICBitmapEncoder *encoder, GpImage *image)
if (SUCCEEDED(hr)) /* created frame */
{
hr = IWICBitmapEncoder_GetContainerFormat(encoder, &container_format);
if (SUCCEEDED(hr) && IsEqualGUID(&container_format, &GUID_ContainerFormatPng))
{
/* disable PNG filters for faster encoding */
PROPBAG2 filter_option = { .pstrName = (LPOLESTR) L"FilterOption" };
VARIANT filter_value;
VariantInit(&filter_value);
V_VT(&filter_value) = VT_UI1;
V_UI1(&filter_value) = WICPngFilterNone;
hr = IPropertyBag2_Write(encoderoptions, 1, &filter_option, &filter_value);
}
if (SUCCEEDED(hr))
hr = IWICBitmapFrameEncode_Initialize(frameencode, encoderoptions);
if (SUCCEEDED(hr))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment