[ros-kernel] bug found - need help
Ge van Geldorp
ge at gse.nl
Mon Mar 22 15:44:29 CET 2004
> From: Royce Mitchell III
> I did kinda suspect there to be a problem with NtGdiGetPixel, but
> couldn't put my finger on it.
>
> Would this (pseudo-code) be ok?
>
> if ( pvScan0 && DIB_GetPixel )
> return DIB_GetPixel()
> else if ( !pvScan0 && DrvGetPixel )
> return DrvGetPixel()
> else
> create 1x1 DIB and bitblt the pixel in, then call
> DIB_GetPixel on it.
Since DIB_GetPixel should always be non-NULL, you could simplify the
first test. eng/misc.c uses the following test to decide whether a
surface is a DIB, safe to draw upon directly without having to make a
DIB copy first:
STYPE_BITMAP == Surf->iType || (NULL != Surf->pvScan0 && NULL !=
Surf->lDelta)
DrvGetPixel doesn't seem to exist (or am I missing something???).
It might be possible to create the 1x1 DIB only once and reuse it again
and again (serialize access via a FastMutex to avoid multi-threading
issues). If you create it as a 32bpp DIB you can access its single pixel
directly, without having to go through DIB_GetPixel and without the
XLATEOBJ voodoo needed in the current NtGdiGetPixel() implementation.
Gé van Geldorp.
More information about the Ros-kernel
mailing list