Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
457c9650
Commit
457c9650
authored
Nov 03, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Retrieve the bits of a pattern brush when it's selected into a different type of DC.
parent
8277ac3f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
6 deletions
+49
-6
brush.c
dlls/gdi32/brush.c
+45
-3
dib.c
dlls/gdi32/dib.c
+1
-1
gdi_private.h
dlls/gdi32/gdi_private.h
+3
-2
No files found.
dlls/gdi32/brush.c
View file @
457c9650
...
...
@@ -58,6 +58,38 @@ static const struct gdi_obj_funcs brush_funcs =
};
/* fetch the contents of the brush bitmap and cache them in the brush object */
static
BOOL
store_bitmap_bits
(
BRUSHOBJ
*
brush
,
BITMAPOBJ
*
bmp
)
{
const
struct
gdi_dc_funcs
*
funcs
=
get_bitmap_funcs
(
bmp
);
struct
gdi_image_bits
bits
;
struct
bitblt_coords
src
;
BITMAPINFO
*
info
;
if
(
!
(
info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
]
))))
return
FALSE
;
src
.
visrect
.
left
=
src
.
x
=
0
;
src
.
visrect
.
top
=
src
.
y
=
0
;
src
.
visrect
.
right
=
src
.
width
=
bmp
->
bitmap
.
bmWidth
;
src
.
visrect
.
bottom
=
src
.
height
=
bmp
->
bitmap
.
bmHeight
;
if
(
funcs
->
pGetImage
(
NULL
,
brush
->
bitmap
,
info
,
&
bits
,
&
src
))
{
HeapFree
(
GetProcessHeap
(),
0
,
info
);
return
FALSE
;
}
if
(
info
->
bmiHeader
.
biBitCount
<=
8
&&
!
info
->
bmiHeader
.
biClrUsed
)
fill_default_color_table
(
info
);
/* release the unneeded space */
HeapReAlloc
(
GetProcessHeap
(),
HEAP_REALLOC_IN_PLACE_ONLY
,
info
,
bitmap_info_size
(
info
,
DIB_RGB_COLORS
));
brush
->
info
=
info
;
brush
->
bits
=
bits
;
brush
->
usage
=
DIB_RGB_COLORS
;
return
TRUE
;
}
/***********************************************************************
* CreateBrushIndirect (GDI32.@)
*
...
...
@@ -366,10 +398,17 @@ static HGDIOBJ BRUSH_SelectObject( HGDIOBJ handle, HDC hdc )
{
PHYSDEV
physdev
=
GET_DC_PHYSDEV
(
dc
,
pSelectBrush
);
HBITMAP
bitmap
=
brush
->
bitmap
;
BITMAPINFO
*
info
=
brush
->
info
;
void
*
bits
=
brush
->
bits
.
ptr
;
UINT
usage
=
brush
->
usage
;
BITMAPINFO
*
info
;
void
*
bits
;
UINT
usage
;
if
(
bitmap
&&
!
brush
->
info
)
{
BITMAPOBJ
*
bmp
=
GDI_GetObjPtr
(
bitmap
,
OBJ_BITMAP
);
/* fetch the bitmap bits if we are selecting into a different type of DC */
if
(
bmp
&&
bmp
->
funcs
!=
physdev
->
funcs
)
store_bitmap_bits
(
brush
,
bmp
);
GDI_ReleaseObj
(
bitmap
);
}
if
(
brush
->
logbrush
.
lbStyle
==
BS_PATTERN
)
{
PHYSDEV
pattern_dev
=
physdev
;
...
...
@@ -381,6 +420,9 @@ static HGDIOBJ BRUSH_SelectObject( HGDIOBJ handle, HDC hdc )
BITMAP_SetOwnerDC
(
(
HBITMAP
)
brush
->
logbrush
.
lbHatch
,
pattern_dev
);
}
info
=
brush
->
info
;
bits
=
brush
->
bits
.
ptr
;
usage
=
brush
->
usage
;
GDI_inc_ref_count
(
handle
);
GDI_ReleaseObj
(
handle
);
...
...
dlls/gdi32/dib.c
View file @
457c9650
...
...
@@ -1058,7 +1058,7 @@ static void copy_color_info(BITMAPINFO *dst, const BITMAPINFO *src, UINT colorus
}
}
static
void
fill_default_color_table
(
BITMAPINFO
*
info
)
void
fill_default_color_table
(
BITMAPINFO
*
info
)
{
int
i
;
...
...
dlls/gdi32/gdi_private.h
View file @
457c9650
...
...
@@ -229,8 +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
void
get_ddb_bitmapinfo
(
BITMAPOBJ
*
bmp
,
BITMAPINFO
*
info
)
DECLSPEC_HIDDEN
;
extern
BITMAPINFO
*
copy_packed_dib
(
const
BITMAPINFO
*
src_info
,
UINT
usage
)
DECLSPEC_HIDDEN
;
extern
BOOL
get_bitmap_image
(
HBITMAP
hbitmap
,
BITMAPINFO
*
info
,
struct
gdi_image_bits
*
bits
)
DECLSPEC_HIDDEN
;
extern
HBITMAP
BITMAP_CopyBitmap
(
HBITMAP
hbitmap
)
DECLSPEC_HIDDEN
;
extern
BOOL
BITMAP_SetOwnerDC
(
HBITMAP
hbitmap
,
PHYSDEV
physdev
)
DECLSPEC_HIDDEN
;
...
...
@@ -258,6 +256,9 @@ extern void DC_UpdateXforms( DC * dc ) DECLSPEC_HIDDEN;
/* dib.c */
extern
int
bitmap_info_size
(
const
BITMAPINFO
*
info
,
WORD
coloruse
)
DECLSPEC_HIDDEN
;
extern
void
fill_default_color_table
(
BITMAPINFO
*
info
)
DECLSPEC_HIDDEN
;
extern
void
get_ddb_bitmapinfo
(
BITMAPOBJ
*
bmp
,
BITMAPINFO
*
info
)
DECLSPEC_HIDDEN
;
extern
BITMAPINFO
*
copy_packed_dib
(
const
BITMAPINFO
*
src_info
,
UINT
usage
)
DECLSPEC_HIDDEN
;
extern
DWORD
convert_bitmapinfo
(
const
BITMAPINFO
*
src_info
,
void
*
src_bits
,
struct
bitblt_coords
*
src
,
const
BITMAPINFO
*
dst_info
,
void
*
dst_bits
,
BOOL
add_alpha
)
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