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
039c8534
Commit
039c8534
authored
May 02, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: CreateDIBSection doesn't need a DC for the DIB_RGB_COLORS case.
parent
d2e8d448
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
30 deletions
+4
-30
gdiplus.c
dlls/gdiplus/gdiplus.c
+1
-6
graphics.c
dlls/gdiplus/graphics.c
+1
-7
image.c
dlls/gdiplus/image.c
+2
-17
No files found.
dlls/gdiplus/gdiplus.c
View file @
039c8534
...
...
@@ -265,7 +265,6 @@ COLORREF ARGB2COLORREF(ARGB color)
HBITMAP
ARGB2BMP
(
ARGB
color
)
{
HDC
hdc
;
BITMAPINFO
bi
;
HBITMAP
result
;
RGBQUAD
*
bits
;
...
...
@@ -273,8 +272,6 @@ HBITMAP ARGB2BMP(ARGB color)
if
((
color
&
0xff000000
)
==
0xff000000
)
return
0
;
hdc
=
CreateCompatibleDC
(
NULL
);
bi
.
bmiHeader
.
biSize
=
sizeof
(
bi
.
bmiHeader
);
bi
.
bmiHeader
.
biWidth
=
1
;
bi
.
bmiHeader
.
biHeight
=
1
;
...
...
@@ -287,15 +284,13 @@ HBITMAP ARGB2BMP(ARGB color)
bi
.
bmiHeader
.
biClrUsed
=
0
;
bi
.
bmiHeader
.
biClrImportant
=
0
;
result
=
CreateDIBSection
(
hdc
,
&
bi
,
DIB_RGB_COLORS
,
(
void
*
)
&
bits
,
NULL
,
0
);
result
=
CreateDIBSection
(
0
,
&
bi
,
DIB_RGB_COLORS
,
(
void
*
)
&
bits
,
NULL
,
0
);
bits
[
0
].
rgbReserved
=
alpha
=
(
color
>>
24
)
&
0xff
;
bits
[
0
].
rgbRed
=
((
color
>>
16
)
&
0xff
)
*
alpha
/
255
;
bits
[
0
].
rgbGreen
=
((
color
>>
8
)
&
0xff
)
*
alpha
/
255
;
bits
[
0
].
rgbBlue
=
(
color
&
0xff
)
*
alpha
/
255
;
DeleteDC
(
hdc
);
return
result
;
}
...
...
dlls/gdiplus/graphics.c
View file @
039c8534
...
...
@@ -131,15 +131,10 @@ static COLORREF get_gdi_brush_color(const GpBrush *brush)
static
HBITMAP
create_hatch_bitmap
(
const
GpHatch
*
hatch
)
{
HBITMAP
hbmp
;
HDC
hdc
;
BITMAPINFOHEADER
bmih
;
DWORD
*
bits
;
int
x
,
y
;
hdc
=
CreateCompatibleDC
(
0
);
if
(
!
hdc
)
return
0
;
bmih
.
biSize
=
sizeof
(
bmih
);
bmih
.
biWidth
=
8
;
bmih
.
biHeight
=
8
;
...
...
@@ -148,7 +143,7 @@ static HBITMAP create_hatch_bitmap(const GpHatch *hatch)
bmih
.
biCompression
=
BI_RGB
;
bmih
.
biSizeImage
=
0
;
hbmp
=
CreateDIBSection
(
hdc
,
(
BITMAPINFO
*
)
&
bmih
,
DIB_RGB_COLORS
,
(
void
**
)
&
bits
,
NULL
,
0
);
hbmp
=
CreateDIBSection
(
0
,
(
BITMAPINFO
*
)
&
bmih
,
DIB_RGB_COLORS
,
(
void
**
)
&
bits
,
NULL
,
0
);
if
(
hbmp
)
{
const
char
*
hatch_data
;
...
...
@@ -175,7 +170,6 @@ static HBITMAP create_hatch_bitmap(const GpHatch *hatch)
}
}
DeleteDC
(
hdc
);
return
hbmp
;
}
...
...
dlls/gdiplus/image.c
View file @
039c8534
...
...
@@ -1372,7 +1372,6 @@ GpStatus WINGDIPAPI GdipCreateHBITMAPFromBitmap(GpBitmap* bitmap,
GpStatus
stat
;
HBITMAP
result
;
UINT
width
,
height
;
HDC
hdc
;
BITMAPINFOHEADER
bih
;
LPBYTE
bits
;
BitmapData
lockeddata
;
...
...
@@ -1395,11 +1394,7 @@ GpStatus WINGDIPAPI GdipCreateHBITMAPFromBitmap(GpBitmap* bitmap,
bih
.
biClrUsed
=
0
;
bih
.
biClrImportant
=
0
;
hdc
=
CreateCompatibleDC
(
NULL
);
if
(
!
hdc
)
return
GenericError
;
result
=
CreateDIBSection
(
hdc
,
(
BITMAPINFO
*
)
&
bih
,
DIB_RGB_COLORS
,
(
void
**
)
&
bits
,
NULL
,
0
);
result
=
CreateDIBSection
(
0
,
(
BITMAPINFO
*
)
&
bih
,
DIB_RGB_COLORS
,
(
void
**
)
&
bits
,
NULL
,
0
);
if
(
result
)
{
...
...
@@ -1415,8 +1410,6 @@ GpStatus WINGDIPAPI GdipCreateHBITMAPFromBitmap(GpBitmap* bitmap,
else
stat
=
GenericError
;
DeleteDC
(
hdc
);
if
(
stat
!=
Ok
&&
result
)
{
DeleteObject
(
result
);
...
...
@@ -1694,7 +1687,6 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
BITMAPINFO
*
pbmi
;
HBITMAP
hbitmap
=
NULL
;
INT
row_size
,
dib_stride
;
HDC
hdc
;
BYTE
*
bits
=
NULL
,
*
own_bits
=
NULL
;
REAL
xres
,
yres
;
GpStatus
stat
;
...
...
@@ -1739,15 +1731,8 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
pbmi
->
bmiHeader
.
biClrUsed
=
0
;
pbmi
->
bmiHeader
.
biClrImportant
=
0
;
hdc
=
CreateCompatibleDC
(
NULL
);
if
(
!
hdc
)
{
GdipFree
(
pbmi
);
return
GenericError
;
}
hbitmap
=
CreateDIBSection
(
hdc
,
pbmi
,
DIB_RGB_COLORS
,
(
void
**
)
&
bits
,
NULL
,
0
);
hbitmap
=
CreateDIBSection
(
0
,
pbmi
,
DIB_RGB_COLORS
,
(
void
**
)
&
bits
,
NULL
,
0
);
DeleteDC
(
hdc
);
GdipFree
(
pbmi
);
if
(
!
hbitmap
)
return
GenericError
;
...
...
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