Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
76b5c1dc
Commit
76b5c1dc
authored
Aug 03, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Partial implementation of PutImage in the null driver for DDBs.
parent
b113af1b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
7 deletions
+78
-7
bitmap.c
dlls/gdi32/bitmap.c
+75
-0
driver.c
dlls/gdi32/driver.c
+0
-7
gdi_private.h
dlls/gdi32/gdi_private.h
+3
-0
No files found.
dlls/gdi32/bitmap.c
View file @
76b5c1dc
...
...
@@ -126,6 +126,81 @@ done:
return
ERROR_SUCCESS
;
}
DWORD
nulldrv_PutImage
(
PHYSDEV
dev
,
HBITMAP
hbitmap
,
HRGN
clip
,
BITMAPINFO
*
info
,
const
struct
gdi_image_bits
*
bits
,
struct
bitblt_coords
*
src
,
struct
bitblt_coords
*
dst
,
DWORD
rop
)
{
BITMAPOBJ
*
bmp
;
if
(
!
hbitmap
)
return
ERROR_SUCCESS
;
if
(
!
(
bmp
=
GDI_GetObjPtr
(
hbitmap
,
OBJ_BITMAP
)))
return
ERROR_INVALID_HANDLE
;
if
(
info
->
bmiHeader
.
biPlanes
!=
1
)
goto
update_format
;
if
(
info
->
bmiHeader
.
biBitCount
!=
bmp
->
bitmap
.
bmBitsPixel
)
goto
update_format
;
/* FIXME: check color masks */
if
(
bits
)
{
int
i
,
width_bytes
=
get_dib_stride
(
info
->
bmiHeader
.
biWidth
,
info
->
bmiHeader
.
biBitCount
);
unsigned
char
*
dst_bits
,
*
src_bits
;
if
((
src
->
width
!=
dst
->
width
)
||
(
src
->
height
!=
dst
->
height
))
{
GDI_ReleaseObj
(
hbitmap
);
return
ERROR_TRANSFORM_NOT_SUPPORTED
;
}
if
(
src
->
visrect
.
left
>
0
||
src
->
visrect
.
right
<
bmp
->
bitmap
.
bmWidth
||
dst
->
visrect
.
left
>
0
||
dst
->
visrect
.
right
<
bmp
->
bitmap
.
bmWidth
)
{
FIXME
(
"setting partial rows not supported
\n
"
);
GDI_ReleaseObj
(
hbitmap
);
return
ERROR_NOT_SUPPORTED
;
}
if
(
clip
)
{
FIXME
(
"clip region not supported
\n
"
);
GDI_ReleaseObj
(
hbitmap
);
return
ERROR_NOT_SUPPORTED
;
}
if
(
!
bmp
->
bitmap
.
bmBits
&&
!
(
bmp
->
bitmap
.
bmBits
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bmp
->
bitmap
.
bmHeight
*
bmp
->
bitmap
.
bmWidthBytes
)))
{
GDI_ReleaseObj
(
hbitmap
);
return
ERROR_OUTOFMEMORY
;
}
src_bits
=
bits
->
ptr
;
if
(
info
->
bmiHeader
.
biHeight
>
0
)
{
src_bits
+=
(
info
->
bmiHeader
.
biHeight
-
1
-
src
->
visrect
.
top
)
*
width_bytes
;
width_bytes
=
-
width_bytes
;
}
else
src_bits
+=
src
->
visrect
.
top
*
width_bytes
;
dst_bits
=
(
unsigned
char
*
)
bmp
->
bitmap
.
bmBits
+
dst
->
visrect
.
top
*
bmp
->
bitmap
.
bmWidthBytes
;
if
(
width_bytes
!=
bmp
->
bitmap
.
bmWidthBytes
)
{
for
(
i
=
0
;
i
<
dst
->
visrect
.
bottom
-
dst
->
visrect
.
top
;
i
++
)
{
memcpy
(
dst_bits
,
src_bits
,
min
(
abs
(
width_bytes
),
bmp
->
bitmap
.
bmWidthBytes
));
src_bits
+=
width_bytes
;
dst_bits
+=
bmp
->
bitmap
.
bmWidthBytes
;
}
}
else
memcpy
(
dst_bits
,
src_bits
,
width_bytes
*
(
dst
->
visrect
.
bottom
-
dst
->
visrect
.
top
)
);
}
GDI_ReleaseObj
(
hbitmap
);
return
ERROR_SUCCESS
;
update_format:
info
->
bmiHeader
.
biPlanes
=
1
;
info
->
bmiHeader
.
biBitCount
=
bmp
->
bitmap
.
bmBitsPixel
;
if
(
info
->
bmiHeader
.
biHeight
>
0
)
info
->
bmiHeader
.
biHeight
=
-
info
->
bmiHeader
.
biHeight
;
return
ERROR_BAD_FORMAT
;
}
/******************************************************************************
* CreateBitmap [GDI32.@]
...
...
dlls/gdi32/driver.c
View file @
76b5c1dc
...
...
@@ -421,13 +421,6 @@ static BOOL nulldrv_Polyline( PHYSDEV dev, const POINT *points, INT count )
return
TRUE
;
}
static
DWORD
nulldrv_PutImage
(
PHYSDEV
dev
,
HBITMAP
hbitmap
,
HRGN
clip
,
BITMAPINFO
*
info
,
const
struct
gdi_image_bits
*
bits
,
struct
bitblt_coords
*
src
,
struct
bitblt_coords
*
dst
,
DWORD
rop
)
{
return
ERROR_SUCCESS
;
}
static
UINT
nulldrv_RealizeDefaultPalette
(
PHYSDEV
dev
)
{
return
0
;
...
...
dlls/gdi32/gdi_private.h
View file @
76b5c1dc
...
...
@@ -493,6 +493,9 @@ extern BOOL nulldrv_PolyBezier( PHYSDEV dev, const POINT *points, DWORD count )
extern
BOOL
nulldrv_PolyBezierTo
(
PHYSDEV
dev
,
const
POINT
*
points
,
DWORD
count
)
DECLSPEC_HIDDEN
;
extern
BOOL
nulldrv_PolyDraw
(
PHYSDEV
dev
,
const
POINT
*
points
,
const
BYTE
*
types
,
DWORD
count
)
DECLSPEC_HIDDEN
;
extern
BOOL
nulldrv_PolylineTo
(
PHYSDEV
dev
,
const
POINT
*
points
,
INT
count
)
DECLSPEC_HIDDEN
;
extern
DWORD
nulldrv_PutImage
(
PHYSDEV
dev
,
HBITMAP
hbitmap
,
HRGN
clip
,
BITMAPINFO
*
info
,
const
struct
gdi_image_bits
*
bits
,
struct
bitblt_coords
*
src
,
struct
bitblt_coords
*
dst
,
DWORD
rop
)
DECLSPEC_HIDDEN
;
extern
BOOL
nulldrv_RestoreDC
(
PHYSDEV
dev
,
INT
level
)
DECLSPEC_HIDDEN
;
extern
INT
nulldrv_SaveDC
(
PHYSDEV
dev
)
DECLSPEC_HIDDEN
;
extern
BOOL
nulldrv_ScaleViewportExtEx
(
PHYSDEV
dev
,
INT
x_num
,
INT
x_denom
,
INT
y_num
,
INT
y_denom
,
SIZE
*
size
)
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