Commit 76b0626f authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

gdi32: Add a function to retrieve the rop codes.

parent 4b50743f
......@@ -56,6 +56,12 @@ extern const primitive_funcs funcs_4 DECLSPEC_HIDDEN;
extern const primitive_funcs funcs_1 DECLSPEC_HIDDEN;
extern const primitive_funcs funcs_null DECLSPEC_HIDDEN;
struct rop_codes
{
DWORD a1, a2, x1, x2;
};
extern void get_rop_codes(INT rop, struct rop_codes *codes);
extern void calc_and_xor_masks(INT rop, DWORD color, DWORD *and, DWORD *xor) DECLSPEC_HIDDEN;
extern void update_brush_rop( dibdrv_physdev *pdev, INT rop ) DECLSPEC_HIDDEN;
extern void reset_dash_origin(dibdrv_physdev *pdev) DECLSPEC_HIDDEN;
......
......@@ -85,11 +85,22 @@ static const DWORD rop2_xor_array[16][2] =
#undef ONE
#undef ZERO
void calc_and_xor_masks(INT rop, DWORD color, DWORD *and, DWORD *xor)
void get_rop_codes(INT rop, struct rop_codes *codes)
{
/* NB The ROP2 codes start at one and the arrays are zero-based */
*and = (color & rop2_and_array[rop-1][0]) ^ rop2_and_array[rop-1][1];
*xor = (color & rop2_xor_array[rop-1][0]) ^ rop2_xor_array[rop-1][1];
codes->a1 = rop2_and_array[rop-1][0];
codes->a2 = rop2_and_array[rop-1][1];
codes->x1 = rop2_xor_array[rop-1][0];
codes->x2 = rop2_xor_array[rop-1][1];
}
void calc_and_xor_masks(INT rop, DWORD color, DWORD *and, DWORD *xor)
{
struct rop_codes codes;
get_rop_codes( rop, &codes );
*and = (color & codes.a1) ^ codes.a2;
*xor = (color & codes.x1) ^ codes.x2;
}
static inline RGBQUAD rgbquad_from_colorref(COLORREF c)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment