From 0734180d7075366a6181a9e778b3345153960ca1 Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Tue, 29 Jan 2019 15:43:23 +0800 Subject: [PATCH] set user_comp_ctxt to be pixel format for default composition operators --- include/gdi.h | 2 +- src/newgdi/gdi.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/gdi.h b/include/gdi.h index 83691e89..56abdfcd 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -11051,7 +11051,7 @@ typedef struct _COMP_CTXT { /** The user context passed to SetUserCompositionOps */ void* user_comp_ctxt; - /** the pixel value shoulb be skipped (the color key) */ + /** the pixel value should be skipped (the color key) */ gal_pixel skip_pixel; /** the current pixel value for setpixel and setpixels operation */ diff --git a/src/newgdi/gdi.c b/src/newgdi/gdi.c index 6ca4c6d3..1f68973d 100644 --- a/src/newgdi/gdi.c +++ b/src/newgdi/gdi.c @@ -1812,8 +1812,9 @@ static void dc_InitDC (PDC pdc, HWND hWnd, BOOL bIsClient) [pdc->surface->format->BytesPerPixel - 1]; pdc->draw_src_span = draw_src_span_ops [pdc->rop] [pdc->surface->format->BytesPerPixel - 1]; + pdc->user_comp_ctxt = pdc->surface->format; - pdc->cur_dst = (BYTE*)pdc->surface->pixels + pdc->cur_dst = (BYTE*)pdc->surface->pixels + pdc->surface->pitch * pdc->DevRC.top + pdc->surface->format->BytesPerPixel * pdc->DevRC.left; @@ -1864,6 +1865,7 @@ static void dc_InitMemDCFrom (PDC pdc, const PDC pdc_ref) [pdc->surface->format->BytesPerPixel - 1]; pdc->draw_src_span = draw_src_span_ops [pdc->rop] [pdc->surface->format->BytesPerPixel - 1]; + pdc->user_comp_ctxt = pdc->surface->format; pdc->cur_dst = (BYTE*)pdc->surface->pixels + pdc->surface->pitch * pdc->DevRC.top @@ -1955,6 +1957,7 @@ static void dc_InitScreenDC (PDC pdc, GAL_Surface *surface) [pdc->surface->format->BytesPerPixel - 1]; pdc->draw_src_span = draw_src_span_ops [pdc->rop] [pdc->surface->format->BytesPerPixel - 1]; + pdc->user_comp_ctxt = pdc->surface->format; pdc->cur_dst = pdc->surface->pixels; pdc->move_to = move_to_ops [pdc->surface->format->BytesPerPixel - 1]; @@ -1966,7 +1969,7 @@ static void dc_InitScreenDC (PDC pdc, GAL_Surface *surface) /* Init bitmap scaler ALG */ SetBitmapScalerType((HDC)pdc, BITMAP_SCALER_DDA); } - + int GUIAPI GetRasterOperation (HDC hdc) { PDC pdc; @@ -1992,6 +1995,7 @@ int GUIAPI SetRasterOperation (HDC hdc, int rop) [pdc->surface->format->BytesPerPixel - 1]; pdc->draw_src_span = draw_src_span_ops [rop] [pdc->surface->format->BytesPerPixel - 1]; + pdc->user_comp_ctxt = pdc->surface->format; } return old; @@ -3643,6 +3647,7 @@ BOOL GUIAPI RestoreDC (HDC hdc, int saved_dc) [pdc->surface->format->BytesPerPixel - 1]; pdc->draw_src_span = draw_src_span_ops [pdc->rop] [pdc->surface->format->BytesPerPixel - 1]; + pdc->user_comp_ctxt = pdc->surface->format; } else if (ROP_COMP_USER == pdc->rop) { pdc->draw_pixel = dc_state->user_set_pixel;