Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
08c1e6cd
Commit
08c1e6cd
authored
Mar 17, 2015
by
Vincent Povirk
Committed by
Alexandre Julliard
Mar 18, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Do not access Bitmap bits when drawing transparent pixels.
parent
b22102df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
graphics.c
dlls/gdiplus/graphics.c
+5
-1
graphics.c
dlls/gdiplus/tests/graphics.c
+21
-0
No files found.
dlls/gdiplus/graphics.c
View file @
08c1e6cd
...
...
@@ -365,8 +365,12 @@ static GpStatus alpha_blend_bmp_pixels(GpGraphics *graphics, INT dst_x, INT dst_
for
(
y
=
0
;
y
<
src_height
;
y
++
)
{
ARGB
dst_color
,
src_color
;
GdipBitmapGetPixel
(
dst_bitmap
,
x
+
dst_x
,
y
+
dst_y
,
&
dst_color
);
src_color
=
((
ARGB
*
)(
src
+
src_stride
*
y
))[
x
];
if
(
!
(
src_color
&
0xff000000
))
continue
;
GdipBitmapGetPixel
(
dst_bitmap
,
x
+
dst_x
,
y
+
dst_y
,
&
dst_color
);
GdipBitmapSetPixel
(
dst_bitmap
,
x
+
dst_x
,
y
+
dst_y
,
color_over
(
dst_color
,
src_color
));
}
}
...
...
dlls/gdiplus/tests/graphics.c
View file @
08c1e6cd
...
...
@@ -2417,6 +2417,27 @@ static void test_fromMemoryBitmap(void)
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
/* If we don't draw to the HDC, the bits are never accessed */
status
=
GdipCreateBitmapFromScan0
(
4
,
4
,
12
,
PixelFormat24bppRGB
,
(
BYTE
*
)
1
,
&
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipGetDC
(
graphics
,
&
hdc
);
expect
(
Ok
,
status
);
ok
(
hdc
!=
NULL
,
"got NULL hdc
\n
"
);
color
=
GetPixel
(
hdc
,
0
,
0
);
todo_wine
expect
(
0x0c0b0d
,
color
);
status
=
GdipReleaseDC
(
graphics
,
hdc
);
expect
(
Ok
,
status
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
}
static
void
test_GdipIsVisiblePoint
(
void
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment