gdi32: Add the ability to track whether we should defer to the graphics driver.

This commit is contained in:
Huw Davies 2011-04-07 13:47:18 +01:00 committed by Alexandre Julliard
parent ed23e3de5c
commit 842d49939d
3 changed files with 28 additions and 7 deletions

View File

@ -90,12 +90,12 @@ static BOOL init_dib(dib_info *dib, const BITMAPINFOHEADER *bi, const DWORD *bit
switch(dib->bit_count) switch(dib->bit_count)
{ {
case 32: case 32:
init_bit_fields(dib, bit_fields); init_bit_fields(dib, bit_fields);
if(dib->red_mask == 0xff0000 && dib->green_mask == 0x00ff00 && dib->blue_mask == 0x0000ff) if(dib->red_mask == 0xff0000 && dib->green_mask == 0x00ff00 && dib->blue_mask == 0x0000ff)
dib->funcs = &funcs_8888; dib->funcs = &funcs_8888;
else else
dib->funcs = &funcs_32; dib->funcs = &funcs_32;
break; break;
default: default:
TRACE("bpp %d not supported, will forward to graphics driver.\n", dib->bit_count); TRACE("bpp %d not supported, will forward to graphics driver.\n", dib->bit_count);
@ -118,7 +118,10 @@ static HBITMAP CDECL dibdrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap )
if (!bmp) return 0; if (!bmp) return 0;
assert(bmp->dib); assert(bmp->dib);
init_dib(&pdev->dib, &bmp->dib->dsBmih, bmp->dib->dsBitfields, bmp->dib->dsBm.bmBits); pdev->defer = 0;
if(!init_dib(&pdev->dib, &bmp->dib->dsBmih, bmp->dib->dsBitfields, bmp->dib->dsBm.bmBits))
pdev->defer |= DEFER_FORMAT;
GDI_ReleaseObj( bitmap ); GDI_ReleaseObj( bitmap );

View File

@ -58,5 +58,18 @@ HPEN CDECL dibdrv_SelectPen( PHYSDEV dev, HPEN hpen )
pdev->pen_color = pdev->dib.funcs->colorref_to_pixel(&pdev->dib, logpen.lopnColor); pdev->pen_color = pdev->dib.funcs->colorref_to_pixel(&pdev->dib, logpen.lopnColor);
pdev->defer |= DEFER_PEN;
switch(logpen.lopnStyle & PS_STYLE_MASK)
{
case PS_SOLID:
if(logpen.lopnStyle & PS_GEOMETRIC) break;
if(logpen.lopnWidth.x > 1) break;
pdev->defer &= ~DEFER_PEN;
break;
default:
break;
}
return next->funcs->pSelectPen( next, hpen ); return next->funcs->pSelectPen( next, hpen );
} }

View File

@ -97,10 +97,15 @@ typedef struct dibdrv_physdev
struct gdi_physdev dev; struct gdi_physdev dev;
dib_info dib; dib_info dib;
DWORD defer;
/* pen */ /* pen */
DWORD pen_color; DWORD pen_color;
} dibdrv_physdev; } dibdrv_physdev;
#define DEFER_FORMAT 1
#define DEFER_PEN 2
typedef struct tagDC_FUNCS typedef struct tagDC_FUNCS
{ {
INT (CDECL *pAbortDoc)(PHYSDEV); INT (CDECL *pAbortDoc)(PHYSDEV);