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
d99143c2
Commit
d99143c2
authored
Sep 16, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move non-rendering surface specific code to the base class.
parent
0c916104
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
110 additions
and
106 deletions
+110
-106
surface.c
dlls/wined3d/surface.c
+6
-93
surface_base.c
dlls/wined3d/surface_base.c
+92
-1
surface_gdi.c
dlls/wined3d/surface_gdi.c
+6
-6
wined3d_private.h
dlls/wined3d/wined3d_private.h
+6
-6
No files found.
dlls/wined3d/surface.c
View file @
d99143c2
...
...
@@ -477,47 +477,6 @@ void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface) {
IWineD3DSurface IWineD3DSurface parts follow
****************************************************** */
HRESULT
WINAPI
IWineD3DSurfaceImpl_GetContainer
(
IWineD3DSurface
*
iface
,
REFIID
riid
,
void
**
ppContainer
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
IWineD3DBase
*
container
=
0
;
TRACE
(
"(This %p, riid %s, ppContainer %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppContainer
);
if
(
!
ppContainer
)
{
ERR
(
"Called without a valid ppContainer.
\n
"
);
}
/** From MSDN:
* If the surface is created using CreateImageSurface/CreateOffscreenPlainSurface, CreateRenderTarget,
* or CreateDepthStencilSurface, the surface is considered stand alone. In this case,
* GetContainer will return the Direct3D device used to create the surface.
*/
if
(
This
->
container
)
{
container
=
This
->
container
;
}
else
{
container
=
(
IWineD3DBase
*
)
This
->
resource
.
wineD3DDevice
;
}
TRACE
(
"Relaying to QueryInterface
\n
"
);
return
IUnknown_QueryInterface
(
container
,
riid
,
ppContainer
);
}
HRESULT
WINAPI
IWineD3DSurfaceImpl_GetDesc
(
IWineD3DSurface
*
iface
,
WINED3DSURFACE_DESC
*
pDesc
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
TRACE
(
"(%p) : copying into %p
\n
"
,
This
,
pDesc
);
if
(
pDesc
->
Format
!=
NULL
)
*
(
pDesc
->
Format
)
=
This
->
resource
.
format
;
if
(
pDesc
->
Type
!=
NULL
)
*
(
pDesc
->
Type
)
=
This
->
resource
.
resourceType
;
if
(
pDesc
->
Usage
!=
NULL
)
*
(
pDesc
->
Usage
)
=
This
->
resource
.
usage
;
if
(
pDesc
->
Pool
!=
NULL
)
*
(
pDesc
->
Pool
)
=
This
->
resource
.
pool
;
if
(
pDesc
->
Size
!=
NULL
)
*
(
pDesc
->
Size
)
=
This
->
resource
.
size
;
/* dx8 only */
if
(
pDesc
->
MultiSampleType
!=
NULL
)
*
(
pDesc
->
MultiSampleType
)
=
This
->
currentDesc
.
MultiSampleType
;
if
(
pDesc
->
MultiSampleQuality
!=
NULL
)
*
(
pDesc
->
MultiSampleQuality
)
=
This
->
currentDesc
.
MultiSampleQuality
;
if
(
pDesc
->
Width
!=
NULL
)
*
(
pDesc
->
Width
)
=
This
->
currentDesc
.
Width
;
if
(
pDesc
->
Height
!=
NULL
)
*
(
pDesc
->
Height
)
=
This
->
currentDesc
.
Height
;
return
WINED3D_OK
;
}
void
WINAPI
IWineD3DSurfaceImpl_SetGlTextureDesc
(
IWineD3DSurface
*
iface
,
UINT
textureName
,
int
target
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
TRACE
(
"(%p) : setting textureName %u, target %i
\n
"
,
This
,
textureName
,
target
);
...
...
@@ -3552,52 +3511,6 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Blt(IWineD3DSurface *iface, RECT *Dest
return
IWineGDISurfaceImpl_Blt
(
iface
,
DestRect
,
SrcSurface
,
SrcRect
,
Flags
,
DDBltFx
,
Filter
);
}
HRESULT
WINAPI
IWineD3DSurfaceImpl_GetBltStatus
(
IWineD3DSurface
*
iface
,
DWORD
Flags
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
TRACE
(
"(%p)->(%x)
\n
"
,
This
,
Flags
);
switch
(
Flags
)
{
case
WINEDDGBS_CANBLT
:
case
WINEDDGBS_ISBLTDONE
:
return
WINED3D_OK
;
default:
return
WINED3DERR_INVALIDCALL
;
}
}
HRESULT
WINAPI
IWineD3DSurfaceImpl_GetFlipStatus
(
IWineD3DSurface
*
iface
,
DWORD
Flags
)
{
/* XXX: DDERR_INVALIDSURFACETYPE */
TRACE
(
"(%p)->(%08x)
\n
"
,
iface
,
Flags
);
switch
(
Flags
)
{
case
WINEDDGFS_CANFLIP
:
case
WINEDDGFS_ISFLIPDONE
:
return
WINED3D_OK
;
default:
return
WINED3DERR_INVALIDCALL
;
}
}
HRESULT
WINAPI
IWineD3DSurfaceImpl_IsLost
(
IWineD3DSurface
*
iface
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
This
);
/* D3D8 and 9 loose full devices, ddraw only surfaces */
return
This
->
Flags
&
SFLAG_LOST
?
WINED3DERR_DEVICELOST
:
WINED3D_OK
;
}
HRESULT
WINAPI
IWineD3DSurfaceImpl_Restore
(
IWineD3DSurface
*
iface
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
This
);
/* So far we don't lose anything :) */
This
->
Flags
&=
~
SFLAG_LOST
;
return
WINED3D_OK
;
}
HRESULT
WINAPI
IWineD3DSurfaceImpl_BltFast
(
IWineD3DSurface
*
iface
,
DWORD
dstx
,
DWORD
dsty
,
IWineD3DSurface
*
Source
,
RECT
*
rsrc
,
DWORD
trans
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
IWineD3DSurfaceImpl
*
srcImpl
=
(
IWineD3DSurfaceImpl
*
)
Source
;
...
...
@@ -3983,18 +3896,18 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl =
IWineD3DSurfaceImpl_PreLoad
,
IWineD3DBaseSurfaceImpl_GetType
,
/* IWineD3DSurface */
IWineD3DSurfaceImpl_GetContainer
,
IWineD3DSurfaceImpl_GetDesc
,
IWineD3D
Base
SurfaceImpl_GetContainer
,
IWineD3D
Base
SurfaceImpl_GetDesc
,
IWineD3DSurfaceImpl_LockRect
,
IWineD3DSurfaceImpl_UnlockRect
,
IWineD3DSurfaceImpl_GetDC
,
IWineD3DSurfaceImpl_ReleaseDC
,
IWineD3DSurfaceImpl_Flip
,
IWineD3DSurfaceImpl_Blt
,
IWineD3DSurfaceImpl_GetBltStatus
,
IWineD3DSurfaceImpl_GetFlipStatus
,
IWineD3DSurfaceImpl_IsLost
,
IWineD3DSurfaceImpl_Restore
,
IWineD3D
Base
SurfaceImpl_GetBltStatus
,
IWineD3D
Base
SurfaceImpl_GetFlipStatus
,
IWineD3D
Base
SurfaceImpl_IsLost
,
IWineD3D
Base
SurfaceImpl_Restore
,
IWineD3DSurfaceImpl_BltFast
,
IWineD3DSurfaceImpl_GetPalette
,
IWineD3DSurfaceImpl_SetPalette
,
...
...
dlls/wined3d/surface_base.c
View file @
d99143c2
...
...
@@ -7,7 +7,7 @@
* Copyright 2002-2003 Raphael Junqueira
* Copyright 2004 Christian Costa
* Copyright 2005 Oliver Stieber
* Copyright 2006 Stefan Dsinger for CodeWeavers
* Copyright 2006
-2007
Stefan Dsinger for CodeWeavers
* Copyright 2007 Henri Verbeet
* Copyright 2006-2007 Roderick Colenbrander
*
...
...
@@ -98,3 +98,94 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetParent(IWineD3DSurface *iface, IUnknow
TRACE
(
"(%p) : calling resourceimpl_GetParent
\n
"
,
iface
);
return
IWineD3DResourceImpl_GetParent
((
IWineD3DResource
*
)
iface
,
pParent
);
}
/* ******************************************************
IWineD3DSurface IWineD3DSurface parts follow
****************************************************** */
HRESULT
WINAPI
IWineD3DBaseSurfaceImpl_GetContainer
(
IWineD3DSurface
*
iface
,
REFIID
riid
,
void
**
ppContainer
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
IWineD3DBase
*
container
=
0
;
TRACE
(
"(This %p, riid %s, ppContainer %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppContainer
);
if
(
!
ppContainer
)
{
ERR
(
"Called without a valid ppContainer.
\n
"
);
}
/** From MSDN:
* If the surface is created using CreateImageSurface/CreateOffscreenPlainSurface, CreateRenderTarget,
* or CreateDepthStencilSurface, the surface is considered stand alone. In this case,
* GetContainer will return the Direct3D device used to create the surface.
*/
if
(
This
->
container
)
{
container
=
This
->
container
;
}
else
{
container
=
(
IWineD3DBase
*
)
This
->
resource
.
wineD3DDevice
;
}
TRACE
(
"Relaying to QueryInterface
\n
"
);
return
IUnknown_QueryInterface
(
container
,
riid
,
ppContainer
);
}
HRESULT
WINAPI
IWineD3DBaseSurfaceImpl_GetDesc
(
IWineD3DSurface
*
iface
,
WINED3DSURFACE_DESC
*
pDesc
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
TRACE
(
"(%p) : copying into %p
\n
"
,
This
,
pDesc
);
if
(
pDesc
->
Format
!=
NULL
)
*
(
pDesc
->
Format
)
=
This
->
resource
.
format
;
if
(
pDesc
->
Type
!=
NULL
)
*
(
pDesc
->
Type
)
=
This
->
resource
.
resourceType
;
if
(
pDesc
->
Usage
!=
NULL
)
*
(
pDesc
->
Usage
)
=
This
->
resource
.
usage
;
if
(
pDesc
->
Pool
!=
NULL
)
*
(
pDesc
->
Pool
)
=
This
->
resource
.
pool
;
if
(
pDesc
->
Size
!=
NULL
)
*
(
pDesc
->
Size
)
=
This
->
resource
.
size
;
/* dx8 only */
if
(
pDesc
->
MultiSampleType
!=
NULL
)
*
(
pDesc
->
MultiSampleType
)
=
This
->
currentDesc
.
MultiSampleType
;
if
(
pDesc
->
MultiSampleQuality
!=
NULL
)
*
(
pDesc
->
MultiSampleQuality
)
=
This
->
currentDesc
.
MultiSampleQuality
;
if
(
pDesc
->
Width
!=
NULL
)
*
(
pDesc
->
Width
)
=
This
->
currentDesc
.
Width
;
if
(
pDesc
->
Height
!=
NULL
)
*
(
pDesc
->
Height
)
=
This
->
currentDesc
.
Height
;
return
WINED3D_OK
;
}
HRESULT
WINAPI
IWineD3DBaseSurfaceImpl_GetBltStatus
(
IWineD3DSurface
*
iface
,
DWORD
Flags
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
TRACE
(
"(%p)->(%x)
\n
"
,
This
,
Flags
);
switch
(
Flags
)
{
case
WINEDDGBS_CANBLT
:
case
WINEDDGBS_ISBLTDONE
:
return
WINED3D_OK
;
default:
return
WINED3DERR_INVALIDCALL
;
}
}
HRESULT
WINAPI
IWineD3DBaseSurfaceImpl_GetFlipStatus
(
IWineD3DSurface
*
iface
,
DWORD
Flags
)
{
/* XXX: DDERR_INVALIDSURFACETYPE */
TRACE
(
"(%p)->(%08x)
\n
"
,
iface
,
Flags
);
switch
(
Flags
)
{
case
WINEDDGFS_CANFLIP
:
case
WINEDDGFS_ISFLIPDONE
:
return
WINED3D_OK
;
default:
return
WINED3DERR_INVALIDCALL
;
}
}
HRESULT
WINAPI
IWineD3DBaseSurfaceImpl_IsLost
(
IWineD3DSurface
*
iface
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
This
);
/* D3D8 and 9 loose full devices, ddraw only surfaces */
return
This
->
Flags
&
SFLAG_LOST
?
WINED3DERR_DEVICELOST
:
WINED3D_OK
;
}
HRESULT
WINAPI
IWineD3DBaseSurfaceImpl_Restore
(
IWineD3DSurface
*
iface
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
This
);
/* So far we don't lose anything :) */
This
->
Flags
&=
~
SFLAG_LOST
;
return
WINED3D_OK
;
}
dlls/wined3d/surface_gdi.c
View file @
d99143c2
...
...
@@ -1567,18 +1567,18 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl =
IWineGDISurfaceImpl_PreLoad
,
IWineD3DBaseSurfaceImpl_GetType
,
/* IWineD3DSurface */
IWineD3DSurfaceImpl_GetContainer
,
IWineD3DSurfaceImpl_GetDesc
,
IWineD3D
Base
SurfaceImpl_GetContainer
,
IWineD3D
Base
SurfaceImpl_GetDesc
,
IWineGDISurfaceImpl_LockRect
,
IWineGDISurfaceImpl_UnlockRect
,
IWineD3DSurfaceImpl_GetDC
,
IWineD3DSurfaceImpl_ReleaseDC
,
IWineGDISurfaceImpl_Flip
,
IWineGDISurfaceImpl_Blt
,
IWineD3DSurfaceImpl_GetBltStatus
,
IWineD3DSurfaceImpl_GetFlipStatus
,
IWineD3DSurfaceImpl_IsLost
,
IWineD3DSurfaceImpl_Restore
,
IWineD3D
Base
SurfaceImpl_GetBltStatus
,
IWineD3D
Base
SurfaceImpl_GetFlipStatus
,
IWineD3D
Base
SurfaceImpl_IsLost
,
IWineD3D
Base
SurfaceImpl_Restore
,
IWineGDISurfaceImpl_BltFast
,
IWineD3DSurfaceImpl_GetPalette
,
IWineD3DSurfaceImpl_SetPalette
,
...
...
dlls/wined3d/wined3d_private.h
View file @
d99143c2
...
...
@@ -1152,12 +1152,12 @@ DWORD WINAPI IWineD3DBaseSurfaceImpl_SetPriority(IWineD3DSurface *iface, DWORD
DWORD
WINAPI
IWineD3DBaseSurfaceImpl_GetPriority
(
IWineD3DSurface
*
iface
);
void
WINAPI
IWineD3DSurfaceImpl_PreLoad
(
IWineD3DSurface
*
iface
);
WINED3DRESOURCETYPE
WINAPI
IWineD3DBaseSurfaceImpl_GetType
(
IWineD3DSurface
*
iface
);
HRESULT
WINAPI
IWineD3DSurfaceImpl_GetContainer
(
IWineD3DSurface
*
iface
,
REFIID
riid
,
void
**
ppContainer
);
HRESULT
WINAPI
IWineD3DSurfaceImpl_GetDesc
(
IWineD3DSurface
*
iface
,
WINED3DSURFACE_DESC
*
pDesc
);
HRESULT
WINAPI
IWineD3DSurfaceImpl_GetBltStatus
(
IWineD3DSurface
*
iface
,
DWORD
Flags
);
HRESULT
WINAPI
IWineD3DSurfaceImpl_GetFlipStatus
(
IWineD3DSurface
*
iface
,
DWORD
Flags
);
HRESULT
WINAPI
IWineD3DSurfaceImpl_IsLost
(
IWineD3DSurface
*
iface
);
HRESULT
WINAPI
IWineD3DSurfaceImpl_Restore
(
IWineD3DSurface
*
iface
);
HRESULT
WINAPI
IWineD3D
Base
SurfaceImpl_GetContainer
(
IWineD3DSurface
*
iface
,
REFIID
riid
,
void
**
ppContainer
);
HRESULT
WINAPI
IWineD3D
Base
SurfaceImpl_GetDesc
(
IWineD3DSurface
*
iface
,
WINED3DSURFACE_DESC
*
pDesc
);
HRESULT
WINAPI
IWineD3D
Base
SurfaceImpl_GetBltStatus
(
IWineD3DSurface
*
iface
,
DWORD
Flags
);
HRESULT
WINAPI
IWineD3D
Base
SurfaceImpl_GetFlipStatus
(
IWineD3DSurface
*
iface
,
DWORD
Flags
);
HRESULT
WINAPI
IWineD3D
Base
SurfaceImpl_IsLost
(
IWineD3DSurface
*
iface
);
HRESULT
WINAPI
IWineD3D
Base
SurfaceImpl_Restore
(
IWineD3DSurface
*
iface
);
HRESULT
WINAPI
IWineD3DSurfaceImpl_SetPixelFormat
(
IWineD3DSurface
*
iface
,
WINED3DFORMAT
Format
,
BYTE
*
Surface
,
DWORD
Size
);
HRESULT
WINAPI
IWineD3DSurfaceImpl_GetPalette
(
IWineD3DSurface
*
iface
,
IWineD3DPalette
**
Pal
);
HRESULT
WINAPI
IWineD3DSurfaceImpl_SetPalette
(
IWineD3DSurface
*
iface
,
IWineD3DPalette
*
Pal
);
...
...
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