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
0b7fef75
Commit
0b7fef75
authored
Jan 20, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Remove IWineD3DSurface::LoadTexture() from the public interface.
parent
629d81b1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
79 deletions
+57
-79
cubetexture.c
dlls/wined3d/cubetexture.c
+1
-1
surface.c
dlls/wined3d/surface.c
+54
-57
surface_gdi.c
dlls/wined3d/surface_gdi.c
+0
-17
texture.c
dlls/wined3d/texture.c
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
wined3d.idl
include/wine/wined3d.idl
+0
-3
No files found.
dlls/wined3d/cubetexture.c
View file @
0b7fef75
...
...
@@ -122,7 +122,7 @@ static void cubetexture_preload(IWineD3DBaseTextureImpl *texture, enum WINED3DSR
{
for
(
i
=
0
;
i
<
sub_count
;
++
i
)
{
IWineD3DSurface_LoadTexture
((
IWineD3DSurface
*
)
texture
->
baseTexture
.
sub_resources
[
i
],
srgb_mode
);
surface_load
((
IWineD3DSurfaceImpl
*
)
texture
->
baseTexture
.
sub_resources
[
i
],
srgb_mode
);
}
}
else
...
...
dlls/wined3d/surface.c
View file @
0b7fef75
...
...
@@ -1087,6 +1087,59 @@ static BOOL surface_convert_color_to_float(IWineD3DSurfaceImpl *surface, DWORD c
return
TRUE
;
}
HRESULT
surface_load
(
IWineD3DSurfaceImpl
*
surface
,
BOOL
srgb
)
{
DWORD
flag
=
srgb
?
SFLAG_INSRGBTEX
:
SFLAG_INTEXTURE
;
TRACE
(
"surface %p, srgb %#x.
\n
"
,
surface
,
srgb
);
if
(
surface
->
resource
.
pool
==
WINED3DPOOL_SCRATCH
)
{
ERR
(
"Not supported on scratch surfaces.
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
if
(
!
(
surface
->
flags
&
flag
))
{
TRACE
(
"Reloading because surface is dirty
\n
"
);
}
/* Reload if either the texture and sysmem have different ideas about the
* color key, or the actual key values changed. */
else
if
(
!
(
surface
->
flags
&
SFLAG_GLCKEY
)
!=
!
(
surface
->
CKeyFlags
&
WINEDDSD_CKSRCBLT
)
||
((
surface
->
CKeyFlags
&
WINEDDSD_CKSRCBLT
)
&&
(
surface
->
glCKey
.
dwColorSpaceLowValue
!=
surface
->
SrcBltCKey
.
dwColorSpaceLowValue
||
surface
->
glCKey
.
dwColorSpaceHighValue
!=
surface
->
SrcBltCKey
.
dwColorSpaceHighValue
)))
{
TRACE
(
"Reloading because of color keying
\n
"
);
/* To perform the color key conversion we need a sysmem copy of
* the surface. Make sure we have it. */
surface_load_location
(
surface
,
SFLAG_INSYSMEM
,
NULL
);
/* Make sure the texture is reloaded because of the color key change,
* this kills performance though :( */
/* TODO: This is not necessarily needed with hw palettized texture support. */
surface_modify_location
(
surface
,
SFLAG_INSYSMEM
,
TRUE
);
}
else
{
TRACE
(
"surface is already in texture
\n
"
);
return
WINED3D_OK
;
}
/* No partial locking for textures yet. */
surface_load_location
(
surface
,
flag
,
NULL
);
if
(
!
(
surface
->
flags
&
SFLAG_DONOTFREE
))
{
HeapFree
(
GetProcessHeap
(),
0
,
surface
->
resource
.
heapMemory
);
surface
->
resource
.
allocatedMemory
=
NULL
;
surface
->
resource
.
heapMemory
=
NULL
;
surface_modify_location
(
surface
,
SFLAG_INSYSMEM
,
FALSE
);
}
return
WINED3D_OK
;
}
/* Do not call while under the GL lock. */
static
ULONG
WINAPI
IWineD3DSurfaceImpl_Release
(
IWineD3DSurface
*
iface
)
{
...
...
@@ -1145,7 +1198,7 @@ void surface_internal_preload(IWineD3DSurfaceImpl *surface, enum WINED3DSRGB srg
}
}
IWineD3DSurface_LoadTexture
((
IWineD3DSurface
*
)
surface
,
srgb
==
SRGB_SRGB
?
TRUE
:
FALSE
);
surface_load
(
surface
,
srgb
==
SRGB_SRGB
?
TRUE
:
FALSE
);
if
(
surface
->
resource
.
pool
==
WINED3DPOOL_DEFAULT
)
{
...
...
@@ -2489,61 +2542,6 @@ BOOL palette9_changed(IWineD3DSurfaceImpl *This)
return
TRUE
;
}
static
HRESULT
WINAPI
IWineD3DSurfaceImpl_LoadTexture
(
IWineD3DSurface
*
iface
,
BOOL
srgb_mode
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
DWORD
flag
=
srgb_mode
?
SFLAG_INSRGBTEX
:
SFLAG_INTEXTURE
;
TRACE
(
"iface %p, srgb %#x.
\n
"
,
iface
,
srgb_mode
);
if
(
!
(
This
->
flags
&
flag
))
{
TRACE
(
"Reloading because surface is dirty
\n
"
);
}
/* Reload if either the texture and sysmem have different ideas about the
* color key, or the actual key values changed. */
else
if
(
!
(
This
->
flags
&
SFLAG_GLCKEY
)
!=
!
(
This
->
CKeyFlags
&
WINEDDSD_CKSRCBLT
)
||
((
This
->
CKeyFlags
&
WINEDDSD_CKSRCBLT
)
&&
(
This
->
glCKey
.
dwColorSpaceLowValue
!=
This
->
SrcBltCKey
.
dwColorSpaceLowValue
||
This
->
glCKey
.
dwColorSpaceHighValue
!=
This
->
SrcBltCKey
.
dwColorSpaceHighValue
)))
{
TRACE
(
"Reloading because of color keying
\n
"
);
/* To perform the color key conversion we need a sysmem copy of
* the surface. Make sure we have it
*/
surface_load_location
(
This
,
SFLAG_INSYSMEM
,
NULL
);
/* Make sure the texture is reloaded because of the color key change, this kills performance though :( */
/* TODO: This is not necessarily needed with hw palettized texture support */
surface_modify_location
(
This
,
SFLAG_INSYSMEM
,
TRUE
);
}
else
{
TRACE
(
"surface is already in texture
\n
"
);
return
WINED3D_OK
;
}
/* Resources are placed in system RAM and do not need to be recreated when a device is lost.
* These resources are not bound by device size or format restrictions. Because of this,
* these resources cannot be accessed by the Direct3D device nor set as textures or render targets.
* However, these resources can always be created, locked, and copied.
*/
if
(
This
->
resource
.
pool
==
WINED3DPOOL_SCRATCH
)
{
FIXME
(
"(%p) Operation not supported for scratch textures
\n
"
,
This
);
return
WINED3DERR_INVALIDCALL
;
}
surface_load_location
(
This
,
flag
,
NULL
/* no partial locking for textures yet */
);
if
(
!
(
This
->
flags
&
SFLAG_DONOTFREE
))
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
resource
.
heapMemory
);
This
->
resource
.
allocatedMemory
=
NULL
;
This
->
resource
.
heapMemory
=
NULL
;
surface_modify_location
(
This
,
SFLAG_INSYSMEM
,
FALSE
);
}
return
WINED3D_OK
;
}
static
HRESULT
WINAPI
IWineD3DSurfaceImpl_SetFormat
(
IWineD3DSurface
*
iface
,
enum
wined3d_format_id
format
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
...
...
@@ -4714,7 +4712,6 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl =
IWineD3DBaseSurfaceImpl_SetClipper
,
IWineD3DBaseSurfaceImpl_GetClipper
,
/* Internal use: */
IWineD3DSurfaceImpl_LoadTexture
,
IWineD3DBaseSurfaceImpl_GetData
,
IWineD3DSurfaceImpl_SetFormat
,
IWineD3DSurfaceImpl_PrivateSetup
,
...
...
dlls/wined3d/surface_gdi.c
View file @
0b7fef75
...
...
@@ -193,22 +193,6 @@ static HRESULT WINAPI IWineGDISurfaceImpl_Flip(IWineD3DSurface *iface, IWineD3DS
return
hr
;
}
/*****************************************************************************
* IWineD3DSurface::LoadTexture, GDI version
*
* This is mutually unsupported by GDI surfaces
*
* Returns:
* D3DERR_INVALIDCALL
*
*****************************************************************************/
static
HRESULT
WINAPI
IWineGDISurfaceImpl_LoadTexture
(
IWineD3DSurface
*
iface
,
BOOL
srgb_mode
)
{
ERR
(
"Unsupported on X11 surfaces
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
static
HRESULT
WINAPI
IWineGDISurfaceImpl_GetDC
(
IWineD3DSurface
*
iface
,
HDC
*
pHDC
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
WINED3DLOCKED_RECT
lock
;
...
...
@@ -496,7 +480,6 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl =
IWineD3DBaseSurfaceImpl_SetClipper
,
IWineD3DBaseSurfaceImpl_GetClipper
,
/* Internal use: */
IWineGDISurfaceImpl_LoadTexture
,
IWineD3DBaseSurfaceImpl_GetData
,
IWineD3DBaseSurfaceImpl_SetFormat
,
IWineGDISurfaceImpl_PrivateSetup
,
...
...
dlls/wined3d/texture.c
View file @
0b7fef75
...
...
@@ -146,7 +146,7 @@ static void texture_preload(IWineD3DBaseTextureImpl *texture, enum WINED3DSRGB s
{
for
(
i
=
0
;
i
<
texture
->
baseTexture
.
level_count
;
++
i
)
{
IWineD3DSurface_LoadTexture
((
IWineD3DSurface
*
)
texture
->
baseTexture
.
sub_resources
[
i
],
srgb_mode
);
surface_load
((
IWineD3DSurfaceImpl
*
)
texture
->
baseTexture
.
sub_resources
[
i
],
srgb_mode
);
}
}
else
...
...
dlls/wined3d/wined3d_private.h
View file @
0b7fef75
...
...
@@ -2165,6 +2165,7 @@ HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type,
BOOL
surface_init_sysmem
(
IWineD3DSurfaceImpl
*
surface
)
DECLSPEC_HIDDEN
;
void
surface_internal_preload
(
IWineD3DSurfaceImpl
*
surface
,
enum
WINED3DSRGB
srgb
)
DECLSPEC_HIDDEN
;
BOOL
surface_is_offscreen
(
IWineD3DSurfaceImpl
*
iface
)
DECLSPEC_HIDDEN
;
HRESULT
surface_load
(
IWineD3DSurfaceImpl
*
surface
,
BOOL
srgb
)
DECLSPEC_HIDDEN
;
void
surface_load_ds_location
(
IWineD3DSurfaceImpl
*
surface
,
struct
wined3d_context
*
context
,
DWORD
location
)
DECLSPEC_HIDDEN
;
HRESULT
surface_load_location
(
IWineD3DSurfaceImpl
*
surface
,
DWORD
flag
,
const
RECT
*
rect
)
DECLSPEC_HIDDEN
;
...
...
include/wine/wined3d.idl
View file @
0b7fef75
...
...
@@ -2462,9 +2462,6 @@ interface IWineD3DSurface : IWineD3DResource
HRESULT
GetClipper
(
[
out
]
IWineD3DClipper
**
clipper
)
;
HRESULT
LoadTexture
(
[
in
]
BOOL
srgb_mode
)
;
const
void
*
GetData
(
)
;
HRESULT
SetFormat
(
...
...
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