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
cf85fb14
Commit
cf85fb14
authored
May 29, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a helper function that implements GetImage on a bitmap.
parent
b6f25e52
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
39 deletions
+43
-39
bitmap.c
dlls/gdi32/bitmap.c
+1
-1
brush.c
dlls/gdi32/brush.c
+1
-1
dib.c
dlls/gdi32/dib.c
+1
-1
bitblt.c
dlls/gdi32/dibdrv/bitblt.c
+38
-36
gdi_private.h
dlls/gdi32/gdi_private.h
+2
-0
No files found.
dlls/gdi32/bitmap.c
View file @
cf85fb14
...
...
@@ -265,7 +265,7 @@ LONG WINAPI GetBitmapBits(
src
.
width
=
src
.
visrect
.
right
-
src
.
visrect
.
left
;
src
.
height
=
src
.
visrect
.
bottom
-
src
.
visrect
.
top
;
if
(
!
bmp
->
funcs
->
pGetImage
(
NULL
,
hbitma
p
,
info
,
&
src_bits
,
&
src
))
if
(
!
get_image_from_bitmap
(
bm
p
,
info
,
&
src_bits
,
&
src
))
{
const
char
*
src_ptr
=
src_bits
.
ptr
;
int
src_stride
=
get_dib_stride
(
info
->
bmiHeader
.
biWidth
,
info
->
bmiHeader
.
biBitCount
);
...
...
dlls/gdi32/brush.c
View file @
cf85fb14
...
...
@@ -69,7 +69,7 @@ static BOOL copy_bitmap( struct brush_pattern *brush, HBITMAP bitmap )
src
.
visrect
.
top
=
src
.
y
=
0
;
src
.
visrect
.
right
=
src
.
width
=
bmp
->
dib
.
dsBm
.
bmWidth
;
src
.
visrect
.
bottom
=
src
.
height
=
bmp
->
dib
.
dsBm
.
bmHeight
;
if
(
bmp
->
funcs
->
pGetImage
(
NULL
,
bitma
p
,
info
,
&
bits
,
&
src
))
goto
done
;
if
(
get_image_from_bitmap
(
bm
p
,
info
,
&
bits
,
&
src
))
goto
done
;
brush
->
bits
=
bits
;
if
(
!
bits
.
free
)
...
...
dlls/gdi32/dib.c
View file @
cf85fb14
...
...
@@ -1334,7 +1334,7 @@ INT WINAPI GetDIBits(
lines
=
src
.
height
;
}
err
=
bmp
->
funcs
->
pGetImage
(
NULL
,
hbitma
p
,
src_info
,
bits
?
&
src_bits
:
NULL
,
bits
?
&
src
:
NULL
);
err
=
get_image_from_bitmap
(
bm
p
,
src_info
,
bits
?
&
src_bits
:
NULL
,
bits
?
&
src
:
NULL
);
if
(
err
)
goto
done
;
...
...
dlls/gdi32/dibdrv/bitblt.c
View file @
cf85fb14
...
...
@@ -808,46 +808,19 @@ static void set_color_info( const dib_info *dib, BITMAPINFO *info )
}
}
/***********************************************************************
* dibdrv_GetImage
*/
DWORD
dibdrv_GetImage
(
PHYSDEV
dev
,
HBITMAP
hbitmap
,
BITMAPINFO
*
info
,
struct
gdi_image_bits
*
bits
,
struct
bitblt_coords
*
src
)
static
DWORD
get_image_dib_info
(
dib_info
*
dib
,
BITMAPINFO
*
info
,
struct
gdi_image_bits
*
bits
,
struct
bitblt_coords
*
src
)
{
DWORD
ret
=
ERROR_SUCCESS
;
dib_info
*
dib
=
NULL
,
stand_alone
;
TRACE
(
"%p %p %p
\n
"
,
dev
,
hbitmap
,
info
);
info
->
bmiHeader
.
biSize
=
sizeof
(
info
->
bmiHeader
);
info
->
bmiHeader
.
biPlanes
=
1
;
info
->
bmiHeader
.
biCompression
=
BI_RGB
;
info
->
bmiHeader
.
biXPelsPerMeter
=
0
;
info
->
bmiHeader
.
biYPelsPerMeter
=
0
;
info
->
bmiHeader
.
biClrImportant
=
0
;
if
(
hbitmap
)
{
BITMAPOBJ
*
bmp
=
GDI_GetObjPtr
(
hbitmap
,
OBJ_BITMAP
);
if
(
!
bmp
)
return
ERROR_INVALID_HANDLE
;
if
(
!
init_dib_info_from_bitmapobj
(
&
stand_alone
,
bmp
))
{
ret
=
ERROR_OUTOFMEMORY
;
goto
done
;
}
dib
=
&
stand_alone
;
}
else
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
dib
=
&
pdev
->
dib
;
}
info
->
bmiHeader
.
biWidth
=
dib
->
width
;
info
->
bmiHeader
.
biHeight
=
dib
->
rect
.
bottom
-
dib
->
rect
.
top
;
info
->
bmiHeader
.
biBitCount
=
dib
->
bit_count
;
info
->
bmiHeader
.
biSizeImage
=
info
->
bmiHeader
.
biHeight
*
abs
(
dib
->
stride
);
info
->
bmiHeader
.
biWidth
=
dib
->
width
;
info
->
bmiHeader
.
biHeight
=
dib
->
rect
.
bottom
-
dib
->
rect
.
top
;
info
->
bmiHeader
.
biBitCount
=
dib
->
bit_count
;
info
->
bmiHeader
.
biSizeImage
=
info
->
bmiHeader
.
biHeight
*
abs
(
dib
->
stride
);
if
(
dib
->
stride
>
0
)
info
->
bmiHeader
.
biHeight
=
-
info
->
bmiHeader
.
biHeight
;
set_color_info
(
dib
,
info
);
...
...
@@ -863,10 +836,39 @@ DWORD dibdrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
src
->
x
+=
dib
->
rect
.
left
;
offset_rect
(
&
src
->
visrect
,
dib
->
rect
.
left
,
0
);
}
return
ERROR_SUCCESS
;
}
done:
if
(
hbitmap
)
GDI_ReleaseObj
(
hbitmap
);
return
ret
;
DWORD
get_image_from_bitmap
(
BITMAPOBJ
*
bmp
,
BITMAPINFO
*
info
,
struct
gdi_image_bits
*
bits
,
struct
bitblt_coords
*
src
)
{
dib_info
dib
;
if
(
!
init_dib_info_from_bitmapobj
(
&
dib
,
bmp
))
return
ERROR_OUTOFMEMORY
;
return
get_image_dib_info
(
&
dib
,
info
,
bits
,
src
);
}
/***********************************************************************
* dibdrv_GetImage
*/
DWORD
dibdrv_GetImage
(
PHYSDEV
dev
,
HBITMAP
hbitmap
,
BITMAPINFO
*
info
,
struct
gdi_image_bits
*
bits
,
struct
bitblt_coords
*
src
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
TRACE
(
"%p %p %p
\n
"
,
dev
,
hbitmap
,
info
);
if
(
hbitmap
)
{
DWORD
ret
;
BITMAPOBJ
*
bmp
=
GDI_GetObjPtr
(
hbitmap
,
OBJ_BITMAP
);
if
(
!
bmp
)
return
ERROR_INVALID_HANDLE
;
ret
=
get_image_from_bitmap
(
bmp
,
info
,
bits
,
src
);
GDI_ReleaseObj
(
hbitmap
);
return
ret
;
}
return
get_image_dib_info
(
&
pdev
->
dib
,
info
,
bits
,
src
);
}
static
BOOL
matching_color_info
(
const
dib_info
*
dib
,
const
BITMAPINFO
*
info
)
...
...
dlls/gdi32/gdi_private.h
View file @
cf85fb14
...
...
@@ -269,6 +269,8 @@ extern COLORREF get_pixel_bitmapinfo( const BITMAPINFO *info, void *bits, struct
extern
BOOL
render_aa_text_bitmapinfo
(
HDC
hdc
,
BITMAPINFO
*
info
,
struct
gdi_image_bits
*
bits
,
struct
bitblt_coords
*
src
,
INT
x
,
INT
y
,
UINT
flags
,
UINT
aa_flags
,
LPCWSTR
str
,
UINT
count
,
const
INT
*
dx
)
DECLSPEC_HIDDEN
;
extern
DWORD
get_image_from_bitmap
(
BITMAPOBJ
*
bmp
,
BITMAPINFO
*
info
,
struct
gdi_image_bits
*
bits
,
struct
bitblt_coords
*
src
)
DECLSPEC_HIDDEN
;
/* driver.c */
extern
const
struct
gdi_dc_funcs
null_driver
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