Re: [ros-dev] [ros-diffs] [jgardou] 57129: [WIN32K] - Use the right surface for direct DCs in DIB transfer functions It could have changed with a display settings change
Hmmm I don't think that this is a good idea. We must call DC_vPrepareForBlit to lock the surfaces, otherwise we run into race conditions. And we should really also care for the mouse cursor, otherwise we might make it unhappy. Anyway, I don't care about this code, since I already rewrote it :D Anyway, I think it's time to ASSERT device locks. Am 22.08.2012 18:45, schrieb jgar...@svn.reactos.org: Author: jgardou Date: Wed Aug 22 16:45:49 2012 New Revision: 57129 URL: http://svn.reactos.org/svn/reactos?rev=57129view=rev Log: [WIN32K] - Use the right surface for direct DCs in DIB transfer functions It could have changed with a display settings change Modified: trunk/reactos/win32ss/gdi/ntgdi/dibobj.c Modified: trunk/reactos/win32ss/gdi/ntgdi/dibobj.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dibobj.c?rev=57129r1=57128r2=57129view=diff == --- trunk/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] Wed Aug 22 16:45:49 2012 @@ -447,8 +447,16 @@ DC_UnlockDc(pDC); goto Exit2; } - -pSurf = pDC-dclevel.pSurface; + +/* + * Select the right surface. + * NOTE: we don't call DC_vPrepareDCsForBlit, because we don't + * care about mouse, visible region or brushes in this API. + */ +if(pDC-dctype == DCTYPE_DIRECT) +pSurf = pDC-ppdev-pSurface; +else +pSurf = pDC-dclevel.pSurface; if (!pSurf) { DC_UnlockDc(pDC); @@ -1113,7 +1121,15 @@ goto cleanup; } -psurfDst = pdc-dclevel.pSurface; +/* + * Select the right surface. + * NOTE: we don't call DC_vPrepareDCsForBlit, because we don't + * care about mouse, visible region or brushes in this API. + */ +if(pdc-dctype == DCTYPE_DIRECT) +psurfDst = pdc-ppdev-pSurface; +else +psurfDst = pdc-dclevel.pSurface; if (!psurfDst) { // CHECKME ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Re: [ros-dev] [ros-diffs] [jgardou] 57129: [WIN32K] - Use the right surface for direct DCs in DIB transfer functions It could have changed with a display settings change
Oh, right, I forgot about the lock... Commit your rewrite :-) Timo Kreuzer a écrit : Hmmm I don't think that this is a good idea. We must call DC_vPrepareForBlit to lock the surfaces, otherwise we run into race conditions. And we should really also care for the mouse cursor, otherwise we might make it unhappy. Anyway, I don't care about this code, since I already rewrote it :D Anyway, I think it's time to ASSERT device locks. Am 22.08.2012 18:45, schrieb jgar...@svn.reactos.org: Author: jgardou Date: Wed Aug 22 16:45:49 2012 New Revision: 57129 URL: http://svn.reactos.org/svn/reactos?rev=57129view=rev Log: [WIN32K] - Use the right surface for direct DCs in DIB transfer functions It could have changed with a display settings change Modified: trunk/reactos/win32ss/gdi/ntgdi/dibobj.c Modified: trunk/reactos/win32ss/gdi/ntgdi/dibobj.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dibobj.c?rev=57129r1=57128r2=57129view=diff == --- trunk/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] Wed Aug 22 16:45:49 2012 @@ -447,8 +447,16 @@ DC_UnlockDc(pDC); goto Exit2; } - -pSurf = pDC-dclevel.pSurface; + +/* + * Select the right surface. + * NOTE: we don't call DC_vPrepareDCsForBlit, because we don't + * care about mouse, visible region or brushes in this API. + */ +if(pDC-dctype == DCTYPE_DIRECT) +pSurf = pDC-ppdev-pSurface; +else +pSurf = pDC-dclevel.pSurface; if (!pSurf) { DC_UnlockDc(pDC); @@ -1113,7 +1121,15 @@ goto cleanup; } -psurfDst = pdc-dclevel.pSurface; +/* + * Select the right surface. + * NOTE: we don't call DC_vPrepareDCsForBlit, because we don't + * care about mouse, visible region or brushes in this API. + */ +if(pdc-dctype == DCTYPE_DIRECT) +psurfDst = pdc-ppdev-pSurface; +else +psurfDst = pdc-dclevel.pSurface; if (!psurfDst) { // CHECKME ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev