a few more minor speed-up

svn path=/trunk/; revision=8879
This commit is contained in:
Thomas Bluemel 2004-03-27 00:35:02 +00:00
parent bf9c49bb8b
commit 3868dbd0a0
7 changed files with 33 additions and 33 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: lineto.c,v 1.30 2004/02/24 13:27:02 weiden Exp $
* $Id: lineto.c,v 1.31 2004/03/27 00:35:02 weiden Exp $
*/
#include <ddk/winddi.h>
@ -72,7 +72,7 @@ NWtoSE(SURFOBJ* OutputObj, SURFGDI* OutputGDI, CLIPOBJ* Clip,
ClipRect = RectEnum.arcl;
delta = max(deltax, deltay);
i = 0;
error = delta / 2;
error = delta >> 1;
while (i < delta && (ClipRect < RectEnum.arcl + RectEnum.c || EnumMore))
{
while ((ClipRect < RectEnum.arcl + RectEnum.c /* there's still a current clip rect */
@ -142,7 +142,7 @@ SWtoNE(SURFOBJ* OutputObj, SURFGDI* OutputGDI, CLIPOBJ* Clip,
ClipRect = RectEnum.arcl;
delta = max(deltax, deltay);
i = 0;
error = delta / 2;
error = delta >> 1;
while (i < delta && (ClipRect < RectEnum.arcl + RectEnum.c || EnumMore))
{
while ((ClipRect < RectEnum.arcl + RectEnum.c
@ -211,7 +211,7 @@ NEtoSW(SURFOBJ* OutputObj, SURFGDI* OutputGDI, CLIPOBJ* Clip,
ClipRect = RectEnum.arcl;
delta = max(deltax, deltay);
i = 0;
error = delta / 2;
error = delta >> 1;
while (i < delta && (ClipRect < RectEnum.arcl + RectEnum.c || EnumMore))
{
while ((ClipRect < RectEnum.arcl + RectEnum.c
@ -280,7 +280,7 @@ SEtoNW(SURFOBJ* OutputObj, SURFGDI* OutputGDI, CLIPOBJ* Clip,
ClipRect = RectEnum.arcl;
delta = max(deltax, deltay);
i = 0;
error = delta / 2;
error = delta >> 1;
while (i < delta && (ClipRect < RectEnum.arcl + RectEnum.c || EnumMore))
{
while ((ClipRect < RectEnum.arcl + RectEnum.c

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: bezier.c,v 1.5 2004/02/19 21:12:10 weiden Exp $ */
/* $Id: bezier.c,v 1.6 2004/03/27 00:35:02 weiden Exp $ */
#include <windows.h>
#include <ddk/ntddk.h>
#include <math.h>
@ -62,8 +62,8 @@
* */
#define BEZIERMIDDLE(Mid, P1, P2) \
(Mid).x=((P1).x+(P2).x + 1)/2;\
(Mid).y=((P1).y+(P2).y + 1)/2;
(Mid).x=((P1).x+(P2).x + 1) >> 1;\
(Mid).y=((P1).y+(P2).y + 1) >> 1;
static int abs ( int __x )
{

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: color.c,v 1.34 2004/02/24 13:27:03 weiden Exp $ */
/* $Id: color.c,v 1.35 2004/03/27 00:35:02 weiden Exp $ */
// FIXME: Use PXLATEOBJ logicalToSystem instead of int *mapping
@ -120,7 +120,7 @@ HPALETTE STDCALL NtGdiCreateHalftonePalette(HDC hDC)
for (i = 216; i < 246; i++)
{
int v = (i - 216) * 8;
int v = (i - 216) << 3;
Palette.aEntries[i].peRed = v;
Palette.aEntries[i].peGreen = v;
Palette.aEntries[i].peBlue = v;

View file

@ -1,5 +1,5 @@
/*
* $Id: dib.c,v 1.43 2004/03/15 22:06:55 gvg Exp $
* $Id: dib.c,v 1.44 2004/03/27 00:35:02 weiden Exp $
*
* ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
@ -1190,12 +1190,12 @@ INT FASTCALL DIB_GetDIBWidthBytes (INT width, INT depth)
switch(depth)
{
case 1: words = (width + 31) / 32; break;
case 4: words = (width + 7) / 8; break;
case 8: words = (width + 3) / 4; break;
case 1: words = (width + 31) >> 5; break;
case 4: words = (width + 7) >> 3; break;
case 8: words = (width + 3) >> 2; break;
case 15:
case 16: words = (width + 1) / 2; break;
case 24: words = (width * 3 + 3)/4; break;
case 16: words = (width + 1) >> 1; break;
case 24: words = (width * 3 + 3) >> 2; break;
default:
DPRINT("(%d): Unsupported depth\n", depth );
@ -1203,7 +1203,7 @@ INT FASTCALL DIB_GetDIBWidthBytes (INT width, INT depth)
case 32:
words = width;
}
return 4 * words;
return words << 2;
}
/***********************************************************************

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: fillshap.c,v 1.44 2004/03/04 01:50:26 royce Exp $ */
/* $Id: fillshap.c,v 1.45 2004/03/27 00:35:02 weiden Exp $ */
#undef WIN32_LEAN_AND_MEAN
#include <windows.h>
@ -435,7 +435,7 @@ CirclePoints(UINT *PointCount, PSHAPEPOINT ShapePoints, int Left, int Top,
Even = (0 == (Right - Left) % 2);
Right--;
Bottom--;
Radius = (Right - Left) / 2;
Radius = (Right - Left) >> 1;
if (Even)
{
@ -443,8 +443,8 @@ CirclePoints(UINT *PointCount, PSHAPEPOINT ShapePoints, int Left, int Top,
Y = Radius;
d = 2 - Radius;
X18 = Right;
X27 = (Left + Right) / 2 + 1;
X36 = (Left + Right) / 2;
X27 = ((Left + Right) >> 1) + 1;
X36 = (Left + Right) >> 1;
X45 = Left;
Y14 = Top + Radius;
Y23 = Top;
@ -466,8 +466,8 @@ CirclePoints(UINT *PointCount, PSHAPEPOINT ShapePoints, int Left, int Top,
Y = Radius;
d = 1 - Radius;
X18 = Right;
X27 = (Left + Right) / 2;
X36 = (Left + Right) / 2;
X27 = (Left + Right) >> 1;
X36 = (Left + Right) >> 1;
X45 = Left;
Y14 = Top + Radius;
Y23 = Top;
@ -483,7 +483,7 @@ CirclePoints(UINT *PointCount, PSHAPEPOINT ShapePoints, int Left, int Top,
{
if (d < 0)
{
d += 2 * X + (Even ? 4 : 3);
d += (X << 1) + (Even ? 4 : 3);
X27++;
X36--;
@ -492,7 +492,7 @@ CirclePoints(UINT *PointCount, PSHAPEPOINT ShapePoints, int Left, int Top,
}
else
{
d += 2 * (X - Y) + 5;
d += ((X - Y) << 1) + 5;
Y--;
Y23++;
@ -524,8 +524,8 @@ LinePoints(UINT *PointCount, PSHAPEPOINT ShapePoints, int Left, int Top,
LONG x, y, deltax, deltay, i, xchange, ychange, error;
int Type;
x = (Right + Left) / 2;
y = (Bottom + Top) / 2;
x = (Right + Left) >> 1;
y = (Bottom + Top) >> 1;
deltax = XTo - x;
deltay = YTo - y;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: palette.c,v 1.15 2004/02/19 21:12:10 weiden Exp $ */
/* $Id: palette.c,v 1.16 2004/03/27 00:35:02 weiden Exp $ */
#undef WIN32_LEAN_AND_MEAN
#include <windows.h>
@ -158,7 +158,7 @@ static void FASTCALL PALETTE_FormatSystemPalette(void)
int i, j = PALETTE_firstFree = NB_RESERVED_COLORS/2;
COLOR_sysPal[j].peFlags = 0;
for(i = NB_RESERVED_COLORS/2 + 1 ; i < 256 - NB_RESERVED_COLORS/2 ; i++)
for(i = (NB_RESERVED_COLORS>>1) + 1 ; i < 256 - (NB_RESERVED_COLORS>>1) ; i++)
{
if( i < COLOR_gapStart || i > COLOR_gapEnd )
{

View file

@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: text.c,v 1.84 2004/03/23 19:46:50 gvg Exp $ */
/* $Id: text.c,v 1.85 2004/03/27 00:35:02 weiden Exp $ */
#undef WIN32_LEAN_AND_MEAN
@ -743,14 +743,14 @@ IntGetOutlineTextMetrics(PFONTGDI FontGDI, UINT Size,
}
else
{
Needed += FamilyNameW.Length + StyleNameW.Length + 2 * sizeof(WCHAR); /* family + " " + style */
Needed += FamilyNameW.Length + StyleNameW.Length + (sizeof(WCHAR) << 1); /* family + " " + style */
}
/* length of otmpStyleName */
Needed += StyleNameW.Length + sizeof(WCHAR);
/* length of otmpFullName */
Needed += FamilyNameW.Length + StyleNameW.Length + 2 * sizeof(WCHAR);
Needed += FamilyNameW.Length + StyleNameW.Length + (sizeof(WCHAR) << 1);
if (Size < Needed)
{
@ -946,7 +946,7 @@ IntGetOutlineTextMetrics(PFONTGDI FontGDI, UINT Size,
{
wcscat((WCHAR*) Cp, L" ");
wcscat((WCHAR*) Cp, StyleNameW.Buffer);
Cp += FamilyNameW.Length + StyleNameW.Length + 2 * sizeof(WCHAR);
Cp += FamilyNameW.Length + StyleNameW.Length + (sizeof(WCHAR) << 1);
}
else
{