From 38a5ae755fb9611c74d9965173e808f070288a87 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 30 Oct 2009 15:00:08 +0000 Subject: [PATCH] [FORMATTING] - apply consistent indentattion of 4 spaces - remove () from return statements svn path=/trunk/; revision=43848 --- .../subsystems/win32/win32k/eng/copybits.c | 274 +++++++++--------- 1 file changed, 139 insertions(+), 135 deletions(-) diff --git a/reactos/subsystems/win32/win32k/eng/copybits.c b/reactos/subsystems/win32/win32k/eng/copybits.c index 9c19febbf71..6fcb67c3833 100644 --- a/reactos/subsystems/win32/win32k/eng/copybits.c +++ b/reactos/subsystems/win32/win32k/eng/copybits.c @@ -36,183 +36,187 @@ */ BOOL APIENTRY EngCopyBits(SURFOBJ *psoDest, - SURFOBJ *psoSource, - CLIPOBJ *Clip, - XLATEOBJ *ColorTranslation, - RECTL *DestRect, - POINTL *SourcePoint) + SURFOBJ *psoSource, + CLIPOBJ *Clip, + XLATEOBJ *ColorTranslation, + RECTL *DestRect, + POINTL *SourcePoint) { - BOOLEAN ret; - BYTE clippingType; - RECT_ENUM RectEnum; - BOOL EnumMore; - BLTINFO BltInfo; - SURFACE *psurfDest; - SURFACE *psurfSource; - - ASSERT(psoDest != NULL && psoSource != NULL && DestRect != NULL && SourcePoint != NULL); - - psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj); - SURFACE_LockBitmapBits(psurfSource); - - psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj); - if (psoDest != psoSource) - { - SURFACE_LockBitmapBits(psurfDest); - } - - // FIXME: Don't punt to the driver's DrvCopyBits immediately. Instead, - // mark the copy block function to be DrvCopyBits instead of the - // GDI's copy bit function so as to remove clipping from the - // driver's responsibility - - // If one of the surfaces isn't managed by the GDI - if((psoDest->iType!=STYPE_BITMAP) || (psoSource->iType!=STYPE_BITMAP)) - { - // Destination surface is device managed - if(psoDest->iType!=STYPE_BITMAP) + BOOLEAN ret; + BYTE clippingType; + RECT_ENUM RectEnum; + BOOL EnumMore; + BLTINFO BltInfo; + SURFACE *psurfDest; + SURFACE *psurfSource; + + ASSERT(psoDest != NULL && psoSource != NULL && DestRect != NULL && SourcePoint != NULL); + + psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj); + SURFACE_LockBitmapBits(psurfSource); + + psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj); + if (psoDest != psoSource) { - /* FIXME: Eng* functions shouldn't call Drv* functions. ? */ - if (psurfDest->flHooks & HOOK_COPYBITS) - { - ret = GDIDEVFUNCS(psoDest).CopyBits( - psoDest, psoSource, Clip, ColorTranslation, DestRect, SourcePoint); + SURFACE_LockBitmapBits(psurfDest); + } - if (psoDest != psoSource) + // FIXME: Don't punt to the driver's DrvCopyBits immediately. Instead, + // mark the copy block function to be DrvCopyBits instead of the + // GDI's copy bit function so as to remove clipping from the + // driver's responsibility + + // If one of the surfaces isn't managed by the GDI + if ((psoDest->iType!=STYPE_BITMAP) || (psoSource->iType!=STYPE_BITMAP)) + { + // Destination surface is device managed + if (psoDest->iType!=STYPE_BITMAP) { - SURFACE_UnlockBitmapBits(psurfDest); + /* FIXME: Eng* functions shouldn't call Drv* functions. ? */ + if (psurfDest->flHooks & HOOK_COPYBITS) + { + ret = GDIDEVFUNCS(psoDest).CopyBits( + psoDest, psoSource, Clip, ColorTranslation, DestRect, SourcePoint); + + if (psoDest != psoSource) + { + SURFACE_UnlockBitmapBits(psurfDest); + } + SURFACE_UnlockBitmapBits(psurfSource); + + return ret; + } } - SURFACE_UnlockBitmapBits(psurfSource); - return ret; - } - } + // Source surface is device managed + if (psoSource->iType!=STYPE_BITMAP) + { + /* FIXME: Eng* functions shouldn't call Drv* functions. ? */ + if (psurfSource->flHooks & HOOK_COPYBITS) + { + ret = GDIDEVFUNCS(psoSource).CopyBits( + psoDest, psoSource, Clip, ColorTranslation, DestRect, SourcePoint); + + if (psoDest != psoSource) + { + SURFACE_UnlockBitmapBits(psurfDest); + } + SURFACE_UnlockBitmapBits(psurfSource); + + return ret; + } + } - // Source surface is device managed - if(psoSource->iType!=STYPE_BITMAP) - { - /* FIXME: Eng* functions shouldn't call Drv* functions. ? */ - if (psurfSource->flHooks & HOOK_COPYBITS) - { - ret = GDIDEVFUNCS(psoSource).CopyBits( - psoDest, psoSource, Clip, ColorTranslation, DestRect, SourcePoint); + // If CopyBits wasn't hooked, BitBlt must be + ret = IntEngBitBlt(psoDest, psoSource, + NULL, Clip, ColorTranslation, DestRect, SourcePoint, + NULL, NULL, NULL, ROP3_TO_ROP4(SRCCOPY)); if (psoDest != psoSource) { - SURFACE_UnlockBitmapBits(psurfDest); + SURFACE_UnlockBitmapBits(psurfDest); } SURFACE_UnlockBitmapBits(psurfSource); return ret; - } } - // If CopyBits wasn't hooked, BitBlt must be - ret = IntEngBitBlt(psoDest, psoSource, - NULL, Clip, ColorTranslation, DestRect, SourcePoint, - NULL, NULL, NULL, ROP3_TO_ROP4(SRCCOPY)); - - if (psoDest != psoSource) + // Determine clipping type + if (Clip == (CLIPOBJ *) NULL) { - SURFACE_UnlockBitmapBits(psurfDest); + clippingType = DC_TRIVIAL; + } + else + { + clippingType = Clip->iDComplexity; } - SURFACE_UnlockBitmapBits(psurfSource); - - return ret; - } - - // Determine clipping type - if (Clip == (CLIPOBJ *) NULL) - { - clippingType = DC_TRIVIAL; - } else { - clippingType = Clip->iDComplexity; - } - BltInfo.DestSurface = psoDest; - BltInfo.SourceSurface = psoSource; - BltInfo.PatternSurface = NULL; - BltInfo.XlateSourceToDest = ColorTranslation; - BltInfo.Rop4 = SRCCOPY; + BltInfo.DestSurface = psoDest; + BltInfo.SourceSurface = psoSource; + BltInfo.PatternSurface = NULL; + BltInfo.XlateSourceToDest = ColorTranslation; + BltInfo.Rop4 = SRCCOPY; - switch(clippingType) + switch (clippingType) { - case DC_TRIVIAL: - BltInfo.DestRect = *DestRect; - BltInfo.SourcePoint = *SourcePoint; + case DC_TRIVIAL: + BltInfo.DestRect = *DestRect; + BltInfo.SourcePoint = *SourcePoint; - DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo); + DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo); - MouseSafetyOnDrawEnd(psoDest); - if (psoDest != psoSource) - { - SURFACE_UnlockBitmapBits(psurfDest); - } - SURFACE_UnlockBitmapBits(psurfSource); + MouseSafetyOnDrawEnd(psoDest); + if (psoDest != psoSource) + { + SURFACE_UnlockBitmapBits(psurfDest); + } + SURFACE_UnlockBitmapBits(psurfSource); - return(TRUE); + return TRUE; - case DC_RECT: - // Clip the blt to the clip rectangle - RECTL_bIntersectRect(&BltInfo.DestRect, DestRect, &Clip->rclBounds); + case DC_RECT: + // Clip the blt to the clip rectangle + RECTL_bIntersectRect(&BltInfo.DestRect, DestRect, &Clip->rclBounds); - BltInfo.SourcePoint.x = SourcePoint->x + BltInfo.DestRect.left - DestRect->left; - BltInfo.SourcePoint.y = SourcePoint->y + BltInfo.DestRect.top - DestRect->top; + BltInfo.SourcePoint.x = SourcePoint->x + BltInfo.DestRect.left - DestRect->left; + BltInfo.SourcePoint.y = SourcePoint->y + BltInfo.DestRect.top - DestRect->top; - DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo); + DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo); - if (psoDest != psoSource) - { - SURFACE_UnlockBitmapBits(psurfDest); - } - SURFACE_UnlockBitmapBits(psurfSource); + if (psoDest != psoSource) + { + SURFACE_UnlockBitmapBits(psurfDest); + } + SURFACE_UnlockBitmapBits(psurfSource); - return(TRUE); + return TRUE; - case DC_COMPLEX: + case DC_COMPLEX: - CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_ANY, 0); + CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_ANY, 0); - do { - EnumMore = CLIPOBJ_bEnum(Clip,(ULONG) sizeof(RectEnum), (PVOID) &RectEnum); + do + { + EnumMore = CLIPOBJ_bEnum(Clip,(ULONG) sizeof(RectEnum), (PVOID) &RectEnum); - if (RectEnum.c > 0) - { - RECTL* prclEnd = &RectEnum.arcl[RectEnum.c]; - RECTL* prcl = &RectEnum.arcl[0]; + if (RectEnum.c > 0) + { + RECTL* prclEnd = &RectEnum.arcl[RectEnum.c]; + RECTL* prcl = &RectEnum.arcl[0]; - do { - RECTL_bIntersectRect(&BltInfo.DestRect, prcl, DestRect); + do + { + RECTL_bIntersectRect(&BltInfo.DestRect, prcl, DestRect); - BltInfo.SourcePoint.x = SourcePoint->x + prcl->left - DestRect->left; - BltInfo.SourcePoint.y = SourcePoint->y + prcl->top - DestRect->top; + BltInfo.SourcePoint.x = SourcePoint->x + prcl->left - DestRect->left; + BltInfo.SourcePoint.y = SourcePoint->y + prcl->top - DestRect->top; - if(!DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo)) - return FALSE; + if (!DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo)) + return FALSE; - prcl++; + prcl++; - } while (prcl < prclEnd); - } + } while (prcl < prclEnd); + } - } while(EnumMore); + } while (EnumMore); - if (psoDest != psoSource) - { - SURFACE_UnlockBitmapBits(psurfDest); - } - SURFACE_UnlockBitmapBits(psurfSource); + if (psoDest != psoSource) + { + SURFACE_UnlockBitmapBits(psurfDest); + } + SURFACE_UnlockBitmapBits(psurfSource); - return(TRUE); + return TRUE; } - if (psoDest != psoSource) - { - SURFACE_UnlockBitmapBits(psurfDest); - } - SURFACE_UnlockBitmapBits(psurfSource); + if (psoDest != psoSource) + { + SURFACE_UnlockBitmapBits(psurfDest); + } + SURFACE_UnlockBitmapBits(psurfSource); - return FALSE; + return FALSE; } BOOL APIENTRY @@ -227,8 +231,8 @@ IntEngCopyBits( BOOL bResult; MouseSafetyOnDrawStart(psoSource, ptlSource->x, ptlSource->y, - (ptlSource->x + abs(prclDest->right - prclDest->left)), - (ptlSource->y + abs(prclDest->bottom - prclDest->top))); + (ptlSource->x + abs(prclDest->right - prclDest->left)), + (ptlSource->y + abs(prclDest->bottom - prclDest->top))); MouseSafetyOnDrawStart(psoDest, prclDest->left, prclDest->top, prclDest->right, prclDest->bottom); -- 2.17.1