Author: fireball
Date: Thu Jan 6 13:13:47 2011
New Revision: 50298
URL:
http://svn.reactos.org/svn/reactos?rev=50298&view=rev
Log:
- winent.drv: Keep dc_rect in usermode counterpart of DC structure.
- winent.drv: Rename hUserDC to hdc for better readibility.
- ntrosgdi.h: Update the PHYSDEV struct and remove unused ROS_DCINFO.
Modified:
branches/arwinss/reactos/dll/win32/winent.drv/bitblt.c
branches/arwinss/reactos/dll/win32/winent.drv/dib.c
branches/arwinss/reactos/dll/win32/winent.drv/font.c
branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c
branches/arwinss/reactos/dll/win32/winent.drv/graphics.c
branches/arwinss/reactos/dll/win32/winent.drv/ogldrv.c
branches/arwinss/reactos/include/reactos/wine/ntrosgdi.h
Modified: branches/arwinss/reactos/dll/win32/winent.drv/bitblt.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winent.drv/bitblt.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winent.drv/bitblt.c [iso-8859-1] Thu Jan 6
13:13:47 2011
@@ -26,14 +26,16 @@
pts[1].x = left + width;
pts[1].y = top + height;
- LPtoDP(physDev->hUserDC, pts, 2);
+ LPtoDP(physDev->hdc, pts, 2);
width = pts[1].x - pts[0].x;
height = pts[1].y - pts[0].y;
- left = pts[0].x;
- top = pts[0].y;
+ left = pts[0].x + physDev->dc_rect.left;
+ top = pts[0].y + physDev->dc_rect.top;
/* Update brush origin */
- GetBrushOrgEx(physDev->hUserDC, &ptBrush);
+ GetBrushOrgEx(physDev->hdc, &ptBrush);
+ ptBrush.x += physDev->dc_rect.left;
+ ptBrush.y += physDev->dc_rect.top;
RosGdiSetBrushOrg(physDev->hKernelDC, ptBrush.x, ptBrush.y);
return RosGdiPatBlt(physDev->hKernelDC, left, top, width, height, rop);
@@ -61,22 +63,24 @@
pts[1].x = xSrc + width;
pts[1].y = ySrc + height;
- LPtoDP(physDevSrc->hUserDC, pts, 2);
+ LPtoDP(physDevSrc->hdc, pts, 2);
width = pts[1].x - pts[0].x;
height = pts[1].y - pts[0].y;
- xSrc = pts[0].x;
- ySrc = pts[0].y;
+ xSrc = pts[0].x + physDevSrc->dc_rect.left;
+ ySrc = pts[0].y + physDevSrc->dc_rect.top;
}
/* map dest coordinates */
pts[0].x = xDst;
pts[0].y = yDst;
- LPtoDP(physDevDst->hUserDC, pts, 1);
- xDst = pts[0].x;
- yDst = pts[0].y;
+ LPtoDP(physDevDst->hdc, pts, 1);
+ xDst = pts[0].x + physDevDst->dc_rect.left;
+ yDst = pts[0].y + physDevDst->dc_rect.top;
/* Update brush origin */
- GetBrushOrgEx(physDevDst->hUserDC, &ptBrush);
+ GetBrushOrgEx(physDevDst->hdc, &ptBrush);
+ ptBrush.x += physDevDst->dc_rect.left;
+ ptBrush.y += physDevDst->dc_rect.top;
RosGdiSetBrushOrg(physDevDst->hKernelDC, ptBrush.x, ptBrush.y);
//FIXME("xDst %d, yDst %d, widthDst %d, heightDst %d, src x %d y %d\n",
@@ -105,11 +109,11 @@
pts[1].x = xSrc + widthSrc;
pts[1].y = ySrc + heightSrc;
- LPtoDP(physDevSrc->hUserDC, pts, 2);
+ LPtoDP(physDevSrc->hdc, pts, 2);
widthSrc = pts[1].x - pts[0].x;
heightSrc = pts[1].y - pts[0].y;
- xSrc = pts[0].x;
- ySrc = pts[0].y;
+ xSrc = pts[0].x + physDevSrc->dc_rect.left;
+ ySrc = pts[0].y + physDevSrc->dc_rect.top;
}
/* map dest coordinates */
@@ -117,14 +121,16 @@
pts[0].y = yDst;
pts[1].x = xDst + widthDst;
pts[1].y = yDst + heightDst;
- LPtoDP(physDevDst->hUserDC, pts, 2);
+ LPtoDP(physDevDst->hdc, pts, 2);
widthDst = pts[1].x - pts[0].x;
heightDst = pts[1].y - pts[0].y;
- xDst = pts[0].x;
- yDst = pts[0].y;
+ xDst = pts[0].x + physDevDst->dc_rect.left;
+ yDst = pts[0].y + physDevDst->dc_rect.top;
/* Update brush origin */
- GetBrushOrgEx(physDevDst->hUserDC, &ptBrush);
+ GetBrushOrgEx(physDevDst->hdc, &ptBrush);
+ ptBrush.x += physDevDst->dc_rect.left;
+ ptBrush.y += physDevDst->dc_rect.top;
RosGdiSetBrushOrg(physDevDst->hKernelDC, ptBrush.x, ptBrush.y);
return RosGdiStretchBlt(physDevDst->hKernelDC, xDst, yDst, widthDst, heightDst,
@@ -145,11 +151,11 @@
pts[1].x = xSrc + widthSrc;
pts[1].y = ySrc + heightSrc;
- LPtoDP(physDevSrc->hUserDC, pts, 2);
+ LPtoDP(physDevSrc->hdc, pts, 2);
widthSrc = pts[1].x - pts[0].x;
heightSrc = pts[1].y - pts[0].y;
- xSrc = pts[0].x;
- ySrc = pts[0].y;
+ xSrc = pts[0].x + physDevSrc->dc_rect.left;
+ ySrc = pts[0].y + physDevSrc->dc_rect.top;
}
/* map dest coordinates */
@@ -158,14 +164,16 @@
pts[1].x = xDst + widthDst;
pts[1].y = yDst + heightDst;
- LPtoDP(physDevDst->hUserDC, pts, 2);
+ LPtoDP(physDevDst->hdc, pts, 2);
widthDst = pts[1].x - pts[0].x;
heightDst = pts[1].y - pts[0].y;
- xDst = pts[0].x;
- yDst = pts[0].y;
+ xDst = pts[0].x + physDevDst->dc_rect.left;
+ yDst = pts[0].y + physDevDst->dc_rect.top;
/* Update brush origin */
- GetBrushOrgEx(physDevDst->hUserDC, &ptBrush);
+ GetBrushOrgEx(physDevDst->hdc, &ptBrush);
+ ptBrush.x += physDevDst->dc_rect.left;
+ ptBrush.y += physDevDst->dc_rect.top;
RosGdiSetBrushOrg(physDevDst->hKernelDC, ptBrush.x, ptBrush.y);
return RosGdiAlphaBlend(physDevDst->hKernelDC, xDst, yDst, widthDst, heightDst,
Modified: branches/arwinss/reactos/dll/win32/winent.drv/dib.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winent.drv/dib.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winent.drv/dib.c [iso-8859-1] Thu Jan 6 13:13:47
2011
@@ -82,7 +82,9 @@
POINT pt;
pt.x = xDest; pt.y = yDest;
- LPtoDP(physDev->hUserDC, &pt, 1);
+ LPtoDP(physDev->hdc, &pt, 1);
+ pt.x += physDev->dc_rect.left;
+ pt.y += physDev->dc_rect.top;
/* Perform extensive parameter checking */
if (DIB_GetBitmapInfo( &info->bmiHeader, &width, &height,
Modified: branches/arwinss/reactos/dll/win32/winent.drv/font.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winent.drv/font.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winent.drv/font.c [iso-8859-1] Thu Jan 6 13:13:47
2011
@@ -201,14 +201,14 @@
*flags = 0;
- size = GetFontData(physDev->hUserDC, MS_GASP_TAG, 0, NULL, 0);
+ size = GetFontData(physDev->hdc, MS_GASP_TAG, 0, NULL, 0);
if(size == GDI_ERROR)
return FALSE;
gasp = buffer = HeapAlloc(GetProcessHeap(), 0, size);
- GetFontData(physDev->hUserDC, MS_GASP_TAG, 0, gasp, size);
-
- GetTextMetricsW(physDev->hUserDC, &tm);
+ GetFontData(physDev->hdc, MS_GASP_TAG, 0, gasp, size);
+
+ GetTextMetricsW(physDev->hdc, &tm);
ppem = abs(RosDrv_YWStoDS(physDev, tm.tmAscent + tm.tmDescent -
tm.tmInternalLeading));
gasp++;
@@ -389,13 +389,13 @@
break;
}
- buflen = GetGlyphOutlineW(physDev->hUserDC, glyph, ggo_format, &gm, 0, NULL,
&identity);
+ buflen = GetGlyphOutlineW(physDev->hdc, glyph, ggo_format, &gm, 0, NULL,
&identity);
if(buflen == GDI_ERROR) {
if(format != AA_None) {
format = AA_None;
entry->aa_default = AA_None;
ggo_format = GGO_GLYPH_INDEX | GGO_BITMAP;
- buflen = GetGlyphOutlineW(physDev->hUserDC, glyph, ggo_format, &gm, 0,
NULL, &identity);
+ buflen = GetGlyphOutlineW(physDev->hdc, glyph, ggo_format, &gm, 0,
NULL, &identity);
}
if(buflen == GDI_ERROR) {
WARN("GetGlyphOutlineW failed\n");
@@ -446,7 +446,7 @@
}
buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, buflen);
- GetGlyphOutlineW(physDev->hUserDC, glyph, ggo_format, &gm, buflen, buf,
&identity);
+ GetGlyphOutlineW(physDev->hdc, glyph, ggo_format, &gm, buflen, buf,
&identity);
formatEntry->realized[glyph] = TRUE;
TRACE("buflen = %d. Got metrics: %dx%d adv=%d,%d origin=%d,%d\n",
@@ -515,7 +515,7 @@
lfsz.lf.lfWidth = abs( lfsz.lf.lfWidth );
lfsz.devsize.cx = RosDrv_XWStoDS( physDev, lfsz.lf.lfWidth );
lfsz.devsize.cy = RosDrv_YWStoDS( physDev, lfsz.lf.lfHeight );
- GetWorldTransform( physDev->hUserDC, &lfsz.xform );
+ GetWorldTransform( physDev->hdc, &lfsz.xform );
lfsz_calc_hash(&lfsz);
/*EnterCriticalSection(&xrender_cs);*/
@@ -534,13 +534,14 @@
gsCacheEntry *entry;
gsCacheEntryFormat *formatEntry;
BOOL retv = FALSE;
- //HDC hdc = physDev->hUserDC;
+ //HDC hdc = physDev->hdc;
//int textPixel, backgroundPixel;
HRGN saved_region = 0;
BOOL disable_antialias = FALSE;
AA_Type aa_type = AA_None;
//DIBSECTION bmp;
unsigned int idx;
+ RECT rect;
//enum drawable_depth_type depth_type = (physDev->depth == 1) ? mono_drawable :
color_drawable;
//Picture tile_pict = 0;
@@ -577,16 +578,18 @@
HBRUSH brush, oldBrush;
HPEN pen, oldPen;
- brush = CreateSolidBrush(GetBkColor(physDev->hUserDC));
- oldBrush = SelectObject(physDev->hUserDC, brush);
+ brush = CreateSolidBrush(GetBkColor(physDev->hdc));
+ oldBrush = SelectObject(physDev->hdc, brush);
pen = CreatePen(PS_NULL, 0, 0);
- oldPen = SelectObject(physDev->hUserDC, pen);
-
- RosGdiRectangle(physDev->hKernelDC, (RECT*)lprect);
-
- DeleteObject(SelectObject(physDev->hUserDC, oldBrush));
- DeleteObject(SelectObject(physDev->hUserDC, oldPen));
+ oldPen = SelectObject(physDev->hdc, pen);
+
+ CopyRect(&rect, lprect);
+ OffsetRect(&rect, physDev->dc_rect.left, physDev->dc_rect.top);
+ RosGdiRectangle(physDev->hKernelDC, &rect);
+
+ DeleteObject(SelectObject(physDev->hdc, oldBrush));
+ DeleteObject(SelectObject(physDev->hdc, oldPen));
}
if(count == 0)
@@ -633,9 +636,9 @@
}
TRACE("Writing %s at %d,%d\n", debugstr_wn(wstr,count),
- /*physDev->dc_rect.left +*/ x, /*physDev->dc_rect.top +*/ y);
-
- RosGdiExtTextOut(physDev->hKernelDC, x, y, flags, lprect, wstr, count, lpDx,
formatEntry, aa_type);
+ physDev->dc_rect.left + x, physDev->dc_rect.top + y);
+
+ RosGdiExtTextOut(physDev->hKernelDC, physDev->dc_rect.left + x,
physDev->dc_rect.top + y, flags, lprect, wstr, count, lpDx, formatEntry, aa_type);
//LeaveCriticalSection(&xrender_cs);
Modified: branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c [iso-8859-1] Thu Jan 6
13:13:47 2011
@@ -56,7 +56,7 @@
/* Save newly created DC */
physDev->hKernelDC = hKernelDC;
- physDev->hUserDC = hdc;
+ physDev->hdc = hdc;
/* No font is selected */
physDev->cache_index = -1;
@@ -108,7 +108,8 @@
{
const struct ntdrv_escape_set_drawable *data = in_data;
- RosGdiSetDcRects(physDev->hKernelDC, (RECT*)&data->dc_rect,
(RECT*)&data->drawable_rect);
+ physDev->dc_rect = data->dc_rect;
+ RosGdiSetDcRects(physDev->hKernelDC, NULL,
(RECT*)&data->drawable_rect);
if (!data->release)
RosGdiGetDC(physDev->hKernelDC, data->hwnd,
data->clip_children);
@@ -116,7 +117,7 @@
RosGdiReleaseDC(physDev->hKernelDC);
TRACE( "SET_DRAWABLE hdc %p dc_rect %s drawable_rect
%s\n",
- physDev->hUserDC, wine_dbgstr_rect(&data->dc_rect),
wine_dbgstr_rect(&data->drawable_rect) );
+ physDev->hdc, wine_dbgstr_rect(&data->dc_rect),
wine_dbgstr_rect(&data->drawable_rect) );
return TRUE;
}
break;
@@ -226,7 +227,7 @@
/* If it's a stock object, then use DC's color */
if (hpen == GetStockObject( DC_PEN ))
- logpen.lopnColor = GetDCPenColor(physDev->hUserDC);
+ logpen.lopnColor = GetDCPenColor(physDev->hdc);
/* Call kernelmode */
RosGdiSelectPen(physDev->hKernelDC, &logpen, elogpen);
Modified: branches/arwinss/reactos/dll/win32/winent.drv/graphics.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winent.drv/graphics.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winent.drv/graphics.c [iso-8859-1] Thu Jan 6
13:13:47 2011
@@ -50,9 +50,10 @@
void CDECL RosDrv_SetDeviceClipping( NTDRV_PDEVICE *physDev, HRGN vis_rgn, HRGN clip_rgn
)
{
RGNDATA *data;
- DWORD size;
-
- //FIXME("SetDeviceClipping hdc %x\n", physDev->hUserDC);
+ DWORD size, i;
+ RECT *pRects;
+
+ //FIXME("SetDeviceClipping hdc %x\n", physDev->hdc);
/* Update dc region to become a combined region */
CombineRgn( physDev->region, vis_rgn, clip_rgn, clip_rgn ? RGN_AND : RGN_COPY );
@@ -71,6 +72,14 @@
HeapFree( GetProcessHeap(), 0, data );
return;
}
+
+ /* Offset all rects */
+ pRects = (RECT *)data->Buffer;
+ for (i=0; i<data->rdh.nCount; i++)
+ OffsetRect(&pRects[i], physDev->dc_rect.left, physDev->dc_rect.top);
+
+ /* Offset bounding rect */
+ OffsetRect(&data->rdh.rcBound, physDev->dc_rect.left,
physDev->dc_rect.top);
/* Set clipping */
RosGdiSetDeviceClipping(physDev->hKernelDC, data->rdh.nCount, (RECTL
*)data->Buffer, (RECTL *)&data->rdh.rcBound);
@@ -93,7 +102,7 @@
pt[0].y = 0;
pt[1].x = width;
pt[1].y = 0;
- LPtoDP( physDev->hUserDC, pt, 2 );
+ LPtoDP( physDev->hdc, pt, 2 );
return pt[1].x - pt[0].x;
}
@@ -110,7 +119,7 @@
pt[0].y = 0;
pt[1].x = 0;
pt[1].y = height;
- LPtoDP( physDev->hUserDC, pt, 2 );
+ LPtoDP( physDev->hdc, pt, 2 );
return pt[1].y - pt[0].y;
}
@@ -119,21 +128,23 @@
POINT pt[2];
/* Get current cursor position */
- GetCurrentPositionEx( physDev->hUserDC, &pt[0] );
+ GetCurrentPositionEx( physDev->hdc, &pt[0] );
/* Convert both points coordinates to device */
pt[1].x = x;
pt[1].y = y;
- LPtoDP( physDev->hUserDC, pt, 2 );
+ LPtoDP( physDev->hdc, pt, 2 );
/* Draw the line */
- return RosGdiLineTo(physDev->hKernelDC, pt[0].x, pt[0].y, pt[1].x, pt[1].y);
+ return RosGdiLineTo(physDev->hKernelDC, physDev->dc_rect.left + pt[0].x,
physDev->dc_rect.top + pt[0].y,
+ physDev->dc_rect.left + pt[1].x, physDev->dc_rect.top + pt[1].y);
}
BOOL CDECL RosDrv_Arc( NTDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend )
{
POINT pts[4];
+ DWORD i;
/* Map coordinates */
pts[0].x = left;
@@ -145,7 +156,13 @@
pts[3].x = xend;
pts[3].y = yend;
- LPtoDP(physDev->hUserDC, pts, 4);
+ LPtoDP(physDev->hdc, pts, 4);
+
+ for (i=0; i<4; i++)
+ {
+ pts[i].x += physDev->dc_rect.left;
+ pts[i].y += physDev->dc_rect.top;
+ }
return RosGdiArc(physDev->hKernelDC, pts[0].x, pts[0].y, pts[1].x, pts[1].y,
pts[2].x, pts[2].y, pts[3].x, pts[3].y, GdiTypeArc);
@@ -155,6 +172,7 @@
INT xstart, INT ystart, INT xend, INT yend )
{
POINT pts[4];
+ DWORD i;
/* Map coordinates */
pts[0].x = left;
@@ -166,7 +184,13 @@
pts[3].x = xend;
pts[3].y = yend;
- LPtoDP(physDev->hUserDC, pts, 4);
+ LPtoDP(physDev->hdc, pts, 4);
+
+ for (i=0; i<4; i++)
+ {
+ pts[i].x += physDev->dc_rect.left;
+ pts[i].y += physDev->dc_rect.top;
+ }
return RosGdiArc(physDev->hKernelDC, pts[0].x, pts[0].y, pts[1].x, pts[1].y,
pts[2].x, pts[2].y, pts[3].x, pts[3].y, GdiTypePie);
@@ -176,6 +200,7 @@
INT xstart, INT ystart, INT xend, INT yend )
{
POINT pts[4];
+ DWORD i;
/* Map coordinates */
pts[0].x = left;
@@ -187,7 +212,13 @@
pts[3].x = xend;
pts[3].y = yend;
- LPtoDP(physDev->hUserDC, pts, 4);
+ LPtoDP(physDev->hdc, pts, 4);
+
+ for (i=0; i<4; i++)
+ {
+ pts[i].x += physDev->dc_rect.left;
+ pts[i].y += physDev->dc_rect.top;
+ }
return RosGdiArc(physDev->hKernelDC, pts[0].x, pts[0].y, pts[1].x, pts[1].y,
pts[2].x, pts[2].y, pts[3].x, pts[3].y, GdiTypeChord );
@@ -196,6 +227,7 @@
BOOL CDECL RosDrv_Ellipse( NTDRV_PDEVICE *physDev, INT left, INT top, INT right, INT
bottom )
{
POINT pts[2];
+ DWORD i;
/* Map coordinates */
pts[0].x = left;
@@ -203,7 +235,13 @@
pts[1].x = right;
pts[1].y = bottom;
- LPtoDP(physDev->hUserDC, pts, 2);
+ LPtoDP(physDev->hdc, pts, 2);
+
+ for (i=0; i<2; i++)
+ {
+ pts[i].x += physDev->dc_rect.left;
+ pts[i].y += physDev->dc_rect.top;
+ }
return RosGdiEllipse(physDev->hKernelDC, pts[0].x, pts[0].y, pts[1].x, pts[1].y);
}
@@ -211,7 +249,7 @@
BOOL CDECL RosDrv_Rectangle(NTDRV_PDEVICE *physDev, INT left, INT top, INT right, INT
bottom)
{
POINT ptBrush;
- RECT rc = get_device_rect( physDev->hUserDC, left, top, right, bottom );
+ RECT rc = get_device_rect( physDev->hdc, left, top, right, bottom );
if ((rc.left == rc.right) || (rc.top == rc.bottom)) return TRUE;
@@ -219,9 +257,12 @@
if (rc.bottom < rc.top) { INT tmp = rc.bottom; rc.bottom = rc.top; rc.top = tmp;
}
/* Update brush origin */
- GetBrushOrgEx(physDev->hUserDC, &ptBrush);
+ GetBrushOrgEx(physDev->hdc, &ptBrush);
+ ptBrush.x += physDev->dc_rect.left;
+ ptBrush.y += physDev->dc_rect.top;
RosGdiSetBrushOrg(physDev->hKernelDC, ptBrush.x, ptBrush.y);
+ OffsetRect(&rc, physDev->dc_rect.left, physDev->dc_rect.top);
RosGdiRectangle(physDev->hKernelDC, &rc);
return TRUE;
@@ -240,9 +281,9 @@
/* Transform to device coordinates */
ptPixel.x = x; ptPixel.y = y;
- LPtoDP(physDev->hUserDC, &ptPixel, 1);
-
- return RosGdiSetPixel(physDev->hKernelDC, ptPixel.x, ptPixel.y, color);
+ LPtoDP(physDev->hdc, &ptPixel, 1);
+
+ return RosGdiSetPixel(physDev->hKernelDC, physDev->dc_rect.left + ptPixel.x,
physDev->dc_rect.top + ptPixel.y, color);
}
COLORREF CDECL RosDrv_GetPixel( NTDRV_PDEVICE *physDev, INT x, INT y )
@@ -251,9 +292,9 @@
/* Transform to device coordinates */
ptPixel.x = x; ptPixel.y = y;
- LPtoDP(physDev->hUserDC, &ptPixel, 1);
-
- return RosGdiGetPixel(physDev->hKernelDC, ptPixel.x, ptPixel.y);
+ LPtoDP(physDev->hdc, &ptPixel, 1);
+
+ return RosGdiGetPixel(physDev->hKernelDC, physDev->dc_rect.left + ptPixel.x,
physDev->dc_rect.top + ptPixel.y);
}
BOOL CDECL RosDrv_PaintRgn( NTDRV_PDEVICE *physDev, HRGN hrgn )
@@ -275,9 +316,9 @@
for (i = 0; i < count; i++)
{
POINT tmp = pt[i];
- LPtoDP(physDev->hUserDC, &tmp, 1);
- points[i].x = tmp.x;
- points[i].y = tmp.y;
+ LPtoDP(physDev->hdc, &tmp, 1);
+ points[i].x = physDev->dc_rect.left + tmp.x;
+ points[i].y = physDev->dc_rect.top + tmp.y;
}
/* Call kernel mode */
@@ -301,14 +342,16 @@
for (i = 0; i < count; i++)
{
POINT tmp = pt[i];
- LPtoDP(physDev->hUserDC, &tmp, 1);
- points[i].x = tmp.x;
- points[i].y = tmp.y;
+ LPtoDP(physDev->hdc, &tmp, 1);
+ points[i].x = physDev->dc_rect.left + tmp.x;
+ points[i].y = physDev->dc_rect.top + tmp.y;
}
points[count] = points[0];
/* Update brush origin */
- GetBrushOrgEx(physDev->hUserDC, &ptBrush);
+ GetBrushOrgEx(physDev->hdc, &ptBrush);
+ ptBrush.x += physDev->dc_rect.left;
+ ptBrush.y += physDev->dc_rect.top;
RosGdiSetBrushOrg(physDev->hKernelDC, ptBrush.x, ptBrush.y);
/* Call kernel mode */
@@ -338,9 +381,9 @@
/* Transform to device coordinates */
ptPixel.x = x; ptPixel.y = y;
- LPtoDP(physDev->hUserDC, &ptPixel, 1);
-
- return RosGdiExtFloodFill(physDev->hKernelDC, ptPixel.x, ptPixel.y, color,
fillType);
+ LPtoDP(physDev->hdc, &ptPixel, 1);
+
+ return RosGdiExtFloodFill(physDev->hKernelDC, physDev->dc_rect.left +
ptPixel.x, physDev->dc_rect.top + ptPixel.y, color, fillType);
}
COLORREF CDECL RosDrv_SetBkColor( NTDRV_PDEVICE *physDev, COLORREF color )
Modified: branches/arwinss/reactos/dll/win32/winent.drv/ogldrv.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winent.drv/ogldrv.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winent.drv/ogldrv.c [iso-8859-1] Thu Jan 6
13:13:47 2011
@@ -60,7 +60,7 @@
if (!InitOGL())
return 0;
- return glChoosePixelFormat(physDev->hUserDC, ppfd);
+ return glChoosePixelFormat(physDev->hdc, ppfd);
}
INT CDECL RosDrv_GetPixelFormat(NTDRV_PDEVICE *physDev)
@@ -69,7 +69,7 @@
if (!InitOGL())
return 0;
- return glGetPixelFormat(physDev->hUserDC);
+ return glGetPixelFormat(physDev->hdc);
}
INT CDECL RosDrv_DescribePixelFormat(NTDRV_PDEVICE *physDev,
@@ -81,7 +81,7 @@
if (!InitOGL())
return 0;
- return glDescribePixelFormat(physDev->hUserDC, iPixelFormat, nBytes, ppfd);
+ return glDescribePixelFormat(physDev->hdc, iPixelFormat, nBytes, ppfd);
}
BOOL CDECL RosDrv_SetPixelFormat(NTDRV_PDEVICE *physDev,
@@ -92,7 +92,7 @@
if (!InitOGL())
return 0;
- return glSetPixelFormat(physDev->hUserDC, iPixelFormat, ppfd);
+ return glSetPixelFormat(physDev->hdc, iPixelFormat, ppfd);
}
@@ -102,7 +102,7 @@
if (!InitOGL())
return 0;
- return glSwapBuffers(physDev->hUserDC);
+ return glSwapBuffers(physDev->hdc);
}
/* EOF */
Modified: branches/arwinss/reactos/include/reactos/wine/ntrosgdi.h
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/include/reactos…
==============================================================================
--- branches/arwinss/reactos/include/reactos/wine/ntrosgdi.h [iso-8859-1] (original)
+++ branches/arwinss/reactos/include/reactos/wine/ntrosgdi.h [iso-8859-1] Thu Jan 6
13:13:47 2011
@@ -10,22 +10,12 @@
typedef struct _NTDRV_PDEVICE
{
- HDC hUserDC;
+ HDC hdc;
HDC hKernelDC;
+ RECT dc_rect; /* DC rectangle relative to drawable */
HRGN region; /* Device region (visible region & clip region) */
int cache_index; /* cache of a currently selected font */
} NTDRV_PDEVICE, *PNTDRV_PDEVICE;
-
-typedef struct _ROS_DCINFO
-{
- WORD dwType;
- SIZE szVportExt;
- POINT ptVportOrg;
- SIZE szWndExt;
- POINT ptWndOrg;
- XFORM xfWorld2Wnd;
- XFORM xfWnd2Vport;
-} ROS_DCINFO, *PROS_DCINFO;
typedef struct
{
@@ -97,8 +87,8 @@
INT widthSrc, INT heightSrc, DWORD rop );
/* dc.c */
-BOOL APIENTRY RosGdiCreateDC( PROS_DCINFO dc, HDC *pdev, LPCWSTR driver, LPCWSTR device,
- LPCWSTR output, const DEVMODEW* initData );
+BOOL APIENTRY RosGdiCreateDC( HDC *pdev, LPCWSTR driver, LPCWSTR device,
+ LPCWSTR output, const DEVMODEW* initData, ULONG dcType );
BOOL APIENTRY RosGdiDeleteDC( HDC physDev );
BOOL APIENTRY RosGdiGetDCOrgEx( HDC physDev, LPPOINT lpp );
BOOL APIENTRY RosGdiPaintRgn( HDC physDev, HRGN hrgn );