Huw Davies huw@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@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.