strechblt
gain very lite perfomen boost
Modified: trunk/reactos/subsys/win32k/dib/dib16bpp.c
Modified: trunk/reactos/subsys/win32k/dib/dib1bpp.c
Modified: trunk/reactos/subsys/win32k/dib/dib24bpp.c
Modified: trunk/reactos/subsys/win32k/dib/dib32bpp.c
Modified: trunk/reactos/subsys/win32k/dib/dib4bpp.c
Modified: trunk/reactos/subsys/win32k/dib/dib8bpp.c
_____
Modified: trunk/reactos/subsys/win32k/dib/dib16bpp.c
--- trunk/reactos/subsys/win32k/dib/dib16bpp.c 2005-05-31 17:30:54 UTC
(rev 15703)
+++ trunk/reactos/subsys/win32k/dib/dib16bpp.c 2005-05-31 19:44:36 UTC
(rev 15704)
@@ -626,18 +626,21 @@
int DesX;
int DesY;
int color;
+ int zoomX;
DPRINT("DIB_16BPP_StretchBlt: Source BPP: %u, srcRect:
(%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n",
BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left,
SourceRect->top, SourceRect->right, SourceRect->bottom,
DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
- SrcSizeY = SourceRect->bottom;
- SrcSizeX = SourceRect->right;
+ SrcSizeY = SourceRect->bottom;
+ SrcSizeX = SourceRect->right;
- DesSizeY = DestRect->bottom;
- DesSizeX = DestRect->right;
+ DesSizeY = DestRect->bottom;
+ DesSizeX = DestRect->right;
+
+ zoomX = DesSizeX / SrcSizeX;
+ if (zoomX==0) zoomX=1;
-
switch(SourceSurf->iBitmapFormat)
{
case BMF_1BPP:
@@ -653,7 +656,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -664,9 +667,17 @@
if(DIB_1BPP_GetPixel(SourceSurf, sx,
sy) == 0)
{
- DIB_16BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0));
+ if (zoomX>1)
+
DIB_16BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY,
XLATEOBJ_iXlate(ColorTranslation, 0));
+ else
+ DIB_16BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0));
+
} else {
- DIB_16BPP_PutPixel(DestSurf, DesX, DesY,
XLATEOBJ_iXlate(ColorTranslation, 1));
+ if (zoomX>1)
+
DIB_16BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY,
XLATEOBJ_iXlate(ColorTranslation, 1));
+ else
+
DIB_16BPP_PutPixel(DestSurf, DesX, DesY,
XLATEOBJ_iXlate(ColorTranslation, 1));
+
}
}
}
@@ -687,7 +698,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -697,7 +708,12 @@
if (sx > SourceRect->right)
break;
color =
DIB_4BPP_GetPixel(SourceSurf, sx, sy);
- DIB_16BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
+ if (zoomX>1)
+
DIB_16BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY,
XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_16BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
}
}
break;
@@ -715,7 +731,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -725,7 +741,12 @@
if (sx > SourceRect->right)
break;
color =
DIB_8BPP_GetPixel(SourceSurf, sx, sy);
- DIB_16BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
+ if (zoomX>1)
+
DIB_16BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY,
XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_16BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
}
}
break;
@@ -743,7 +764,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -753,7 +774,10 @@
if (sx > SourceRect->right)
break;
color =
DIB_24BPP_GetPixel(SourceSurf, sx, sy);
- DIB_16BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ if (zoomX>1)
+
DIB_16BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY,
XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_16BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
@@ -771,7 +795,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -780,8 +804,11 @@
if (sx > SourceRect->right)
break;
- color =
DIB_16BPP_GetPixel(SourceSurf, sx, sy);
- DIB_32BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ color =
DIB_32BPP_GetPixel(SourceSurf, sx, sy);
+ if (zoomX>1)
+
DIB_16BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY,
XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_16BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
_____
Modified: trunk/reactos/subsys/win32k/dib/dib1bpp.c
--- trunk/reactos/subsys/win32k/dib/dib1bpp.c 2005-05-31 17:30:54 UTC
(rev 15703)
+++ trunk/reactos/subsys/win32k/dib/dib1bpp.c 2005-05-31 19:44:36 UTC
(rev 15704)
@@ -494,6 +494,7 @@
int DesX;
int DesY;
int color;
+ int zoomX;
SrcSizeY = SourceRect->bottom;
SrcSizeX = SourceRect->right;
@@ -501,6 +502,10 @@
DesSizeY = DestRect->bottom;
DesSizeX = DestRect->right;
+ zoomX = DesSizeX / SrcSizeX;
+ if (zoomX==0) zoomX=1;
+
+
switch(SourceSurf->iBitmapFormat)
{
case BMF_1BPP:
@@ -518,7 +523,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -528,7 +533,11 @@
if (sx > SourceRect->right)
break;
color =
DIB_1BPP_GetPixel(SourceSurf, sx, sy);
- DIB_1BPP_PutPixel(DestSurf,
DesX, DesY, color);
+
+ if (zoomX>1)
+ DIB_1BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, color);
+ else
+ DIB_1BPP_PutPixel(DestSurf,
DesX, DesY, color);
}
}
break;
@@ -548,7 +557,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -558,7 +567,12 @@
if (sx > SourceRect->right)
break;
color =
DIB_4BPP_GetPixel(SourceSurf, sx, sy);
- DIB_1BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
+ if (zoomX>1)
+ DIB_1BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_1BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
}
}
break;
@@ -576,7 +590,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -586,7 +600,12 @@
if (sx > SourceRect->right)
break;
color =
DIB_8BPP_GetPixel(SourceSurf, sx, sy);
- DIB_1BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
+ if (zoomX>1)
+ DIB_1BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_1BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
}
}
break;
@@ -604,7 +623,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -614,7 +633,12 @@
if (sx > SourceRect->right)
break;
color =
DIB_16BPP_GetPixel(SourceSurf, sx, sy);
- DIB_1BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
+ if (zoomX>1)
+ DIB_1BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_1BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
}
}
break;
@@ -632,7 +656,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -642,7 +666,12 @@
if (sx > SourceRect->right)
break;
color =
DIB_24BPP_GetPixel(SourceSurf, sx, sy);
- DIB_1BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
+ if (zoomX>1)
+ DIB_1BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_1BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
}
}
break;
@@ -659,7 +688,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -669,7 +698,11 @@
if (sx > SourceRect->right)
break;
color =
DIB_32BPP_GetPixel(SourceSurf, sx, sy);
- DIB_1BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
+ if (zoomX>1)
+ DIB_1BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_1BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
_____
Modified: trunk/reactos/subsys/win32k/dib/dib24bpp.c
--- trunk/reactos/subsys/win32k/dib/dib24bpp.c 2005-05-31 17:30:54 UTC
(rev 15703)
+++ trunk/reactos/subsys/win32k/dib/dib24bpp.c 2005-05-31 19:44:36 UTC
(rev 15704)
@@ -318,13 +318,17 @@
int DesX;
int DesY;
int color;
+ int zoomX;
SrcSizeY = SourceRect->bottom;
SrcSizeX = SourceRect->right;
DesSizeY = DestRect->bottom;
- DesSizeX = DestRect->right;
+ DesSizeX = DestRect->right;
+ zoomX = DesSizeX / SrcSizeX;
+ if (zoomX==0) zoomX=1;
+
switch(SourceSurf->iBitmapFormat)
{
case BMF_1BPP:
@@ -340,7 +344,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -352,8 +356,16 @@
if(DIB_1BPP_GetPixel(SourceSurf, sx,
sy) == 0)
{
DIB_24BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0));
+ if (zoomX>1)
+
DIB_24BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY,
XLATEOBJ_iXlate(ColorTranslation, 0));
+ else
+ DIB_24BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0));
+
} else {
- DIB_24BPP_PutPixel(DestSurf, DesX, DesY,
XLATEOBJ_iXlate(ColorTranslation, 1));
+ if (zoomX>1)
+
DIB_24BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY,
XLATEOBJ_iXlate(ColorTranslation, 1));
+ else
+ DIB_24BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 1));
}
}
}
@@ -370,11 +382,9 @@
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) /
((ULONG) SrcSizeY);
-
if (sy > SourceRect->bottom) break;
-
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -384,7 +394,10 @@
if (sx > SourceRect->right)
break;
color =
DIB_4BPP_GetPixel(SourceSurf, sx, sy);
- DIB_24BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ if (zoomX>1)
+
DIB_24BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY,
XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_24BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
@@ -402,7 +415,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -412,7 +425,10 @@
if (sx > SourceRect->right)
break;
color =
DIB_8BPP_GetPixel(SourceSurf, sx, sy);
- DIB_24BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ if (zoomX>1)
+
DIB_24BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY,
XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_24BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
@@ -430,7 +446,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -440,7 +456,10 @@
if (sx > SourceRect->right)
break;
color =
DIB_16BPP_GetPixel(SourceSurf, sx, sy);
- DIB_24BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ if (zoomX>1)
+
DIB_24BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY,
XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_24BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
@@ -458,7 +477,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -468,7 +487,10 @@
if (sx > SourceRect->right)
break;
color =
DIB_24BPP_GetPixel(SourceSurf, sx, sy);
- DIB_24BPP_PutPixel(DestSurf,
DesX, DesY, color);
+ if (zoomX>1)
+
DIB_24BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY, color);
+ else
+ DIB_24BPP_PutPixel(DestSurf,
DesX, DesY, color);
}
}
break;
@@ -486,7 +508,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -496,7 +518,11 @@
if (sx > SourceRect->right)
break;
color =
DIB_32BPP_GetPixel(SourceSurf, sx, sy);
- DIB_24BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
+ if (zoomX>1)
+
DIB_24BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY,
XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_24BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
_____
Modified: trunk/reactos/subsys/win32k/dib/dib32bpp.c
--- trunk/reactos/subsys/win32k/dib/dib32bpp.c 2005-05-31 17:30:54 UTC
(rev 15703)
+++ trunk/reactos/subsys/win32k/dib/dib32bpp.c 2005-05-31 19:44:36 UTC
(rev 15704)
@@ -560,6 +560,8 @@
int DesX;
int DesY;
int color;
+ int zoomX;
+
DPRINT("DIB_32BPP_StretchBlt: Source BPP: %u, srcRect:
(%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n",
BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left,
SourceRect->top, SourceRect->right, SourceRect->bottom,
@@ -569,8 +571,11 @@
SrcSizeX = SourceRect->right;
DesSizeY = DestRect->bottom;
- DesSizeX = DestRect->right;
+ DesSizeX = DestRect->right;
+ zoomX = DesSizeX / SrcSizeX;
+ if (zoomX==0) zoomX=1;
+
switch(SourceSurf->iBitmapFormat)
{
case BMF_1BPP:
@@ -586,7 +591,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -597,9 +602,16 @@
if(DIB_1BPP_GetPixel(SourceSurf, sx,
sy) == 0)
{
- DIB_32BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0));
+ if (zoomX>1)
+
DIB_32BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY,
XLATEOBJ_iXlate(ColorTranslation, 0));
+ else
+ DIB_32BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0));
+
} else {
- DIB_32BPP_PutPixel(DestSurf, DesX, DesY,
XLATEOBJ_iXlate(ColorTranslation, 1));
+ if (zoomX>1)
+
DIB_32BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY,
XLATEOBJ_iXlate(ColorTranslation, 1));
+ else
+ DIB_32BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 1));
}
}
}
@@ -620,7 +632,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -629,8 +641,14 @@
if (sx > SourceRect->right)
break;
+
color =
DIB_4BPP_GetPixel(SourceSurf, sx, sy);
- DIB_32BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
+ if (zoomX>1)
+
DIB_32BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY,
XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_32BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
}
}
break;
@@ -648,7 +666,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -658,7 +676,11 @@
if (sx > SourceRect->right)
break;
color =
DIB_8BPP_GetPixel(SourceSurf, sx, sy);
- DIB_32BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
+ if (zoomX>1)
+
DIB_32BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY,
XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_32BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
@@ -676,7 +698,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -686,7 +708,10 @@
if (sx > SourceRect->right)
break;
color =
DIB_16BPP_GetPixel(SourceSurf, sx, sy);
- DIB_32BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ if (zoomX>1)
+
DIB_32BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY,
XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_32BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
@@ -704,7 +729,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -714,7 +739,10 @@
if (sx > SourceRect->right)
break;
color =
DIB_24BPP_GetPixel(SourceSurf, sx, sy);
- DIB_32BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ if (zoomX>1)
+
DIB_32BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY,
XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_32BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
_____
Modified: trunk/reactos/subsys/win32k/dib/dib4bpp.c
--- trunk/reactos/subsys/win32k/dib/dib4bpp.c 2005-05-31 17:30:54 UTC
(rev 15703)
+++ trunk/reactos/subsys/win32k/dib/dib4bpp.c 2005-05-31 19:44:36 UTC
(rev 15704)
@@ -372,13 +372,17 @@
int DesX;
int DesY;
int color;
+ int zoomX;
SrcSizeY = SourceRect->bottom;
SrcSizeX = SourceRect->right;
DesSizeY = DestRect->bottom;
- DesSizeX = DestRect->right;
+ DesSizeX = DestRect->right;
+ zoomX = DesSizeX / SrcSizeX;
+ if (zoomX==0) zoomX=1;
+
switch(SourceSurf->iBitmapFormat)
{
case BMF_1BPP:
@@ -394,7 +398,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -405,9 +409,17 @@
if(DIB_1BPP_GetPixel(SourceSurf, sx,
sy) == 0)
{
- DIB_4BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0));
- } else {
- DIB_4BPP_PutPixel(DestSurf, DesX, DesY,
XLATEOBJ_iXlate(ColorTranslation, 1));
+ if (zoomX>1)
+ DIB_4BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0));
+ else
+ DIB_4BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0));
+
+ } else {
+ if (zoomX>1)
+ DIB_4BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, XLATEOBJ_iXlate(ColorTranslation, 1));
+ else
+ DIB_4BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 1));
+
}
}
}
@@ -428,7 +440,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -438,7 +450,12 @@
if (sx > SourceRect->right)
break;
color =
DIB_4BPP_GetPixel(SourceSurf, sx, sy);
- DIB_4BPP_PutPixel(DestSurf,
DesX, DesY, color);
+
+ if (zoomX>1)
+ DIB_4BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, color);
+ else
+ DIB_4BPP_PutPixel(DestSurf,
DesX, DesY, color);
+
}
}
break;
@@ -456,7 +473,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -466,7 +483,12 @@
if (sx > SourceRect->right)
break;
color =
DIB_8BPP_GetPixel(SourceSurf, sx, sy);
- DIB_4BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
+ if (zoomX>1)
+ DIB_4BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_4BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
}
}
break;
@@ -484,7 +506,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -494,7 +516,12 @@
if (sx > SourceRect->right)
break;
color =
DIB_16BPP_GetPixel(SourceSurf, sx, sy);
- DIB_4BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
+ if (zoomX>1)
+ DIB_4BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_4BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
}
}
break;
@@ -512,7 +539,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -522,7 +549,12 @@
if (sx > SourceRect->right)
break;
color =
DIB_24BPP_GetPixel(SourceSurf, sx, sy);
- DIB_4BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
+ if (zoomX>1)
+ DIB_4BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_4BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
}
}
break;
@@ -540,7 +572,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -550,7 +582,12 @@
if (sx > SourceRect->right)
break;
color =
DIB_32BPP_GetPixel(SourceSurf, sx, sy);
- DIB_4BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
+ if (zoomX>1)
+ DIB_4BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_4BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
}
}
break;
_____
Modified: trunk/reactos/subsys/win32k/dib/dib8bpp.c
--- trunk/reactos/subsys/win32k/dib/dib8bpp.c 2005-05-31 17:30:54 UTC
(rev 15703)
+++ trunk/reactos/subsys/win32k/dib/dib8bpp.c 2005-05-31 19:44:36 UTC
(rev 15704)
@@ -550,11 +550,21 @@
int DesX;
int DesY;
int color;
+ int zoomX;
DPRINT("DIB_8BPP_StretchBlt: Source BPP: %u, srcRect:
(%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n",
BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left,
SourceRect->top, SourceRect->right, SourceRect->bottom,
DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
+ SrcSizeY = SourceRect->bottom;
+ SrcSizeX = SourceRect->right;
+
+ DesSizeY = DestRect->bottom;
+ DesSizeX = DestRect->right;
+
+ zoomX = DesSizeX / SrcSizeX;
+ if (zoomX==0) zoomX=1;
+
switch(SourceSurf->iBitmapFormat)
{
case BMF_1BPP:
@@ -570,7 +580,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -581,9 +591,15 @@
if(DIB_1BPP_GetPixel(SourceSurf, sx,
sy) == 0)
{
- DIB_8BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0));
+ if (zoomX>1)
+ DIB_8BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0));
+ else
+ DIB_8BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0));
} else {
- DIB_8BPP_PutPixel(DestSurf, DesX, DesY,
XLATEOBJ_iXlate(ColorTranslation, 1));
+ if (zoomX>1)
+ DIB_8BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, XLATEOBJ_iXlate(ColorTranslation, 1));
+ else
+ DIB_8BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 1));
}
}
}
@@ -604,7 +620,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -614,7 +630,11 @@
if (sx > SourceRect->right)
break;
color =
DIB_4BPP_GetPixel(SourceSurf, sx, sy);
- DIB_8BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
+ if (zoomX>1)
+ DIB_8BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_8BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
@@ -632,7 +652,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -642,7 +662,12 @@
if (sx > SourceRect->right)
break;
color =
DIB_16BPP_GetPixel(SourceSurf, sx, sy);
- DIB_8BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
+ if (zoomX>1)
+ DIB_8BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_8BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
}
}
break;
@@ -660,7 +685,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -670,7 +695,12 @@
if (sx > SourceRect->right)
break;
color =
DIB_24BPP_GetPixel(SourceSurf, sx, sy);
- DIB_8BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
+ if (zoomX>1)
+ DIB_8BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_8BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
}
}
break;
@@ -688,7 +718,7 @@
if (sy > SourceRect->bottom) break;
- for (DesX=0; DesX<DestRect->right;
DesX++)
+ for (DesX=0; DesX<DestRect->right;
DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG)
SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
@@ -698,7 +728,12 @@
if (sx > SourceRect->right)
break;
color =
DIB_32BPP_GetPixel(SourceSurf, sx, sy);
- DIB_8BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
+ if (zoomX>1)
+ DIB_8BPP_HLine(DestSurf,
DesX, DesX + zoomX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+ else
+ DIB_8BPP_PutPixel(DestSurf,
DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
+
}
}
break;