[PATCH 3/7] gdi32: Copy brush bits in get_brush_bitmap_info.

Jacek Caban jacek at codeweavers.com
Tue Sep 7 07:10:44 CDT 2021


Signed-off-by: Jacek Caban <jacek at codeweavers.com>
---
It's the last significant call to a private ntgdi function in metafile 
code. I tried replacing it with public API. NtGdiGetObjectBitmapHandle 
seems like something that could be used for that. It would require brush 
object pattern storage to be changed to use an actual (but "special" in 
a sense that it behaves slightly different) bitmap (or DIB) object, 
which we could return here. Then metafiles could use GetDIBits on that. 
I even prototyped an implementation of that and it mostly worked. The 
problematic case that I didn't find how to implement using public ntgdi 
functions is for tests like test_mf_palette_brush from the first patch 
in series. It would require us to somehow preserve original indexes for 
DIB_PAL_COLORS (unlike eg. DIB section, which converts them 
immediately), but I don't see a way to get them from GetDIBits. A 
different Wine extension just for that would be another possibility, but 
all those changes don't seem to be generally very useful for us.

Given all that, I think that we should be fine just exposing an extra 
function. This patch makes get_brush_bitmap_info behaviour more friendly 
to syscalls interface and allows sharing a bit more code between 
metafiles and EMFs.

  dlls/gdi32/brush.c         | 35 +++++++++++++++++++++++++++++------
  dlls/gdi32/emfdc.c         |  5 ++---
  dlls/gdi32/gdi_private.h   |  3 +++
  dlls/gdi32/metadc.c        | 19 ++-----------------
  dlls/gdi32/ntgdi_private.h |  1 -
  5 files changed, 36 insertions(+), 27 deletions(-)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-gdi32-Copy-brush-bits-in-get_brush_bitmap_info.txt
Type: text/x-patch
Size: 6971 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20210907/45fbed3c/attachment.bin>


More information about the wine-devel mailing list