Commit c752e845 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

gdi32: Use EMR_REALIZEPALETTE to record RealizePalette.

parent 3fdff0b1
......@@ -2153,7 +2153,11 @@ HPALETTE WINAPI SelectPalette( HDC hdc, HPALETTE palette, BOOL force_background
*/
UINT WINAPI RealizePalette( HDC hdc )
{
DC_ATTR *dc_attr;
if (is_meta_dc( hdc )) return METADC_RealizePalette( hdc );
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
if (dc_attr->emf && !EMFDC_RealizePalette( dc_attr )) return 0;
return pfnRealizePalette( hdc );
}
......
......@@ -696,6 +696,20 @@ BOOL EMFDC_SelectPalette( DC_ATTR *dc_attr, HPALETTE palette )
return emfdc_record( emf, &emr.emr );
}
BOOL EMFDC_RealizePalette( DC_ATTR *dc_attr )
{
HPALETTE palette = GetCurrentObject( dc_attr_handle( dc_attr ), OBJ_PAL );
struct emf *emf = get_dc_emf( dc_attr );
EMRREALIZEPALETTE emr;
if (palette == GetStockObject( DEFAULT_PALETTE ))
return TRUE;
emr.emr.iType = EMR_REALIZEPALETTE;
emr.emr.nSize = sizeof(emr);
return emfdc_record( emf, &emr.emr );
}
BOOL EMFDC_SelectObject( DC_ATTR *dc_attr, HGDIOBJ obj )
{
switch (gdi_handle_type( obj ))
......
......@@ -225,6 +225,7 @@ extern BOOL EMFDC_PolyPolygon( DC_ATTR *dc_attr, const POINT *points, const INT
extern BOOL EMFDC_Polygon( DC_ATTR *dc_attr, const POINT *points, INT count ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_Polyline( DC_ATTR *dc_attr, const POINT *points, INT count) DECLSPEC_HIDDEN;
extern BOOL EMFDC_PolylineTo( DC_ATTR *dc_attr, const POINT *points, INT count ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_RealizePalette( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_Rectangle( DC_ATTR *dc_attr, INT left, INT top, INT right,
INT bottom) DECLSPEC_HIDDEN;
extern BOOL EMFDC_RestoreDC( DC_ATTR *dc_attr, INT level ) DECLSPEC_HIDDEN;
......
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