Commit 2bd3acf7 authored by Huw D M Davies's avatar Huw D M Davies Committed by Alexandre Julliard

Moved DC_SetupGC functions to graphics/x11drv/graphics.c.

parent 324ea572
......@@ -21,7 +21,6 @@
#include "metafile.h"
#include "palette.h"
#include "cache.h"
#include "color.h"
#include "region.h"
#include "path.h"
#include "debug.h"
......@@ -331,17 +330,15 @@ INT16 WINAPI FrameRect16( HDC16 hdc, const RECT16 *rect, HBRUSH16 hbrush )
if ( (right <= left) || (bottom <= top) ) return 0;
if (!(prevBrush = SelectObject16( hdc, hbrush ))) return 0;
if (DC_SetupGCForBrush( dc ))
{
PatBlt32( hdc, rect->left, rect->top, 1,
rect->bottom - rect->top, PATCOPY );
PatBlt32( hdc, rect->right - 1, rect->top, 1,
rect->bottom - rect->top, PATCOPY );
PatBlt32( hdc, rect->left, rect->top,
rect->right - rect->left, 1, PATCOPY );
PatBlt32( hdc, rect->left, rect->bottom - 1,
rect->right - rect->left, 1, PATCOPY );
}
PatBlt32( hdc, rect->left, rect->top, 1,
rect->bottom - rect->top, PATCOPY );
PatBlt32( hdc, rect->right - 1, rect->top, 1,
rect->bottom - rect->top, PATCOPY );
PatBlt32( hdc, rect->left, rect->top,
rect->right - rect->left, 1, PATCOPY );
PatBlt32( hdc, rect->left, rect->bottom - 1,
rect->right - rect->left, 1, PATCOPY );
SelectObject16( hdc, prevBrush );
return 1;
}
......@@ -646,7 +643,7 @@ void WINAPI DrawFocusRect32( HDC32 hdc, const RECT32* rc )
/* Hack: make sure the XORPEN operation has an effect */
dc->u.x.pen.pixel = (1 << screenDepth) - 1;
if (DC_SetupGCForPen( dc ))
if (X11DRV_SetupGCForPen( dc ))
TSXDrawRectangle( display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
right-left-1, bottom-top-1 );
......
......@@ -1207,7 +1207,7 @@ static BOOL32 BITBLT_InternalStretchBlt( DC *dcDst, INT32 xDst, INT32 yDst,
case PATINVERT: /* 0x5a */
if (Options.perfectGraphics) break;
if (DC_SetupGCForBrush( dcDst ))
if (X11DRV_SetupGCForBrush( dcDst ))
{
XSetFunction( display, dcDst->u.x.gc, GXxor );
XFillRectangle( display, dcDst->u.x.drawable, dcDst->u.x.gc,
......@@ -1217,7 +1217,7 @@ static BOOL32 BITBLT_InternalStretchBlt( DC *dcDst, INT32 xDst, INT32 yDst,
case 0xa50065:
if (Options.perfectGraphics) break;
if (DC_SetupGCForBrush( dcDst ))
if (X11DRV_SetupGCForBrush( dcDst ))
{
XSetFunction( display, dcDst->u.x.gc, GXequiv );
XFillRectangle( display, dcDst->u.x.drawable, dcDst->u.x.gc,
......@@ -1253,7 +1253,7 @@ static BOOL32 BITBLT_InternalStretchBlt( DC *dcDst, INT32 xDst, INT32 yDst,
break;
case PATCOPY: /* 0xf0 */
if (!DC_SetupGCForBrush( dcDst )) return TRUE;
if (!X11DRV_SetupGCForBrush( dcDst )) return TRUE;
XSetFunction( display, dcDst->u.x.gc, GXcopy );
XFillRectangle( display, dcDst->u.x.drawable, dcDst->u.x.gc,
visRectDst.left, visRectDst.top, width, height );
......@@ -1291,7 +1291,7 @@ static BOOL32 BITBLT_InternalStretchBlt( DC *dcDst, INT32 xDst, INT32 yDst,
xSrc, ySrc, &visRectSrc );
}
if (useDst) BITBLT_GetDstArea( dcDst, pixmaps[DST], tmpGC, &visRectDst );
if (usePat) fNullBrush = !DC_SetupGCForPatBlt( dcDst, tmpGC, TRUE );
if (usePat) fNullBrush = !X11DRV_SetupGCForPatBlt( dcDst, tmpGC, TRUE );
else fNullBrush = FALSE;
destUsed = FALSE;
......
......@@ -1114,8 +1114,8 @@ INT32 X11DRV_SetDIBitsToDevice( DC *dc, INT32 xDest, INT32 yDest, DWORD cx,
if (xSrc + cx >= width) cx = width - xSrc;
if (!cx || !cy) return 0;
DC_SetupGCForText( dc ); /* To have the correct colors */
TSXSetFunction( display, dc->u.x.gc, DC_XROPfunction[dc->w.ROPmode-1] );
X11DRV_SetupGCForText( dc ); /* To have the correct colors */
TSXSetFunction(display, dc->u.x.gc, X11DRV_XROPfunction[dc->w.ROPmode-1]);
if (descr.infoBpp <= 8)
{
......
......@@ -36,7 +36,7 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
char dfBreakChar, lfUnderline, lfStrikeOut;
BOOL32 rotated = FALSE;
if (!DC_SetupGCForText( dc )) return TRUE;
if (!X11DRV_SetupGCForText( dc )) return TRUE;
pfo = XFONT_GetFontObject( dc->u.x.font );
font = pfo->fs;
......
......@@ -17,13 +17,8 @@
extern DC * DC_AllocDC( const DC_FUNCTIONS *funcs );
extern DC * DC_GetDCPtr( HDC32 hdc );
extern void DC_InitDC( DC * dc );
extern BOOL32 DC_SetupGCForPatBlt( DC * dc, GC gc, BOOL32 fMapColors );
extern BOOL32 DC_SetupGCForBrush( DC * dc );
extern BOOL32 DC_SetupGCForPen( DC * dc );
extern BOOL32 DC_SetupGCForText( DC * dc );
extern void DC_UpdateXforms( DC * dc );
extern const int DC_XROPfunction[];
/* objects/clipping.c */
INT32 CLIPPING_IntersectClipRect( DC * dc, INT32 left, INT32 top,
......
......@@ -150,6 +150,14 @@ extern int X11DRV_DIB_GetXImageWidthBytes( int width, int depth );
extern BOOL32 X11DRV_DIB_Init(void);
extern X11DRV_PHYSBITMAP *X11DRV_AllocBitmap( struct tagBITMAPOBJ *bmp );
extern BOOL32 X11DRV_SetupGCForPatBlt( struct tagDC *dc, GC gc,
BOOL32 fMapColors );
extern BOOL32 X11DRV_SetupGCForBrush( struct tagDC *dc );
extern BOOL32 X11DRV_SetupGCForPen( struct tagDC *dc );
extern BOOL32 X11DRV_SetupGCForText( struct tagDC *dc );
extern const int X11DRV_XROPfunction[];
/* Xlib critical section */
extern CRITICAL_SECTION X11DRV_CritSection;
......
......@@ -7,8 +7,6 @@
#include <stdlib.h>
#include "brush.h"
#include "bitmap.h"
#include "metafile.h"
#include "color.h"
#include "debug.h"
......@@ -25,6 +23,7 @@ HBRUSH16 WINAPI CreateBrushIndirect16( const LOGBRUSH16 * brush )
brushPtr->logbrush.lbColor = brush->lbColor;
brushPtr->logbrush.lbHatch = brush->lbHatch;
GDI_HEAP_UNLOCK( hbrush );
TRACE(gdi, "%04x\n", hbrush);
return hbrush;
}
......@@ -42,6 +41,7 @@ HBRUSH32 WINAPI CreateBrushIndirect32( const LOGBRUSH32 * brush )
brushPtr->logbrush.lbColor = brush->lbColor;
brushPtr->logbrush.lbHatch = brush->lbHatch;
GDI_HEAP_UNLOCK( hbrush );
TRACE(gdi, "%08x\n", hbrush);
return hbrush;
}
......
......@@ -5,7 +5,6 @@
*/
#include <stdlib.h>
#include "color.h"
#include "bitmap.h"
#include "brush.h"
#include "dc.h"
......
......@@ -5,8 +5,6 @@
*/
#include "pen.h"
#include "metafile.h"
#include "color.h"
#include "debug.h"
......
......@@ -35,7 +35,7 @@ BOOL32 GRAPH_DrawLines( HDC32 hdc, LPPOINT32 pXY, INT32 N, HPEN32 hPen )
HPEN32 hPrevPen = 0;
if( hPen ) hPrevPen = SelectObject32( hdc, hPen );
if( DC_SetupGCForPen( dc ) )
if( X11DRV_SetupGCForPen( dc ) )
{
XSegment l[MAX_DRAWLINES];
INT32 i, j;
......@@ -178,7 +178,7 @@ void GRAPH_DrawGenericReliefRect(
hPrevBrush = SelectObject32(hdc, highlight);
if ( DC_SetupGCForBrush( dc ) )
if ( X11DRV_SetupGCForBrush( dc ) )
{
INT32 i;
......@@ -193,7 +193,7 @@ void GRAPH_DrawGenericReliefRect(
}
SelectObject32( hdc, shadow );
if ( DC_SetupGCForBrush( dc ) )
if ( X11DRV_SetupGCForBrush( dc ) )
{
INT32 i;
......@@ -226,7 +226,7 @@ void GRAPH_DrawRectangle( HDC32 hdc, INT32 x, INT32 y,
HPEN32 hPrevPen = 0;
if( hPen ) hPrevPen = SelectObject32( hdc, hPen );
if( DC_SetupGCForPen( dc ) )
if( X11DRV_SetupGCForPen( dc ) )
TSXDrawRectangle( display, dc->u.x.drawable, dc->u.x.gc,
x + dc->w.DCOrgX, y + dc->w.DCOrgY, w - 1, h - 1);
if( hPrevPen ) SelectObject32( hdc, hPrevPen );
......
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