[PATCH v5 3/7] win32u: fix return value of StretchDIBits for EMF DC.

Jin-oh Kang jinoh.kang.kr at gmail.com
Mon Nov 1 22:46:19 CDT 2021


On Tue, Nov 2, 2021 at 6:21 AM Jacek Caban <jacek at codeweavers.com> wrote:
>
> Hi Jinoh,
>
> On 11/1/21 6:30 AM, Jinoh Kang wrote:
> > Signed-off-by: Jinoh Kang <jinoh.kang.kr at gmail.com>
> > ---
> >   dlls/win32u/emfdrv.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/dlls/win32u/emfdrv.c b/dlls/win32u/emfdrv.c
> > index e05f11d7b9a..395d51048d8 100644
> > --- a/dlls/win32u/emfdrv.c
> > +++ b/dlls/win32u/emfdrv.c
> > @@ -408,7 +408,7 @@ static INT CDECL EMFDRV_StretchDIBits( PHYSDEV dev, INT x_dst, INT y_dst, INT wi
> >                                          UINT wUsage, DWORD dwRop )
> >   {
> >       /* FIXME: Update bound rect */
> > -    return height_src;
> > +    return abs( info->bmiHeader.biHeight );
> >   }
> >
> >   static INT CDECL EMFDRV_SetDIBitsToDevice( PHYSDEV dev, INT x_dst, INT y_dst, DWORD width,
>
>
> For this and the next patch, you could simply remove
> EMFDRV_StretchDIBits and EMFDRV_SetDIBitsToDevice and let the null
> driver take care of it.

The nulldrv code is still broken w.r.t. BI_RLE[48] case, so I guess
that side needs fixing?

> I originally left it because of bound rect
> update (that's supposed to happen in win32u instead of of gdi32), but
> that doesn't seem worth keeping it now.

I suppose the most ideal way to deal with it is to do normalization
early (in either gdi32 or NtGdi* functions) so that the calculation
code doesn't have to be duplicated between emfdc.c, EMFDRV and
nulldrv. Currently the args are passed as-is to both EMFDC and NtGdi*,
and the normalization work is done *twice*.

>
>
> Thanks,
>
> Jacek
>



More information about the wine-devel mailing list