Alexandre Julliard : gdi32: Return more meaningful data in the null driver GetDeviceCaps implementation.

Alexandre Julliard julliard at winehq.org
Fri May 19 04:42:21 CDT 2017


Dmitry Timoshkov <dmitry at baikal.ru> writes:

> Alexandre Julliard <julliard at winehq.org> wrote:
>
>> >> +    case BITSPIXEL:       return 32;
>> >
>> > Shouldn't BITSPIXEL be also fetched from dev->hdc like the values below?
>> 
>> It would have to be fetched from other values, but I don't see how you
>> would do that. You can't fetch BITSPIXEL itself, that would cause an
>> infinite loop.
>
> Does that mean that null driver always uses hardcoded BITSPIXEL = 32,
> and therefore other values depending on it should be hardcoded too?

No, the goal is to provide useful fallbacks, so that other drivers only
need to return the correct BITSPIXEL and don't have to duplicate the
code for computing the other values. That's why the null driver calls
GetDeviceCaps instead of nulldrv_GetDeviceCaps; this way it goes through
the driver stack again.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list