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
2d00f77f
Commit
2d00f77f
authored
Mar 21, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of wined3d_surface_ops.surface_private_setup().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bc357819
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
59 deletions
+9
-59
surface.c
dlls/wined3d/surface.c
+9
-53
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-6
No files found.
dlls/wined3d/surface.c
View file @
2d00f77f
...
...
@@ -1068,51 +1068,6 @@ static const struct wined3d_resource_ops surface_resource_ops =
surface_resource_sub_resource_unmap
,
};
static
const
struct
wined3d_surface_ops
surface_ops
=
{
surface_private_setup
,
};
/*****************************************************************************
* Initializes the GDI surface, aka creates the DIB section we render to
* The DIB section creation is done by calling GetDC, which will create the
* section and releasing the dc to allow the app to use it. The dib section
* will stay until the surface is released
*
* GDI surfaces do not need to be a power of 2 in size, so the pow2 sizes
* are set to the real sizes to save memory. The NONPOW2 flag is unset to
* avoid confusion in the shared surface code.
*
* Returns:
* WINED3D_OK on success
* The return values of called methods on failure
*
*****************************************************************************/
static
HRESULT
gdi_surface_private_setup
(
struct
wined3d_surface
*
surface
)
{
HRESULT
hr
;
TRACE
(
"surface %p.
\n
"
,
surface
);
/* Sysmem textures have memory already allocated - release it,
* this avoids an unnecessary memcpy. */
hr
=
surface_create_dib_section
(
surface
);
if
(
FAILED
(
hr
))
return
hr
;
surface
->
resource
.
map_binding
=
WINED3D_LOCATION_DIB
;
/* We don't mind the nonpow2 stuff in GDI. */
surface
->
pow2Width
=
surface
->
resource
.
width
;
surface
->
pow2Height
=
surface
->
resource
.
height
;
return
WINED3D_OK
;
}
static
const
struct
wined3d_surface_ops
gdi_surface_ops
=
{
gdi_surface_private_setup
,
};
/* This call just downloads data, the caller is responsible for binding the
* correct texture. */
/* Context activation is done by the caller. */
...
...
@@ -4673,11 +4628,6 @@ HRESULT wined3d_surface_init(struct wined3d_surface *surface, struct wined3d_tex
if
(
!
resource_size
)
return
WINED3DERR_INVALIDCALL
;
if
(
device
->
wined3d
->
flags
&
WINED3D_NO3D
)
surface
->
surface_ops
=
&
gdi_surface_ops
;
else
surface
->
surface_ops
=
&
surface_ops
;
if
(
FAILED
(
hr
=
resource_init
(
&
surface
->
resource
,
device
,
WINED3D_RTYPE_SURFACE
,
format
,
desc
->
multisample_type
,
multisample_quality
,
desc
->
usage
,
desc
->
pool
,
desc
->
width
,
desc
->
height
,
1
,
resource_size
,
NULL
,
&
wined3d_null_parent_ops
,
&
surface_resource_ops
)))
...
...
@@ -4702,7 +4652,7 @@ HRESULT wined3d_surface_init(struct wined3d_surface *surface, struct wined3d_tex
surface
->
texture_layer
=
layer
;
/* Call the private setup routine */
if
(
FAILED
(
hr
=
surface
->
surface_ops
->
surface
_private_setup
(
surface
)))
if
(
FAILED
(
hr
=
surface_private_setup
(
surface
)))
{
ERR
(
"Private setup failed, hr %#x.
\n
"
,
hr
);
wined3d_surface_cleanup
(
surface
);
...
...
@@ -4712,9 +4662,15 @@ HRESULT wined3d_surface_init(struct wined3d_surface *surface, struct wined3d_tex
/* Similar to lockable rendertargets above, creating the DIB section
* during surface initialization prevents the sysmem pointer from changing
* after a wined3d_texture_get_dc() call. */
if
((
desc
->
usage
&
WINED3DUSAGE_OWNDC
)
&&
!
surface
->
hDC
&&
SUCCEEDED
(
surface_create_dib_section
(
surface
)))
if
((
desc
->
usage
&
WINED3DUSAGE_OWNDC
)
||
(
device
->
wined3d
->
flags
&
WINED3D_NO3D
))
{
if
(
FAILED
(
hr
=
surface_create_dib_section
(
surface
)))
{
wined3d_surface_cleanup
(
surface
);
return
hr
;
}
surface
->
resource
.
map_binding
=
WINED3D_LOCATION_DIB
;
}
if
(
surface
->
resource
.
map_binding
==
WINED3D_LOCATION_DIB
)
{
...
...
dlls/wined3d/wined3d_private.h
View file @
2d00f77f
...
...
@@ -2548,15 +2548,9 @@ struct fbo_entry
}
key
;
};
struct
wined3d_surface_ops
{
HRESULT
(
*
surface_private_setup
)(
struct
wined3d_surface
*
surface
);
};
struct
wined3d_surface
{
struct
wined3d_resource
resource
;
const
struct
wined3d_surface_ops
*
surface_ops
;
struct
wined3d_texture
*
container
;
DWORD
locations
;
...
...
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