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
511f9dfb
Commit
511f9dfb
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: Clean up SetMem.
parent
24564915
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
9 deletions
+48
-9
surface.c
dlls/wined3d/surface.c
+0
-6
surface_gdi.c
dlls/wined3d/surface_gdi.c
+48
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-2
No files found.
dlls/wined3d/surface.c
View file @
511f9dfb
...
...
@@ -2540,12 +2540,6 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORM
HRESULT
WINAPI
IWineD3DSurfaceImpl_SetMem
(
IWineD3DSurface
*
iface
,
void
*
Mem
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
/* Render targets depend on their hdc, and we can't create an hdc on a user pointer */
if
(
This
->
resource
.
usage
&
WINED3DUSAGE_RENDERTARGET
)
{
ERR
(
"Not supported on render targets
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
if
(
This
->
Flags
&
(
SFLAG_LOCKED
|
SFLAG_DCINUSE
))
{
WARN
(
"Surface is locked or the HDC is in use
\n
"
);
return
WINED3DERR_INVALIDCALL
;
...
...
dlls/wined3d/surface_gdi.c
View file @
511f9dfb
...
...
@@ -1569,6 +1569,53 @@ HRESULT WINAPI IWineGDISurfaceImpl_AddDirtyRect(IWineD3DSurface *iface, CONST RE
return
WINED3D_OK
;
}
HRESULT
WINAPI
IWineGDISurfaceImpl_SetMem
(
IWineD3DSurface
*
iface
,
void
*
Mem
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
/* Render targets depend on their hdc, and we can't create an hdc on a user pointer */
if
(
This
->
resource
.
usage
&
WINED3DUSAGE_RENDERTARGET
)
{
ERR
(
"Not supported on render targets
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
if
(
This
->
Flags
&
(
SFLAG_LOCKED
|
SFLAG_DCINUSE
))
{
WARN
(
"Surface is locked or the HDC is in use
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
if
(
Mem
&&
Mem
!=
This
->
resource
.
allocatedMemory
)
{
void
*
release
=
NULL
;
/* Do I have to copy the old surface content? */
if
(
This
->
Flags
&
SFLAG_DIBSECTION
)
{
/* Release the DC. No need to hold the critical section for the update
* Thread because this thread runs only on front buffers, but this method
* fails for render targets in the check above.
*/
SelectObject
(
This
->
hDC
,
This
->
dib
.
holdbitmap
);
DeleteDC
(
This
->
hDC
);
/* Release the DIB section */
DeleteObject
(
This
->
dib
.
DIBsection
);
This
->
dib
.
bitmap_data
=
NULL
;
This
->
resource
.
allocatedMemory
=
NULL
;
This
->
hDC
=
NULL
;
This
->
Flags
&=
~
SFLAG_DIBSECTION
;
}
else
if
(
!
(
This
->
Flags
&
SFLAG_USERPTR
))
{
release
=
This
->
resource
.
allocatedMemory
;
}
This
->
resource
.
allocatedMemory
=
Mem
;
This
->
Flags
|=
SFLAG_USERPTR
|
SFLAG_INSYSMEM
;
/* Now free the old memory if any */
HeapFree
(
GetProcessHeap
(),
0
,
release
);
}
else
if
(
This
->
Flags
&
SFLAG_USERPTR
)
{
/* Lockrect and GetDC will re-create the dib section and allocated memory */
This
->
resource
.
allocatedMemory
=
NULL
;
This
->
Flags
&=
~
SFLAG_USERPTR
;
}
return
WINED3D_OK
;
}
/* FIXME: This vtable should not use any IWineD3DSurface* implementation functions,
* only IWineD3DBaseSurface and IWineGDISurface ones.
*/
...
...
@@ -1607,7 +1654,7 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl =
IWineD3DBaseSurfaceImpl_RealizePalette
,
IWineD3DBaseSurfaceImpl_SetColorKey
,
IWineD3DBaseSurfaceImpl_GetPitch
,
IWine
D3D
SurfaceImpl_SetMem
,
IWine
GDI
SurfaceImpl_SetMem
,
IWineD3DBaseSurfaceImpl_SetOverlayPosition
,
IWineD3DBaseSurfaceImpl_GetOverlayPosition
,
IWineD3DBaseSurfaceImpl_UpdateOverlayZOrder
,
...
...
dlls/wined3d/wined3d_private.h
View file @
511f9dfb
...
...
@@ -1171,12 +1171,10 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetClipper(IWineD3DSurface *iface, IWineD
HRESULT
WINAPI
IWineD3DBaseSurfaceImpl_SetFormat
(
IWineD3DSurface
*
iface
,
WINED3DFORMAT
format
);
ULONG
WINAPI
IWineD3DSurfaceImpl_Release
(
IWineD3DSurface
*
iface
);
void
WINAPI
IWineD3DSurfaceImpl_PreLoad
(
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
IWineD3DSurfaceImpl_ReleaseDC
(
IWineD3DSurface
*
iface
,
HDC
hDC
);
HRESULT
WINAPI
IWineD3DSurfaceImpl_SetMem
(
IWineD3DSurface
*
iface
,
void
*
Mem
);
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