Commit 27989a0a authored by Bartosz Kosiorek's avatar Bartosz Kosiorek Committed by Alexandre Julliard

gdiplus: Improve performance by switching loops and fix size.

parent 948412f0
......@@ -771,8 +771,8 @@ PixelFormat apply_image_attributes(const GpImageAttributes *attributes, LPBYTE d
max_green = (key->high>>8)&0xff;
max_red = (key->high>>16)&0xff;
for (x=0; x<width; x++)
for (y=0; y<height; y++)
for (y=0; y<height; y++)
for (x=0; x<width; x++)
{
ARGB *src_color;
BYTE blue, green, red;
......@@ -799,8 +799,8 @@ PixelFormat apply_image_attributes(const GpImageAttributes *attributes, LPBYTE d
else
table = &attributes->colorremaptables[ColorAdjustTypeDefault];
for (x=0; x<width; x++)
for (y=0; y<height; y++)
for (y=0; y<height; y++)
for (x=0; x<width; x++)
{
ARGB *src_color;
src_color = (ARGB*)(data + stride * y + sizeof(ARGB) * x);
......@@ -838,9 +838,9 @@ PixelFormat apply_image_attributes(const GpImageAttributes *attributes, LPBYTE d
if (!identity)
{
for (x=0; x<width; x++)
for (y=0; y<height; y++)
{
for (y=0; y<height; y++)
for (x=0; x<width; x++)
{
ARGB *src_color;
src_color = (ARGB*)(data + stride * y + sizeof(ARGB) * x);
......@@ -872,8 +872,8 @@ PixelFormat apply_image_attributes(const GpImageAttributes *attributes, LPBYTE d
else
gamma = attributes->gamma[ColorAdjustTypeDefault];
for (x=0; x<width; x++)
for (y=0; y<height; y++)
for (y=0; y<height; y++)
for (x=0; x<width; x++)
{
ARGB *src_color;
BYTE blue, green, red;
......@@ -1201,8 +1201,8 @@ static GpStatus brush_fill_pixels(GpGraphics *graphics, GpBrush *brush,
{
int x, y;
GpSolidFill *fill = (GpSolidFill*)brush;
for (x=0; x<fill_area->Width; x++)
for (y=0; y<fill_area->Height; y++)
for (y=0; y<fill_area->Height; y++)
for (x=0; x<fill_area->Width; x++)
argb_pixels[x + y*cdwStride] = fill->color;
return Ok;
}
......
......@@ -1693,8 +1693,8 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHICON(HICON hicon, GpBitmap** bitmap)
/* If any pixel has a non-zero alpha, ignore hbmMask */
src = (DWORD*)lockeddata.Scan0;
for (x=0; x<width && !has_alpha; x++)
for (y=0; y<height && !has_alpha; y++)
for (y=0; y<height && !has_alpha; y++)
for (x=0; x<width && !has_alpha; x++)
if ((*src++ & 0xff000000) != 0)
has_alpha = TRUE;
}
......@@ -1723,7 +1723,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHICON(HICON hicon, GpBitmap** bitmap)
for (y=0; y<height; y++)
{
dst = (DWORD*)dst_row;
for (x=0; x<height; x++)
for (x=0; x<width; x++)
{
DWORD src_value = *src++;
if (src_value)
......@@ -1743,7 +1743,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHICON(HICON hicon, GpBitmap** bitmap)
for (y=0; y<height; y++)
{
dst = (DWORD*)dst_row;
for (x=0; x<height; x++)
for (x=0; x<width; x++)
*dst++ |= 0xff000000;
dst_row += lockeddata.Stride;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment