GradientFill confusion in Display and Print Devices DDK docs  
Author Message
Adrix





PostPosted: Top

Drivers >> GradientFill confusion in Display and Print Devices DDK docs

Hi all,

In the Display and Print Devices help file under "Special Effects in Display
Drivers" the DDK docs state that:

1-bpp to 8-bpp surfaces
No error is permitted in gradient fills for any of these surfaces. For an
8-bpp surface, GDI does not call the driver's DrvGradientFill function.

I'm assuming this also applies to mirror drivers... If I create an 8bpp
device managed surface the DrvGradientFill function does get called. This
behavior isn't what i expected but i tried solving it by just punting back to
EngGradientFill. So far so good, but EngGradientFill draws gradients using
dithering. This sometimes makes it harder to read the text on (inactive)
caption bars.

So my questions are:
1. Is my DrvGradientFill supposed to get called in the first place? (for an
8bpp surface) (note that this is a mirror driver)
2. Is there a way to disable EngGradientFill's dithering on my 8bpp surface?

I already went through all DEVINFO/GDIINFO structure members, but it doesn't
look like it's just as simple as setting a flag. I'd rather not write
gradient filling code myself as a replacement for EngGradientFill's dithered
fill :(

I thought about creating a temporary 24-bit bitmap to draw the gradient on
and then copy it back onto my device managed surface. This however doesn't
really sound very efficient and I'm kinda hoping there is a way to turn off
the dithering :)

Thanks in advance,
Saffron

Windows OS44