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
431aa5bc
Commit
431aa5bc
authored
Dec 05, 2012
by
Vincent Povirk
Committed by
Alexandre Julliard
Dec 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Use one GetDIBits call instead of one per row.
parent
04412f7a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
23 deletions
+3
-23
image.c
dlls/gdiplus/image.c
+3
-23
No files found.
dlls/gdiplus/image.c
View file @
431aa5bc
...
...
@@ -4645,7 +4645,6 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBi
GpStatus
retval
;
PixelFormat
format
;
BitmapData
lockeddata
;
INT
y
;
TRACE
(
"%p %p %p
\n
"
,
hbm
,
hpal
,
bitmap
);
...
...
@@ -4695,14 +4694,10 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBi
if
(
retval
==
Ok
)
{
HDC
hdc
;
HBITMAP
oldhbm
;
BITMAPINFO
*
pbmi
;
INT
src_height
,
dst_stride
;
BYTE
*
dst_bits
;
INT
src_height
;
hdc
=
CreateCompatibleDC
(
NULL
);
oldhbm
=
SelectObject
(
hdc
,
hbm
);
pbmi
=
GdipAlloc
(
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
));
if
(
pbmi
)
...
...
@@ -4713,30 +4708,15 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBi
GetDIBits
(
hdc
,
hbm
,
0
,
0
,
NULL
,
pbmi
,
DIB_RGB_COLORS
);
src_height
=
abs
(
pbmi
->
bmiHeader
.
biHeight
);
pbmi
->
bmiHeader
.
biHeight
=
-
src_height
;
if
(
pbmi
->
bmiHeader
.
biHeight
>
0
)
{
dst_bits
=
(
BYTE
*
)
lockeddata
.
Scan0
+
lockeddata
.
Stride
*
(
src_height
-
1
);
dst_stride
=
-
lockeddata
.
Stride
;
}
else
{
dst_bits
=
lockeddata
.
Scan0
;
dst_stride
=
lockeddata
.
Stride
;
}
for
(
y
=
0
;
y
<
src_height
;
y
++
)
{
GetDIBits
(
hdc
,
hbm
,
y
,
1
,
dst_bits
+
dst_stride
*
y
,
pbmi
,
DIB_RGB_COLORS
);
}
GetDIBits
(
hdc
,
hbm
,
0
,
src_height
,
lockeddata
.
Scan0
,
pbmi
,
DIB_RGB_COLORS
);
GdipFree
(
pbmi
);
}
else
retval
=
OutOfMemory
;
SelectObject
(
hdc
,
oldhbm
);
DeleteDC
(
hdc
);
GdipBitmapUnlockBits
(
*
bitmap
,
&
lockeddata
);
...
...
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