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
0c5d619b
Commit
0c5d619b
authored
Nov 07, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Use the CopyBitmap entry point to copy the bitmap of a pattern brush.
parent
d9a45745
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
55 deletions
+15
-55
bitmap.c
dlls/gdi32/bitmap.c
+0
-53
brush.c
dlls/gdi32/brush.c
+15
-1
gdi_private.h
dlls/gdi32/gdi_private.h
+0
-1
No files found.
dlls/gdi32/bitmap.c
View file @
0c5d619b
...
...
@@ -510,59 +510,6 @@ LONG WINAPI SetBitmapBits(
return
count
;
}
/**********************************************************************
* BITMAP_CopyBitmap
*
*/
HBITMAP
BITMAP_CopyBitmap
(
HBITMAP
hbitmap
)
{
HBITMAP
res
;
DIBSECTION
dib
;
BITMAPOBJ
*
bmp
=
GDI_GetObjPtr
(
hbitmap
,
OBJ_BITMAP
);
if
(
!
bmp
)
return
0
;
if
(
bmp
->
dib
)
{
void
*
bits
;
BITMAPINFO
*
bi
;
HDC
dc
;
dib
=
*
bmp
->
dib
;
GDI_ReleaseObj
(
hbitmap
);
dc
=
CreateCompatibleDC
(
NULL
);
if
(
!
dc
)
return
0
;
if
(
!
(
bi
=
HeapAlloc
(
GetProcessHeap
(),
0
,
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
]
))))
{
DeleteDC
(
dc
);
return
0
;
}
bi
->
bmiHeader
=
dib
.
dsBmih
;
/* Get the color table or the color masks */
GetDIBits
(
dc
,
hbitmap
,
0
,
0
,
NULL
,
bi
,
DIB_RGB_COLORS
);
bi
->
bmiHeader
.
biHeight
=
dib
.
dsBmih
.
biHeight
;
res
=
CreateDIBSection
(
dc
,
bi
,
DIB_RGB_COLORS
,
&
bits
,
NULL
,
0
);
if
(
res
)
SetDIBits
(
dc
,
res
,
0
,
dib
.
dsBm
.
bmHeight
,
dib
.
dsBm
.
bmBits
,
bi
,
DIB_RGB_COLORS
);
HeapFree
(
GetProcessHeap
(),
0
,
bi
);
DeleteDC
(
dc
);
return
res
;
}
dib
.
dsBm
=
bmp
->
bitmap
;
dib
.
dsBm
.
bmBits
=
NULL
;
GDI_ReleaseObj
(
hbitmap
);
res
=
CreateBitmapIndirect
(
&
dib
.
dsBm
);
if
(
res
)
{
char
*
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dib
.
dsBm
.
bmWidthBytes
*
dib
.
dsBm
.
bmHeight
);
GetBitmapBits
(
hbitmap
,
dib
.
dsBm
.
bmWidthBytes
*
dib
.
dsBm
.
bmHeight
,
buf
);
SetBitmapBits
(
res
,
dib
.
dsBm
.
bmWidthBytes
*
dib
.
dsBm
.
bmHeight
,
buf
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
return
res
;
}
static
void
set_initial_bitmap_bits
(
HBITMAP
hbitmap
,
BITMAPOBJ
*
bmp
)
{
...
...
dlls/gdi32/brush.c
View file @
0c5d619b
...
...
@@ -99,8 +99,22 @@ static BOOL copy_bitmap( BRUSHOBJ *brush, HBITMAP bitmap )
if
(
!
bmp
->
dib
)
{
if
((
brush
->
bitmap
=
CreateBitmap
(
bmp
->
bitmap
.
bmWidth
,
bmp
->
bitmap
.
bmHeight
,
bmp
->
bitmap
.
bmPlanes
,
bmp
->
bitmap
.
bmBitsPixel
,
NULL
)))
{
if
(
bmp
->
funcs
->
pCopyBitmap
(
bitmap
,
brush
->
bitmap
))
{
BITMAPOBJ
*
copy
=
GDI_GetObjPtr
(
brush
->
bitmap
,
OBJ_BITMAP
);
copy
->
funcs
=
bmp
->
funcs
;
GDI_ReleaseObj
(
copy
);
}
else
{
DeleteObject
(
brush
->
bitmap
);
brush
->
bitmap
=
0
;
}
}
GDI_ReleaseObj
(
bitmap
);
brush
->
bitmap
=
BITMAP_CopyBitmap
(
bitmap
);
return
brush
->
bitmap
!=
0
;
}
...
...
dlls/gdi32/gdi_private.h
View file @
0c5d619b
...
...
@@ -229,7 +229,6 @@ extern DWORD stretch_bits( const BITMAPINFO *src_info, struct bitblt_coords *src
struct
gdi_image_bits
*
bits
,
int
mode
)
DECLSPEC_HIDDEN
;
/* bitmap.c */
extern
HBITMAP
BITMAP_CopyBitmap
(
HBITMAP
hbitmap
)
DECLSPEC_HIDDEN
;
extern
BOOL
BITMAP_SetOwnerDC
(
HBITMAP
hbitmap
,
PHYSDEV
physdev
)
DECLSPEC_HIDDEN
;
extern
BOOL
get_brush_bitmap_info
(
HBRUSH
handle
,
BITMAPINFO
*
info
,
void
**
bits
,
UINT
*
usage
)
DECLSPEC_HIDDEN
;
...
...
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