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
9701f118
Commit
9701f118
authored
Sep 17, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Give GDI surfaces their own GetDC copy.
parent
5a775644
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
3 deletions
+71
-3
surface_gdi.c
dlls/wined3d/surface_gdi.c
+71
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-2
No files found.
dlls/wined3d/surface_gdi.c
View file @
9701f118
...
...
@@ -1490,6 +1490,76 @@ const char* filename)
return
WINED3D_OK
;
}
HRESULT
WINAPI
IWineGDISurfaceImpl_GetDC
(
IWineD3DSurface
*
iface
,
HDC
*
pHDC
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
WINED3DLOCKED_RECT
lock
;
HRESULT
hr
;
RGBQUAD
col
[
256
];
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pHDC
);
if
(
This
->
Flags
&
SFLAG_USERPTR
)
{
ERR
(
"Not supported on surfaces with an application-provided surfaces
\n
"
);
return
WINEDDERR_NODC
;
}
/* Give more detailed info for ddraw */
if
(
This
->
Flags
&
SFLAG_DCINUSE
)
return
WINEDDERR_DCALREADYCREATED
;
/* Can't GetDC if the surface is locked */
if
(
This
->
Flags
&
SFLAG_LOCKED
)
return
WINED3DERR_INVALIDCALL
;
memset
(
&
lock
,
0
,
sizeof
(
lock
));
/* To be sure */
/* Should have a DIB section already */
/* Lock the surface */
hr
=
IWineD3DSurface_LockRect
(
iface
,
&
lock
,
NULL
,
0
);
if
(
FAILED
(
hr
))
{
ERR
(
"IWineD3DSurface_LockRect failed with hr = %08x
\n
"
,
hr
);
/* keep the dib section */
return
hr
;
}
if
(
This
->
resource
.
format
==
WINED3DFMT_P8
||
This
->
resource
.
format
==
WINED3DFMT_A8P8
)
{
unsigned
int
n
;
if
(
This
->
palette
)
{
PALETTEENTRY
ent
[
256
];
GetPaletteEntries
(
This
->
palette
->
hpal
,
0
,
256
,
ent
);
for
(
n
=
0
;
n
<
256
;
n
++
)
{
col
[
n
].
rgbRed
=
ent
[
n
].
peRed
;
col
[
n
].
rgbGreen
=
ent
[
n
].
peGreen
;
col
[
n
].
rgbBlue
=
ent
[
n
].
peBlue
;
col
[
n
].
rgbReserved
=
0
;
}
}
else
{
IWineD3DDeviceImpl
*
device
=
This
->
resource
.
wineD3DDevice
;
for
(
n
=
0
;
n
<
256
;
n
++
)
{
col
[
n
].
rgbRed
=
device
->
palettes
[
device
->
currentPalette
][
n
].
peRed
;
col
[
n
].
rgbGreen
=
device
->
palettes
[
device
->
currentPalette
][
n
].
peGreen
;
col
[
n
].
rgbBlue
=
device
->
palettes
[
device
->
currentPalette
][
n
].
peBlue
;
col
[
n
].
rgbReserved
=
0
;
}
}
SetDIBColorTable
(
This
->
hDC
,
0
,
256
,
col
);
}
*
pHDC
=
This
->
hDC
;
TRACE
(
"returning %p
\n
"
,
*
pHDC
);
This
->
Flags
|=
SFLAG_DCINUSE
;
return
WINED3D_OK
;
}
HRESULT
WINAPI
IWineGDISurfaceImpl_ReleaseDC
(
IWineD3DSurface
*
iface
,
HDC
hDC
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
...
...
@@ -1644,7 +1714,7 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl =
IWineD3DBaseSurfaceImpl_GetDesc
,
IWineGDISurfaceImpl_LockRect
,
IWineGDISurfaceImpl_UnlockRect
,
IWine
D3D
SurfaceImpl_GetDC
,
IWine
GDI
SurfaceImpl_GetDC
,
IWineGDISurfaceImpl_ReleaseDC
,
IWineGDISurfaceImpl_Flip
,
IWineGDISurfaceImpl_Blt
,
...
...
dlls/wined3d/wined3d_private.h
View file @
9701f118
...
...
@@ -1172,9 +1172,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3D
HRESULT
IWineD3DBaseSurfaceImpl_CreateDIBSection
(
IWineD3DSurface
*
iface
);
ULONG
WINAPI
IWineD3DSurfaceImpl_Release
(
IWineD3DSurface
*
iface
);
HRESULT
WINAPI
IWineD3DSurfaceImpl_SetPixelFormat
(
IWineD3DSurface
*
iface
,
WINED3DFORMAT
Format
,
BYTE
*
Surface
,
DWORD
Size
);
const
void
*
WINAPI
IWineD3DSurfaceImpl_GetData
(
IWineD3DSurface
*
iface
);
HRESULT
WINAPI
IWineD3DSurfaceImpl_GetDC
(
IWineD3DSurface
*
iface
,
HDC
*
pHDC
);
HRESULT
WINAPI
IWineGDISurfaceImpl_Blt
(
IWineD3DSurface
*
iface
,
RECT
*
DestRect
,
IWineD3DSurface
*
SrcSurface
,
RECT
*
SrcRect
,
DWORD
Flags
,
WINEDDBLTFX
*
DDBltFx
,
WINED3DTEXTUREFILTERTYPE
Filter
);
HRESULT
WINAPI
IWineGDISurfaceImpl_BltFast
(
IWineD3DSurface
*
iface
,
DWORD
dstx
,
DWORD
dsty
,
IWineD3DSurface
*
Source
,
RECT
*
rsrc
,
DWORD
trans
);
...
...
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