gdi32: Optionally return the type from GDI_GetObjPtr().

Dmitry Timoshkov dmitry at baikal.ru
Fri Jul 8 04:24:29 CDT 2016


Huw Davies <huw at codeweavers.com> wrote:

> This enables get_dc_obj() to check the type without calling GetObjectType()
> and thus it saves additional calls to Enter/LeaveCriticalSection().
> 
> Signed-off-by: Huw Davies <huw at codeweavers.com>
> ---
> This reduces the runtime of the dib tests by about 8% and achieves a similar
> increase in performance with the drawing phase of a (gdi heavy) app I'm
> looking at.
...
> -    bmp = GDI_GetObjPtr( hbitmap, OBJ_BITMAP );
> +    bmp = GDI_GetObjPtr( hbitmap, OBJ_BITMAP, NULL );

Did you consider introducing GDI_GetObjPtrEx() with additional pointer to
type, and making a shortcut by defining/calling it by a not Ex version?
That would simplify the patch and avoid penalizing/changing the callers
that don't need the type.

-- 
Dmitry.



More information about the wine-devel mailing list