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
bff79eb2
Commit
bff79eb2
authored
Aug 29, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Forward the null driver GetImage to the DIB driver since the bits are in DIB format.
parent
c268c40f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
36 deletions
+36
-36
bitmap.c
dlls/gdi32/bitmap.c
+11
-35
dib.c
dlls/gdi32/dib.c
+16
-0
dc.c
dlls/gdi32/dibdrv/dc.c
+8
-1
gdi_private.h
dlls/gdi32/gdi_private.h
+1
-0
No files found.
dlls/gdi32/bitmap.c
View file @
bff79eb2
...
...
@@ -54,55 +54,31 @@ DWORD nulldrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
struct
gdi_image_bits
*
bits
,
struct
bitblt_coords
*
src
)
{
BITMAPOBJ
*
bmp
;
int
height
,
width_bytes
;
DWORD
ret
;
if
(
!
hbitmap
)
return
ERROR_NOT_SUPPORTED
;
if
(
!
(
bmp
=
GDI_GetObjPtr
(
hbitmap
,
OBJ_BITMAP
)))
return
ERROR_INVALID_HANDLE
;
info
->
bmiHeader
.
biSize
=
sizeof
(
info
->
bmiHeader
);
info
->
bmiHeader
.
biPlanes
=
1
;
info
->
bmiHeader
.
biBitCount
=
bmp
->
bitmap
.
bmBitsPixel
;
info
->
bmiHeader
.
biCompression
=
BI_RGB
;
info
->
bmiHeader
.
biXPelsPerMeter
=
0
;
info
->
bmiHeader
.
biYPelsPerMeter
=
0
;
info
->
bmiHeader
.
biClrUsed
=
0
;
info
->
bmiHeader
.
biClrImportant
=
0
;
if
(
bmp
->
bitmap
.
bmBitsPixel
==
16
)
if
(
bmp
->
bitmap
.
bmBits
||
!
bits
)
{
DWORD
*
masks
=
(
DWORD
*
)
info
->
bmiColors
;
masks
[
0
]
=
0x7c00
;
masks
[
1
]
=
0x03e0
;
masks
[
2
]
=
0x001f
;
info
->
bmiHeader
.
biCompression
=
BI_BITFIELDS
;
ret
=
dib_driver
.
pGetImage
(
0
,
hbitmap
,
info
,
bits
,
src
);
}
if
(
!
bits
)
goto
done
;
height
=
src
->
visrect
.
bottom
-
src
->
visrect
.
top
;
width_bytes
=
get_dib_stride
(
bmp
->
bitmap
.
bmWidth
,
bmp
->
bitmap
.
bmBitsPixel
);
info
->
bmiHeader
.
biWidth
=
bmp
->
bitmap
.
bmWidth
;
info
->
bmiHeader
.
biHeight
=
-
height
;
info
->
bmiHeader
.
biSizeImage
=
height
*
width_bytes
;
else
if
(
!
(
ret
=
dib_driver
.
pGetImage
(
0
,
hbitmap
,
info
,
NULL
,
src
)))
{
info
->
bmiHeader
.
biHeight
=
-
(
src
->
visrect
.
bottom
-
src
->
visrect
.
top
);
info
->
bmiHeader
.
biSizeImage
=
get_dib_image_size
(
info
);
/* make the source rectangle relative to the returned bits */
src
->
y
-=
src
->
visrect
.
top
;
offset_rect
(
&
src
->
visrect
,
0
,
-
src
->
visrect
.
top
);
/* make the source rectangle relative to the returned bits */
src
->
y
-=
src
->
visrect
.
top
;
offset_rect
(
&
src
->
visrect
,
0
,
-
src
->
visrect
.
top
);
if
(
bmp
->
bitmap
.
bmBits
)
{
bits
->
ptr
=
(
char
*
)
bmp
->
bitmap
.
bmBits
+
src
->
visrect
.
top
*
width_bytes
;
bits
->
is_copy
=
FALSE
;
bits
->
free
=
NULL
;
}
else
{
/* return all-zero bits */
bits
->
ptr
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
info
->
bmiHeader
.
biSizeImage
);
bits
->
is_copy
=
TRUE
;
bits
->
free
=
free_heap_bits
;
}
done:
GDI_ReleaseObj
(
hbitmap
);
return
ERROR_SUCCESS
;
return
ret
;
}
DWORD
nulldrv_PutImage
(
PHYSDEV
dev
,
HBITMAP
hbitmap
,
HRGN
clip
,
BITMAPINFO
*
info
,
...
...
dlls/gdi32/dib.c
View file @
bff79eb2
...
...
@@ -895,6 +895,22 @@ static void fill_default_color_table( BITMAPINFO *info )
}
}
void
get_ddb_bitmapinfo
(
BITMAPOBJ
*
bmp
,
BITMAPINFO
*
info
)
{
info
->
bmiHeader
.
biSize
=
sizeof
(
info
->
bmiHeader
);
info
->
bmiHeader
.
biWidth
=
bmp
->
bitmap
.
bmWidth
;
info
->
bmiHeader
.
biHeight
=
-
bmp
->
bitmap
.
bmHeight
;
info
->
bmiHeader
.
biPlanes
=
1
;
info
->
bmiHeader
.
biBitCount
=
bmp
->
bitmap
.
bmBitsPixel
;
info
->
bmiHeader
.
biCompression
=
BI_RGB
;
info
->
bmiHeader
.
biXPelsPerMeter
=
0
;
info
->
bmiHeader
.
biYPelsPerMeter
=
0
;
info
->
bmiHeader
.
biClrUsed
=
0
;
info
->
bmiHeader
.
biClrImportant
=
0
;
if
(
info
->
bmiHeader
.
biBitCount
<=
8
)
fill_default_color_table
(
info
);
}
/******************************************************************************
* GetDIBits [GDI32.@]
*
...
...
dlls/gdi32/dibdrv/dc.c
View file @
bff79eb2
...
...
@@ -213,7 +213,14 @@ BOOL init_dib_info_from_bitmapinfo(dib_info *dib, const BITMAPINFO *info, void *
BOOL
init_dib_info_from_bitmapobj
(
dib_info
*
dib
,
BITMAPOBJ
*
bmp
,
enum
dib_info_flags
flags
)
{
assert
(
bmp
->
dib
);
if
(
!
bmp
->
dib
)
{
char
buffer
[
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
]
)];
BITMAPINFO
*
info
=
(
BITMAPINFO
*
)
buffer
;
get_ddb_bitmapinfo
(
bmp
,
info
);
return
init_dib_info_from_bitmapinfo
(
dib
,
info
,
bmp
->
bitmap
.
bmBits
,
flags
);
}
return
init_dib_info
(
dib
,
&
bmp
->
dib
->
dsBmih
,
bmp
->
dib
->
dsBitfields
,
bmp
->
color_table
,
bmp
->
nb_colors
,
bmp
->
dib
->
dsBm
.
bmBits
,
flags
);
}
...
...
dlls/gdi32/gdi_private.h
View file @
bff79eb2
...
...
@@ -308,6 +308,7 @@ extern BOOL BIDI_Reorder( HDC hDC, LPCWSTR lpString, INT uCount, DWORD dwFlags,
LPWSTR
lpOutString
,
INT
uCountOut
,
UINT
*
lpOrder
,
WORD
**
lpGlyphs
,
INT
*
cGlyphs
)
DECLSPEC_HIDDEN
;
/* bitmap.c */
extern
void
get_ddb_bitmapinfo
(
BITMAPOBJ
*
bmp
,
BITMAPINFO
*
info
)
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
;
...
...
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