Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
027fdb31
Commit
027fdb31
authored
Nov 12, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 12, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Rename the IWineD3DSurfaceImpl "Flags" field to "flags".
parent
a59ee29d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
50 deletions
+58
-50
device.c
dlls/wined3d/device.c
+14
-10
drawprim.c
dlls/wined3d/drawprim.c
+1
-1
surface.c
dlls/wined3d/surface.c
+0
-0
surface_base.c
dlls/wined3d/surface_base.c
+7
-7
surface_gdi.c
dlls/wined3d/surface_gdi.c
+27
-21
swapchain.c
dlls/wined3d/swapchain.c
+8
-9
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-2
No files found.
dlls/wined3d/device.c
View file @
027fdb31
...
...
@@ -609,7 +609,7 @@ static void prepare_ds_clear(IWineD3DSurfaceImpl *ds, struct wined3d_context *co
{
RECT
current_rect
,
r
;
if
(
ds
->
F
lags
&
location
)
if
(
ds
->
f
lags
&
location
)
SetRect
(
&
current_rect
,
0
,
0
,
ds
->
ds_current_size
.
cx
,
ds
->
ds_current_size
.
cy
);
...
...
@@ -5820,7 +5820,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice *
if
(
This
->
depth_stencil
)
{
if
(((
IWineD3DSwapChainImpl
*
)
This
->
swapchains
[
0
])
->
presentParms
.
Flags
&
WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
||
This
->
depth_stencil
->
F
lags
&
SFLAG_DISCARD
)
||
This
->
depth_stencil
->
f
lags
&
SFLAG_DISCARD
)
{
surface_modify_ds_location
(
This
->
depth_stencil
,
SFLAG_DS_DISCARDED
,
This
->
depth_stencil
->
currentDesc
.
Width
,
...
...
@@ -6078,7 +6078,8 @@ static HRESULT updateSurfaceDesc(IWineD3DSurfaceImpl *surface, const WINED3DPRES
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
/* Reallocate proper memory for the front and back buffer and adjust their sizes */
if
(
surface
->
Flags
&
SFLAG_DIBSECTION
)
{
if
(
surface
->
flags
&
SFLAG_DIBSECTION
)
{
/* Release the DC */
SelectObject
(
surface
->
hDC
,
surface
->
dib
.
holdbitmap
);
DeleteDC
(
surface
->
hDC
);
...
...
@@ -6086,7 +6087,7 @@ static HRESULT updateSurfaceDesc(IWineD3DSurfaceImpl *surface, const WINED3DPRES
DeleteObject
(
surface
->
dib
.
DIBsection
);
surface
->
dib
.
bitmap_data
=
NULL
;
surface
->
resource
.
allocatedMemory
=
NULL
;
surface
->
F
lags
&=
~
SFLAG_DIBSECTION
;
surface
->
f
lags
&=
~
SFLAG_DIBSECTION
;
}
surface
->
currentDesc
.
Width
=
pPresentationParameters
->
BackBufferWidth
;
surface
->
currentDesc
.
Height
=
pPresentationParameters
->
BackBufferHeight
;
...
...
@@ -6109,13 +6110,16 @@ static HRESULT updateSurfaceDesc(IWineD3DSurfaceImpl *surface, const WINED3DPRES
LEAVE_GL
();
context_release
(
context
);
surface
->
texture_name
=
0
;
surface
->
Flags
&=
~
SFLAG_CLIENT
;
surface
->
flags
&=
~
SFLAG_CLIENT
;
}
if
(
surface
->
pow2Width
!=
pPresentationParameters
->
BackBufferWidth
||
surface
->
pow2Height
!=
pPresentationParameters
->
BackBufferHeight
)
{
surface
->
flags
|=
SFLAG_NONPOW2
;
}
if
(
surface
->
pow2Width
!=
pPresentationParameters
->
BackBufferWidth
||
surface
->
pow2Height
!=
pPresentationParameters
->
BackBufferHeight
)
{
surface
->
Flags
|=
SFLAG_NONPOW2
;
}
else
{
surface
->
Flags
&=
~
SFLAG_NONPOW2
;
else
{
surface
->
flags
&=
~
SFLAG_NONPOW2
;
}
HeapFree
(
GetProcessHeap
(),
0
,
surface
->
resource
.
heapMemory
);
surface
->
resource
.
allocatedMemory
=
NULL
;
...
...
dlls/wined3d/drawprim.c
View file @
027fdb31
...
...
@@ -611,7 +611,7 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT StartIdx, UINT
if
(
location
==
SFLAG_DS_ONSCREEN
&&
This
->
depth_stencil
!=
This
->
onscreen_depth_stencil
)
device_switch_onscreen_ds
(
This
,
context
,
This
->
depth_stencil
);
if
(
This
->
depth_stencil
->
F
lags
&
location
)
if
(
This
->
depth_stencil
->
f
lags
&
location
)
SetRect
(
&
current_rect
,
0
,
0
,
This
->
depth_stencil
->
ds_current_size
.
cx
,
This
->
depth_stencil
->
ds_current_size
.
cy
);
...
...
dlls/wined3d/surface.c
View file @
027fdb31
This diff is collapsed.
Click to expand it.
dlls/wined3d/surface_base.c
View file @
027fdb31
...
...
@@ -197,7 +197,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_IsLost(IWineD3DSurface *iface) {
TRACE
(
"(%p)
\n
"
,
This
);
/* D3D8 and 9 loose full devices, ddraw only surfaces */
return
This
->
F
lags
&
SFLAG_LOST
?
WINED3DERR_DEVICELOST
:
WINED3D_OK
;
return
This
->
f
lags
&
SFLAG_LOST
?
WINED3DERR_DEVICELOST
:
WINED3D_OK
;
}
HRESULT
WINAPI
IWineD3DBaseSurfaceImpl_Restore
(
IWineD3DSurface
*
iface
)
{
...
...
@@ -205,7 +205,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Restore(IWineD3DSurface *iface) {
TRACE
(
"(%p)
\n
"
,
This
);
/* So far we don't lose anything :) */
This
->
F
lags
&=
~
SFLAG_LOST
;
This
->
f
lags
&=
~
SFLAG_LOST
;
return
WINED3D_OK
;
}
...
...
@@ -483,7 +483,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetFormat(IWineD3DSurface *iface, enum wi
This
->
resource
.
size
=
wined3d_format_calculate_size
(
format
,
This
->
resource
.
device
->
surface_alignment
,
This
->
pow2Width
,
This
->
pow2Height
);
This
->
F
lags
|=
(
WINED3DFMT_D16_LOCKABLE
==
format_id
)
?
SFLAG_LOCKABLE
:
0
;
This
->
f
lags
|=
(
WINED3DFMT_D16_LOCKABLE
==
format_id
)
?
SFLAG_LOCKABLE
:
0
;
This
->
resource
.
format
=
format
;
...
...
@@ -612,7 +612,7 @@ HRESULT IWineD3DBaseSurfaceImpl_CreateDIBSection(IWineD3DSurface *iface)
memcpy
(
This
->
dib
.
bitmap_data
,
This
->
resource
.
allocatedMemory
,
This
->
currentDesc
.
Height
*
IWineD3DSurface_GetPitch
(
iface
));
}
else
{
/* This is to make LockRect read the gl Texture although memory is allocated */
This
->
F
lags
&=
~
SFLAG_INSYSMEM
;
This
->
f
lags
&=
~
SFLAG_INSYSMEM
;
}
This
->
dib
.
bitmap_size
=
b_info
->
bmiHeader
.
biSizeImage
;
...
...
@@ -626,7 +626,7 @@ HRESULT IWineD3DBaseSurfaceImpl_CreateDIBSection(IWineD3DSurface *iface)
This
->
palette
?
This
->
palette
->
hpal
:
0
,
FALSE
);
This
->
F
lags
|=
SFLAG_DIBSECTION
;
This
->
f
lags
|=
SFLAG_DIBSECTION
;
HeapFree
(
GetProcessHeap
(),
0
,
This
->
resource
.
heapMemory
);
This
->
resource
.
heapMemory
=
NULL
;
...
...
@@ -941,7 +941,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT *D
iface
,
wine_dbgstr_rect
(
DestRect
),
src_surface
,
wine_dbgstr_rect
(
SrcRect
),
Flags
,
DDBltFx
,
debug_d3dtexturefiltertype
(
Filter
));
if
((
This
->
Flags
&
SFLAG_LOCKED
)
||
(
src
&&
(
src
->
F
lags
&
SFLAG_LOCKED
)))
if
((
This
->
flags
&
SFLAG_LOCKED
)
||
(
src
&&
(
src
->
f
lags
&
SFLAG_LOCKED
)))
{
WARN
(
" Surface is busy, returning DDERR_SURFACEBUSY
\n
"
);
return
WINEDDERR_SURFACEBUSY
;
...
...
@@ -1571,7 +1571,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dst
TRACE
(
"iface %p, dst_x %u, dst_y %u, src_surface %p, src_rect %s, flags %#x.
\n
"
,
iface
,
dstx
,
dsty
,
src_surface
,
wine_dbgstr_rect
(
rsrc
),
trans
);
if
((
This
->
Flags
&
SFLAG_LOCKED
)
||
(
src
->
F
lags
&
SFLAG_LOCKED
))
if
((
This
->
flags
&
SFLAG_LOCKED
)
||
(
src
->
f
lags
&
SFLAG_LOCKED
))
{
WARN
(
" Surface is busy, returning DDERR_SURFACEBUSY
\n
"
);
return
WINEDDERR_SURFACEBUSY
;
...
...
dlls/wined3d/surface_gdi.c
View file @
027fdb31
...
...
@@ -38,7 +38,7 @@ void surface_gdi_cleanup(IWineD3DSurfaceImpl *This)
{
TRACE
(
"(%p) : Cleaning up.
\n
"
,
This
);
if
(
This
->
F
lags
&
SFLAG_DIBSECTION
)
if
(
This
->
f
lags
&
SFLAG_DIBSECTION
)
{
/* Release the DC. */
SelectObject
(
This
->
hDC
,
This
->
dib
.
holdbitmap
);
...
...
@@ -49,7 +49,7 @@ void surface_gdi_cleanup(IWineD3DSurfaceImpl *This)
This
->
resource
.
allocatedMemory
=
NULL
;
}
if
(
This
->
F
lags
&
SFLAG_USERPTR
)
IWineD3DSurface_SetMem
((
IWineD3DSurface
*
)
This
,
NULL
);
if
(
This
->
f
lags
&
SFLAG_USERPTR
)
IWineD3DSurface_SetMem
((
IWineD3DSurface
*
)
This
,
NULL
);
if
(
This
->
overlay_dest
)
list_remove
(
&
This
->
overlay_entry
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
palette9
);
...
...
@@ -115,13 +115,13 @@ static HRESULT WINAPI IWineGDISurfaceImpl_Map(IWineD3DSurface *iface,
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
/* Already locked? */
if
(
This
->
F
lags
&
SFLAG_LOCKED
)
if
(
This
->
f
lags
&
SFLAG_LOCKED
)
{
WARN
(
"(%p) Surface already locked
\n
"
,
This
);
/* What should I return here? */
return
WINED3DERR_INVALIDCALL
;
}
This
->
F
lags
|=
SFLAG_LOCKED
;
This
->
f
lags
|=
SFLAG_LOCKED
;
if
(
!
This
->
resource
.
allocatedMemory
)
{
/* This happens on gdi surfaces if the application set a user pointer and resets it.
...
...
@@ -139,7 +139,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_Unmap(IWineD3DSurface *iface)
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
This
);
if
(
!
(
This
->
F
lags
&
SFLAG_LOCKED
))
if
(
!
(
This
->
f
lags
&
SFLAG_LOCKED
))
{
WARN
(
"Trying to unmap unmapped surfaces %p.
\n
"
,
iface
);
return
WINEDDERR_NOTLOCKED
;
...
...
@@ -155,7 +155,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_Unmap(IWineD3DSurface *iface)
}
}
This
->
F
lags
&=
~
SFLAG_LOCKED
;
This
->
f
lags
&=
~
SFLAG_LOCKED
;
memset
(
&
This
->
lockedRect
,
0
,
sizeof
(
RECT
));
return
WINED3D_OK
;
}
...
...
@@ -225,23 +225,24 @@ static HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pHDC
);
if
(
!
(
This
->
F
lags
&
SFLAG_DIBSECTION
))
if
(
!
(
This
->
f
lags
&
SFLAG_DIBSECTION
))
{
WARN
(
"DC not supported on this surface
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
if
(
This
->
Flags
&
SFLAG_USERPTR
)
{
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
->
F
lags
&
SFLAG_DCINUSE
)
if
(
This
->
f
lags
&
SFLAG_DCINUSE
)
return
WINEDDERR_DCALREADYCREATED
;
/* Can't GetDC if the surface is locked */
if
(
This
->
F
lags
&
SFLAG_LOCKED
)
if
(
This
->
f
lags
&
SFLAG_LOCKED
)
return
WINED3DERR_INVALIDCALL
;
memset
(
&
lock
,
0
,
sizeof
(
lock
));
/* To be sure */
...
...
@@ -287,7 +288,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
*
pHDC
=
This
->
hDC
;
TRACE
(
"returning %p
\n
"
,
*
pHDC
);
This
->
F
lags
|=
SFLAG_DCINUSE
;
This
->
f
lags
|=
SFLAG_DCINUSE
;
return
WINED3D_OK
;
}
...
...
@@ -297,7 +298,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
hDC
);
if
(
!
(
This
->
F
lags
&
SFLAG_DCINUSE
))
if
(
!
(
This
->
f
lags
&
SFLAG_DCINUSE
))
return
WINEDDERR_NODC
;
if
(
This
->
hDC
!=
hDC
)
{
...
...
@@ -308,7 +309,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC
/* we locked first, so unlock now */
IWineD3DSurface_Unmap
(
iface
);
This
->
F
lags
&=
~
SFLAG_DCINUSE
;
This
->
f
lags
&=
~
SFLAG_DCINUSE
;
return
WINED3D_OK
;
}
...
...
@@ -322,7 +323,8 @@ static HRESULT WINAPI IWineGDISurfaceImpl_RealizePalette(IWineD3DSurface *iface)
if
(
!
pal
)
return
WINED3D_OK
;
if
(
This
->
Flags
&
SFLAG_DIBSECTION
)
{
if
(
This
->
flags
&
SFLAG_DIBSECTION
)
{
TRACE
(
"(%p): Updating the hdc's palette
\n
"
,
This
);
for
(
n
=
0
;
n
<
256
;
n
++
)
{
col
[
n
].
rgbRed
=
pal
->
palents
[
n
].
peRed
;
...
...
@@ -404,7 +406,8 @@ static HRESULT WINAPI IWineGDISurfaceImpl_SetMem(IWineD3DSurface *iface, void *M
return
WINED3DERR_INVALIDCALL
;
}
if
(
This
->
Flags
&
(
SFLAG_LOCKED
|
SFLAG_DCINUSE
))
{
if
(
This
->
flags
&
(
SFLAG_LOCKED
|
SFLAG_DCINUSE
))
{
WARN
(
"Surface is locked or the HDC is in use
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
...
...
@@ -413,7 +416,8 @@ static HRESULT WINAPI IWineGDISurfaceImpl_SetMem(IWineD3DSurface *iface, void *M
void
*
release
=
NULL
;
/* Do I have to copy the old surface content? */
if
(
This
->
Flags
&
SFLAG_DIBSECTION
)
{
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.
...
...
@@ -425,21 +429,23 @@ static HRESULT WINAPI IWineGDISurfaceImpl_SetMem(IWineD3DSurface *iface, void *M
This
->
dib
.
bitmap_data
=
NULL
;
This
->
resource
.
allocatedMemory
=
NULL
;
This
->
hDC
=
NULL
;
This
->
Flags
&=
~
SFLAG_DIBSECTION
;
}
else
if
(
!
(
This
->
Flags
&
SFLAG_USERPTR
))
{
This
->
flags
&=
~
SFLAG_DIBSECTION
;
}
else
if
(
!
(
This
->
flags
&
SFLAG_USERPTR
))
{
release
=
This
->
resource
.
allocatedMemory
;
}
This
->
resource
.
allocatedMemory
=
Mem
;
This
->
F
lags
|=
SFLAG_USERPTR
|
SFLAG_INSYSMEM
;
This
->
f
lags
|=
SFLAG_USERPTR
|
SFLAG_INSYSMEM
;
/* Now free the old memory if any */
HeapFree
(
GetProcessHeap
(),
0
,
release
);
}
else
if
(
This
->
F
lags
&
SFLAG_USERPTR
)
else
if
(
This
->
f
lags
&
SFLAG_USERPTR
)
{
/* Map() and GetDC() will re-create the dib section and allocated memory. */
This
->
resource
.
allocatedMemory
=
NULL
;
This
->
F
lags
&=
~
SFLAG_USERPTR
;
This
->
f
lags
&=
~
SFLAG_USERPTR
;
}
return
WINED3D_OK
;
}
...
...
dlls/wined3d/swapchain.c
View file @
027fdb31
...
...
@@ -154,7 +154,7 @@ static void swapchain_blit(IWineD3DSwapChainImpl *This, struct wined3d_context *
context2
=
context_acquire
(
This
->
device
,
This
->
back_buffers
[
0
]);
context_apply_blit_state
(
context2
,
device
);
if
(
backbuffer
->
F
lags
&
SFLAG_NORMCOORD
)
if
(
backbuffer
->
f
lags
&
SFLAG_NORMCOORD
)
{
tex_left
/=
src_w
;
tex_right
/=
src_w
;
...
...
@@ -273,7 +273,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
cursor
.
pow2Width
=
cursor
.
currentDesc
.
Width
;
cursor
.
pow2Height
=
cursor
.
currentDesc
.
Height
;
/* The surface is in the texture */
cursor
.
F
lags
|=
SFLAG_INTEXTURE
;
cursor
.
f
lags
|=
SFLAG_INTEXTURE
;
/* DDBLT_KEYSRC will cause BltOverride to enable the alpha test with GL_NOTEQUAL, 0.0,
* which is exactly what we want :-)
*/
...
...
@@ -394,8 +394,8 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
WINED3DCLEAR_TARGET
,
0xff00ffff
,
1
.
0
f
,
0
);
}
if
(
!
This
->
render_to_fbo
&&
((
This
->
front_buffer
->
F
lags
&
SFLAG_INSYSMEM
)
||
(
This
->
back_buffers
[
0
]
->
F
lags
&
SFLAG_INSYSMEM
)))
if
(
!
This
->
render_to_fbo
&&
((
This
->
front_buffer
->
f
lags
&
SFLAG_INSYSMEM
)
||
(
This
->
back_buffers
[
0
]
->
f
lags
&
SFLAG_INSYSMEM
)))
{
/* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying
* Doesn't work with render_to_fbo because we're not flipping
...
...
@@ -409,11 +409,10 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
/* Tell the front buffer surface that is has been modified. However,
* the other locations were preserved during that, so keep the flags.
* This serves to update the emulated overlay, if any
*/
fbflags
=
front
->
Flags
;
* This serves to update the emulated overlay, if any. */
fbflags
=
front
->
flags
;
surface_modify_location
(
front
,
SFLAG_INDRAWABLE
,
TRUE
);
front
->
F
lags
=
fbflags
;
front
->
f
lags
=
fbflags
;
}
else
{
...
...
@@ -438,7 +437,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
if
(
This
->
device
->
depth_stencil
)
{
if
(
This
->
presentParms
.
Flags
&
WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
||
This
->
device
->
depth_stencil
->
F
lags
&
SFLAG_DISCARD
)
||
This
->
device
->
depth_stencil
->
f
lags
&
SFLAG_DISCARD
)
{
surface_modify_ds_location
(
This
->
device
->
depth_stencil
,
SFLAG_DS_DISCARDED
,
This
->
device
->
depth_stencil
->
currentDesc
.
Width
,
...
...
dlls/wined3d/wined3d_private.h
View file @
027fdb31
...
...
@@ -2106,8 +2106,7 @@ struct IWineD3DSurfaceImpl
IWineD3DPaletteImpl
*
palette
;
/* D3D7 style palette handling */
PALETTEENTRY
*
palette9
;
/* D3D8/9 style palette handling */
/* TODO: move this off into a management class(maybe!) */
DWORD
Flags
;
DWORD
flags
;
UINT
pow2Width
;
UINT
pow2Height
;
...
...
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