> No, I don’t think that is true, but the fact that you seem so certain
makes me question my memory. The unfortunate fact is that you are right
more often than I am, Maxim.
I’m not so good in video, but let’s check the VGA 4bpp driver source source.
DrvCopyBits (which I think is called inside EngBitBlt for device surfaces)
punts to DrvBitBlt with SRCCOPY ROP in the following cases:
- pallete xlate exists and the target is device or devbitmap
- source and target are the same devbitmap are are intersecting
- copy from 1bpp or 8bpp DIB to device or devbitmap
- and some more.
So, DrvCopyBits uses the proprietary non-GRE code only for:
- from device to device if there is no xlate
- from devbitmap to 4bpp DIB
- from devbitmap to devbitmap if src and dst do not intersect (DrvBitBlt is
used otherwise), and there is no xlate
- from devbitmap to device if there is no xlate
- from 4bpp DIB to devbitmap (DrvBitBlt is used for 1bpp and 8bpp DIBs)
- from 4bpp DIB to device (DrvBitBlt is used for 1bpp and 8bpp DIBs)
- from 8bpp or 4bpp RLE DIBs to device
- from device to 4bpp DIB
In all other cases DrvCopyBits punts to SimCopyBits, using the third temporary
4bpp DIB surface. Namely these cases are:
- from device to device if there is xlate
- from devbitmap to any DIB except 4bpp
- from > 8bpp DIBs to devbitmap or device
- from device or devbitmap to any RLE DIBs
- from device to any DIB except 4pbb
SimCopyBits uses Src -> Tmp and then Tmp -> Dst blits. Since Tmp is a DIB,
EngCopyBits is used for DIB-to-DIB transfers in these procedures, and
DrvCopyBits is used from non-DIB surfaces to Tmp which is a 4bpp DIB. Such
DrvCopyBits always uses proprietary code.
Now about DrvBitBlt.
DrvBitBlt punts the following to EngBitBlt:
- blits from device to device bitmap
- blits from DIB source with > 8bpp to any target
- blits from device to device with any ROP other then SRCCOPY
- and some more cases.
You see - EngBitBlt is used for many kinds of blits, including the ones which
involve devbitmaps. So, I can only suggest that EngBitBlt calls DrvCopyBits for
some cases, at least for devbitmap/devbitmap, DIB/devbitmap and devbitmap/DIB
blits. Otherwise, EngBitBlt would have no chances on dealing with devbitmaps.
My conclusion is:
- EngCopyBits cannot be used for non-GRE surfaces. It is a simple blit from GRE
surface to GRE surface, which can only convert depths.
- EngBitBlt calls DrvCopyBits internally if one of the sides is a devbitmap or
device.
- possibly (but I’m not sure of it) DrvCopyBits is called only from within
EngBitBlt.
- note the SimCopyBits existence. This means that DrvCopyBits can be called for
any DIB from one side and device from another side.
- so, looks like the minimal functionality of DrvCopyBits must be - blits with
no DIB from any side (only devices or devbitmaps) and blits with any DIB from
one side and device/devbitmap on another side. DvrCopyBits is free to use Tmp
DIB surface and EngCopyBits to convert the depth, while using proprietary code
for device <-> device and proper-depth-DIB <-> device transfers.
People with GRE source access can shed more light here. What is interesting is
a) what is the exact list of operations DrvCopyBits must support and b) am I
correct that DrvCopyBits is only called from within EngBitBlt c) am I correct
that EngCopyBits only supports 2 DIBs and does not call any DrvXxx routines?
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com