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
6bf6575c
Commit
6bf6575c
authored
Nov 02, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Store a pointer instead of a global handle for DIB pattern brushes.
parent
8afcff3c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
26 deletions
+11
-26
brush.c
dlls/gdi32/brush.c
+5
-12
objects.c
dlls/gdi32/dibdrv/objects.c
+1
-3
objects.c
dlls/gdi32/enhmfdrv/objects.c
+1
-2
objects.c
dlls/gdi32/mfdrv/objects.c
+1
-3
brush.c
dlls/wineps.drv/brush.c
+1
-2
brush.c
dlls/winex11.drv/brush.c
+2
-4
No files found.
dlls/gdi32/brush.c
View file @
6bf6575c
...
...
@@ -53,10 +53,9 @@ static const struct gdi_obj_funcs brush_funcs =
BRUSH_DeleteObject
/* pDeleteObject */
};
static
HGLOBAL
dib_copy
(
const
BITMAPINFO
*
info
,
UINT
coloruse
)
static
void
*
dib_copy
(
const
BITMAPINFO
*
info
,
UINT
coloruse
)
{
BITMAPINFO
*
newInfo
;
HGLOBAL
hmem
;
INT
size
;
if
(
info
->
bmiHeader
.
biCompression
!=
BI_RGB
&&
info
->
bmiHeader
.
biCompression
!=
BI_BITFIELDS
)
...
...
@@ -65,14 +64,8 @@ static HGLOBAL dib_copy(const BITMAPINFO *info, UINT coloruse)
size
=
get_dib_image_size
(
info
);
size
+=
bitmap_info_size
(
info
,
coloruse
);
if
(
!
(
hmem
=
GlobalAlloc
(
GMEM_MOVEABLE
,
size
)))
{
return
0
;
}
newInfo
=
GlobalLock
(
hmem
);
memcpy
(
newInfo
,
info
,
size
);
GlobalUnlock
(
hmem
);
return
hmem
;
if
((
newInfo
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
memcpy
(
newInfo
,
info
,
size
);
return
newInfo
;
}
...
...
@@ -162,7 +155,7 @@ HBRUSH WINAPI CreateBrushIndirect( const LOGBRUSH * brush )
if
(
ptr
->
logbrush
.
lbStyle
==
BS_PATTERN
)
DeleteObject
(
(
HGDIOBJ
)
ptr
->
logbrush
.
lbHatch
);
else
if
(
ptr
->
logbrush
.
lbStyle
==
BS_DIBPATTERN
)
GlobalFree
(
(
HGLOBAL
)
ptr
->
logbrush
.
lbHatch
);
HeapFree
(
GetProcessHeap
(),
0
,
(
void
*
)
ptr
->
logbrush
.
lbHatch
);
}
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
return
0
;
...
...
@@ -439,7 +432,7 @@ static BOOL BRUSH_DeleteObject( HGDIOBJ handle )
DeleteObject
(
(
HGDIOBJ
)
brush
->
logbrush
.
lbHatch
);
break
;
case
BS_DIBPATTERN
:
GlobalFree
(
(
HGLOBAL
)
brush
->
logbrush
.
lbHatch
);
HeapFree
(
GetProcessHeap
(),
0
,
(
void
*
)
brush
->
logbrush
.
lbHatch
);
break
;
}
return
HeapFree
(
GetProcessHeap
(),
0
,
brush
);
...
...
dlls/gdi32/dibdrv/objects.c
View file @
6bf6575c
...
...
@@ -1372,13 +1372,12 @@ HBRUSH dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush )
case
BS_DIBPATTERN
:
{
BITMAPINFOHEADER
*
bi
=
GlobalLock
((
HGLOBAL
)
logbrush
.
lbHatch
)
;
BITMAPINFOHEADER
*
bi
=
(
BITMAPINFOHEADER
*
)
logbrush
.
lbHatch
;
dib_info
orig_dib
;
WORD
usage
=
LOWORD
(
logbrush
.
lbColor
);
HPALETTE
pal
=
(
usage
==
DIB_PAL_COLORS
)
?
GetCurrentObject
(
dev
->
hdc
,
OBJ_PAL
)
:
NULL
;
RECT
rect
;
if
(
!
bi
)
return
NULL
;
if
(
init_dib_info_from_packed
(
&
orig_dib
,
bi
,
usage
,
pal
))
{
copy_dib_color_info
(
&
pdev
->
brush_dib
,
&
pdev
->
dib
);
...
...
@@ -1402,7 +1401,6 @@ HBRUSH dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush )
pdev
->
defer
&=
~
DEFER_BRUSH
;
free_dib_info
(
&
orig_dib
);
}
GlobalUnlock
((
HGLOBAL
)
logbrush
.
lbHatch
);
break
;
}
...
...
dlls/gdi32/enhmfdrv/objects.c
View file @
6bf6575c
...
...
@@ -136,7 +136,7 @@ DWORD EMFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush )
{
EMRCREATEDIBPATTERNBRUSHPT
*
emr
;
DWORD
bmSize
,
biSize
,
size
;
BITMAPINFO
*
info
=
GlobalLock
(
(
HGLOBAL
)
logbrush
.
lbHatch
)
;
BITMAPINFO
*
info
=
(
BITMAPINFO
*
)
logbrush
.
lbHatch
;
if
(
info
->
bmiHeader
.
biCompression
)
bmSize
=
info
->
bmiHeader
.
biSizeImage
;
...
...
@@ -160,7 +160,6 @@ DWORD EMFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush )
if
(
!
EMFDRV_WriteRecord
(
dev
,
&
emr
->
emr
))
index
=
0
;
HeapFree
(
GetProcessHeap
(),
0
,
emr
);
GlobalUnlock
(
(
HGLOBAL
)
logbrush
.
lbHatch
);
}
break
;
...
...
dlls/gdi32/mfdrv/objects.c
View file @
6bf6575c
...
...
@@ -232,10 +232,9 @@ INT16 MFDRV_CreateBrushIndirect(PHYSDEV dev, HBRUSH hBrush )
case
BS_DIBPATTERN
:
{
BITMAPINFO
*
info
;
BITMAPINFO
*
info
=
(
BITMAPINFO
*
)
logbrush
.
lbHatch
;
DWORD
bmSize
,
biSize
;
info
=
GlobalLock
(
(
HGLOBAL
)
logbrush
.
lbHatch
);
if
(
info
->
bmiHeader
.
biCompression
)
bmSize
=
info
->
bmiHeader
.
biSizeImage
;
else
...
...
@@ -253,7 +252,6 @@ INT16 MFDRV_CreateBrushIndirect(PHYSDEV dev, HBRUSH hBrush )
*
(
mr
->
rdParm
)
=
logbrush
.
lbStyle
;
*
(
mr
->
rdParm
+
1
)
=
LOWORD
(
logbrush
.
lbColor
);
memcpy
(
mr
->
rdParm
+
2
,
info
,
biSize
+
bmSize
);
GlobalUnlock
(
(
HGLOBAL
)
logbrush
.
lbHatch
);
break
;
}
default:
...
...
dlls/wineps.drv/brush.c
View file @
6bf6575c
...
...
@@ -255,7 +255,7 @@ BOOL PSDRV_Brush(PHYSDEV dev, BOOL EO)
case
BS_DIBPATTERN
:
{
BITMAPINFO
*
bmi
=
GlobalLock
(
(
HGLOBAL
)
logbrush
.
lbHatch
)
;
BITMAPINFO
*
bmi
=
(
BITMAPINFO
*
)
logbrush
.
lbHatch
;
UINT
usage
=
logbrush
.
lbColor
;
TRACE
(
"size %dx%dx%d
\n
"
,
bmi
->
bmiHeader
.
biWidth
,
bmi
->
bmiHeader
.
biHeight
,
bmi
->
bmiHeader
.
biBitCount
);
...
...
@@ -268,7 +268,6 @@ BOOL PSDRV_Brush(PHYSDEV dev, BOOL EO)
FIXME
(
"Trying to set a pattern brush on a level 1 printer
\n
"
);
ret
=
FALSE
;
}
GlobalUnlock
(
(
HGLOBAL
)
logbrush
.
lbHatch
);
}
break
;
...
...
dlls/winex11.drv/brush.c
View file @
6bf6575c
...
...
@@ -254,11 +254,10 @@ static BOOL BRUSH_SelectPatternBrush( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
/***********************************************************************
* BRUSH_SelectDIBPatternBrush
*/
static
BOOL
BRUSH_SelectDIBPatternBrush
(
X11DRV_PDEVICE
*
physDev
,
HGLOBAL
mem
)
static
BOOL
BRUSH_SelectDIBPatternBrush
(
X11DRV_PDEVICE
*
physDev
,
const
BITMAPINFO
*
info
)
{
BOOL
ret
;
HDC
memdc
;
BITMAPINFO
*
info
=
GlobalLock
(
mem
);
HBITMAP
bitmap
=
CreateDIBitmap
(
physDev
->
dev
.
hdc
,
&
info
->
bmiHeader
,
CBM_INIT
,
(
LPBYTE
)
info
+
bitmap_info_size
(
info
,
DIB_RGB_COLORS
),
info
,
DIB_RGB_COLORS
);
...
...
@@ -274,7 +273,6 @@ static BOOL BRUSH_SelectDIBPatternBrush( X11DRV_PDEVICE *physDev, HGLOBAL mem )
physBitmap
->
pixmap
=
0
;
/* so it doesn't get freed */
}
DeleteObject
(
bitmap
);
GlobalUnlock
(
mem
);
return
ret
;
}
...
...
@@ -330,7 +328,7 @@ HBRUSH X11DRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush )
case
BS_DIBPATTERN
:
TRACE
(
"BS_DIBPATTERN
\n
"
);
if
(
!
BRUSH_SelectDIBPatternBrush
(
physDev
,
(
HGLOBAL
)
logbrush
.
lbHatch
))
return
0
;
if
(
!
BRUSH_SelectDIBPatternBrush
(
physDev
,
(
BITMAPINFO
*
)
logbrush
.
lbHatch
))
return
0
;
break
;
}
return
hbrush
;
...
...
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