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
eb80e6f2
Commit
eb80e6f2
authored
May 08, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Allow a driver to implement SelectBitmap but not CreateBitmap.
parent
e94d3b4e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
48 deletions
+25
-48
bitmap.c
dlls/gdi32/bitmap.c
+25
-48
No files found.
dlls/gdi32/bitmap.c
View file @
eb80e6f2
...
...
@@ -493,49 +493,6 @@ static void set_initial_bitmap_bits( HBITMAP hbitmap, BITMAPOBJ *bmp )
}
}
/***********************************************************************
* BITMAP_SetOwnerDC
*
* Set the type of DC that owns the bitmap. This is used when the
* bitmap is selected into a device to initialize the bitmap function
* table.
*/
static
BOOL
BITMAP_SetOwnerDC
(
HBITMAP
hbitmap
,
PHYSDEV
physdev
)
{
BITMAPOBJ
*
bitmap
;
BOOL
ret
=
TRUE
;
/* never set the owner of the stock bitmap since it can be selected in multiple DCs */
if
(
hbitmap
==
GetStockObject
(
DEFAULT_BITMAP
))
return
TRUE
;
if
(
!
(
bitmap
=
GDI_GetObjPtr
(
hbitmap
,
OBJ_BITMAP
)))
return
FALSE
;
if
(
bitmap
->
funcs
!=
physdev
->
funcs
)
{
/* we can only change from the null driver to some other driver */
if
(
bitmap
->
funcs
==
&
null_driver
)
{
if
(
physdev
->
funcs
->
pCreateBitmap
)
{
ret
=
physdev
->
funcs
->
pCreateBitmap
(
physdev
,
hbitmap
);
if
(
ret
)
{
bitmap
->
funcs
=
physdev
->
funcs
;
set_initial_bitmap_bits
(
hbitmap
,
bitmap
);
}
}
else
bitmap
->
funcs
=
&
dib_driver
;
/* use the DIB driver to emulate DDB support */
}
else
{
FIXME
(
"Trying to select bitmap %p in different DC type
\n
"
,
hbitmap
);
ret
=
FALSE
;
}
}
GDI_ReleaseObj
(
hbitmap
);
return
ret
;
}
/***********************************************************************
* BITMAP_SelectObject
...
...
@@ -545,7 +502,7 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, HDC hdc )
HGDIOBJ
ret
;
BITMAPOBJ
*
bitmap
;
DC
*
dc
;
PHYSDEV
physdev
=
NULL
,
old_physdev
=
NULL
;
PHYSDEV
physdev
=
NULL
,
old_physdev
=
NULL
,
createdev
;
if
(
!
(
dc
=
get_dc_ptr
(
hdc
)))
return
0
;
...
...
@@ -574,6 +531,7 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, HDC hdc )
if
(
dc
->
dibdrv
)
old_physdev
=
pop_dc_driver
(
dc
,
dc
->
dibdrv
);
physdev
=
GET_DC_PHYSDEV
(
dc
,
pSelectBitmap
);
createdev
=
GET_DC_PHYSDEV
(
dc
,
pCreateBitmap
);
if
(
physdev
->
funcs
==
&
null_driver
)
{
physdev
=
dc
->
dibdrv
;
...
...
@@ -585,12 +543,31 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, HDC hdc )
}
}
if
(
!
BITMAP_SetOwnerDC
(
handle
,
physdev
))
/* never set the owner of the stock bitmap since it can be selected in multiple DCs */
if
(
handle
!=
GetStockObject
(
DEFAULT_BITMAP
)
&&
bitmap
->
funcs
!=
createdev
->
funcs
)
{
GDI_ReleaseObj
(
handle
);
ret
=
0
;
goto
done
;
/* we can only change from the null driver to some other driver */
if
(
bitmap
->
funcs
!=
&
null_driver
)
{
FIXME
(
"Trying to select bitmap %p in different DC type
\n
"
,
handle
);
GDI_ReleaseObj
(
handle
);
ret
=
0
;
goto
done
;
}
if
(
createdev
->
funcs
!=
&
null_driver
)
{
if
(
!
createdev
->
funcs
->
pCreateBitmap
(
createdev
,
handle
))
{
GDI_ReleaseObj
(
handle
);
ret
=
0
;
goto
done
;
}
bitmap
->
funcs
=
createdev
->
funcs
;
set_initial_bitmap_bits
(
handle
,
bitmap
);
}
else
bitmap
->
funcs
=
&
dib_driver
;
/* use the DIB driver to emulate DDB support */
}
if
(
!
physdev
->
funcs
->
pSelectBitmap
(
physdev
,
handle
))
{
GDI_ReleaseObj
(
handle
);
...
...
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