From c9353947a1f78749475f972e661d239d6ed59a1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Sun, 11 Apr 2010 21:32:53 +0000 Subject: [PATCH] completely revert 46733 svn path=/branches/reactos-yarotows/; revision=46846 --- subsystems/win32/win32k/include/dc.h | 11 ++++++----- subsystems/win32/win32k/objects/dclife.c | 3 +-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/subsystems/win32/win32k/include/dc.h b/subsystems/win32/win32k/include/dc.h index 36ffef2a71b..8578f8e7070 100644 --- a/subsystems/win32/win32k/include/dc.h +++ b/subsystems/win32/win32k/include/dc.h @@ -176,9 +176,12 @@ DC_LockDc(HDC hdc) /* Acquire shared PDEV lock */ EngAcquireSemaphoreShared(pdc->ppdev->hsemDevLock); - /* Assign Surface */ - pdc->dclevel.pSurface = PDEVOBJ_pSurface(pdc->ppdev); - + /* Update Surface if needed */ + if(pdc->dclevel.pSurface != pdc->ppdev->pSurface) + { + if(pdc->dclevel.pSurface) SURFACE_ShareUnlockSurface(pdc->dclevel.pSurface); + pdc->dclevel.pSurface = PDEVOBJ_pSurface(pdc->ppdev); + } } return pdc; } @@ -189,8 +192,6 @@ DC_UnlockDc(PDC pdc) { if(pdc->dctype == DCTYPE_DIRECT) { - /* Release surface lock */ - SURFACE_ShareUnlockSurface(pdc->dclevel.pSurface); /* Release PDEV lock */ EngReleaseSemaphore(pdc->ppdev->hsemDevLock); } diff --git a/subsystems/win32/win32k/objects/dclife.c b/subsystems/win32/win32k/objects/dclife.c index 02fc6c5572c..9e6b5b0f192 100644 --- a/subsystems/win32/win32k/objects/dclife.c +++ b/subsystems/win32/win32k/objects/dclife.c @@ -377,8 +377,7 @@ ASSERT(pdc->rosdc.hGCClipRgn); PATH_Delete(pdc->dclevel.hPath); - /* Ideally, no DC should hold a lock on a surface when being deleted */ - if(pdc->dclevel.pSurface && pdc->dctype != DCTYPE_DIRECT) + if(pdc->dclevel.pSurface) SURFACE_ShareUnlockSurface(pdc->dclevel.pSurface); PDEVOBJ_vRelease(pdc->ppdev) ;