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
76a97127
Commit
76a97127
authored
Apr 08, 2010
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Apr 09, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add an initial implementation of arbfp_blit_surface.
parent
f1ca14cb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
1 deletion
+77
-1
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+55
-0
surface.c
dlls/wined3d/surface.c
+15
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+7
-0
No files found.
dlls/wined3d/arb_program_shader.c
View file @
76a97127
...
...
@@ -6895,6 +6895,61 @@ static BOOL arbfp_blit_supported(const struct wined3d_gl_info *gl_info, enum bli
}
}
HRESULT
arbfp_blit_surface
(
IWineD3DDeviceImpl
*
device
,
IWineD3DSurfaceImpl
*
src_surface
,
const
RECT
*
src_rect
,
IWineD3DSurfaceImpl
*
dst_surface
,
const
RECT
*
dst_rect_in
,
enum
blit_operation
blit_op
,
DWORD
Filter
)
{
struct
wined3d_context
*
context
;
IWineD3DSwapChainImpl
*
dst_swapchain
=
NULL
;
RECT
dst_rect
=
*
dst_rect_in
;
/* Now load the surface */
surface_internal_preload
((
IWineD3DSurface
*
)
src_surface
,
SRGB_RGB
);
/* Activate the destination context, set it up for blitting */
context
=
context_acquire
(
device
,
(
IWineD3DSurface
*
)
dst_surface
,
CTXUSAGE_BLIT
);
/* The coordinates of the ddraw front buffer are always fullscreen ('screen coordinates',
* while OpenGL coordinates are window relative.
* Also beware of the origin difference(top left vs bottom left).
* Also beware that the front buffer's surface size is screen width x screen height,
* whereas the real gl drawable size is the size of the window.
*/
IWineD3DSurface_GetContainer
((
IWineD3DSurface
*
)
dst_surface
,
&
IID_IWineD3DSwapChain
,
(
void
**
)
&
dst_swapchain
);
if
(
dst_swapchain
)
IWineD3DSwapChain_Release
((
IWineD3DSwapChain
*
)
dst_swapchain
);
if
(
dst_swapchain
&&
(
IWineD3DSurface
*
)
dst_surface
==
dst_swapchain
->
frontBuffer
)
{
RECT
windowsize
;
POINT
offset
=
{
0
,
0
};
UINT
h
;
ClientToScreen
(
context
->
win_handle
,
&
offset
);
GetClientRect
(
context
->
win_handle
,
&
windowsize
);
h
=
windowsize
.
bottom
-
windowsize
.
top
;
dst_rect
.
left
-=
offset
.
x
;
dst_rect
.
right
-=
offset
.
x
;
dst_rect
.
top
-=
offset
.
y
;
dst_rect
.
bottom
-=
offset
.
y
;
dst_rect
.
top
+=
dst_surface
->
currentDesc
.
Height
-
h
;
dst_rect
.
bottom
+=
dst_surface
->
currentDesc
.
Height
-
h
;
}
arbfp_blit_set
((
IWineD3DDevice
*
)
device
,
src_surface
);
ENTER_GL
();
/* Draw a textured quad */
draw_textured_quad
(
src_surface
,
src_rect
,
&
dst_rect
,
Filter
);
LEAVE_GL
();
/* Leave the opengl state valid for blitting */
arbfp_blit_unset
((
IWineD3DDevice
*
)
device
);
wglFlush
();
/* Flush to ensure ordering across contexts. */
context_release
(
context
);
IWineD3DSurface_ModifyLocation
((
IWineD3DSurface
*
)
dst_surface
,
SFLAG_INDRAWABLE
,
TRUE
);
return
WINED3D_OK
;
}
static
HRESULT
arbfp_blit_color_fill
(
IWineD3DDeviceImpl
*
device
,
IWineD3DSurfaceImpl
*
dst_surface
,
const
RECT
*
dst_rect
,
DWORD
fill_color
)
{
FIXME
(
"Color filling not implemented by arbfp_blit
\n
"
);
...
...
dlls/wined3d/surface.c
View file @
76a97127
...
...
@@ -287,7 +287,7 @@ static inline void surface_get_rect(IWineD3DSurfaceImpl *This, const RECT *rect_
}
/* GL locking and context activation is done by the caller */
static
void
draw_textured_quad
(
IWineD3DSurfaceImpl
*
src_surface
,
const
RECT
*
src_rect
,
const
RECT
*
dst_rect
,
WINED3DTEXTUREFILTERTYPE
Filter
)
void
draw_textured_quad
(
IWineD3DSurfaceImpl
*
src_surface
,
const
RECT
*
src_rect
,
const
RECT
*
dst_rect
,
WINED3DTEXTUREFILTERTYPE
Filter
)
{
IWineD3DBaseTextureImpl
*
texture
;
struct
blt_info
info
;
...
...
@@ -3859,6 +3859,20 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
return
WINED3D_OK
;
}
if
(
!
(
Flags
&
(
WINEDDBLT_KEYSRC
|
WINEDDBLT_KEYSRCOVERRIDE
))
&&
arbfp_blit
.
blit_supported
(
&
myDevice
->
adapter
->
gl_info
,
BLIT_OP_BLIT
,
&
src_rect
,
Src
->
resource
.
usage
,
Src
->
resource
.
pool
,
Src
->
resource
.
format_desc
,
&
dst_rect
,
This
->
resource
.
usage
,
This
->
resource
.
pool
,
This
->
resource
.
format_desc
))
{
HRESULT
hr
=
arbfp_blit_surface
(
myDevice
,
Src
,
&
src_rect
,
This
,
&
dst_rect
,
BLIT_OP_BLIT
,
Filter
);
/* Clear the palette as the surface didn't have a palette attached, it would confuse GetPalette and other calls */
if
(
paletteOverride
)
Src
->
palette
=
NULL
;
return
hr
;
}
/* Color keying: Check if we have to do a color keyed blt,
* and if not check if a color key is activated.
*
...
...
dlls/wined3d/wined3d_private.h
View file @
76a97127
...
...
@@ -1190,6 +1190,11 @@ extern const struct blit_shader ffp_blit DECLSPEC_HIDDEN;
extern
const
struct
blit_shader
arbfp_blit
DECLSPEC_HIDDEN
;
extern
const
struct
blit_shader
cpu_blit
DECLSPEC_HIDDEN
;
/* Temporary blit_shader helper functions */
HRESULT
arbfp_blit_surface
(
IWineD3DDeviceImpl
*
device
,
IWineD3DSurfaceImpl
*
src_surface
,
const
RECT
*
src_rect
,
IWineD3DSurfaceImpl
*
dst_surface
,
const
RECT
*
dst_rect_in
,
enum
blit_operation
blit_op
,
DWORD
Filter
)
DECLSPEC_HIDDEN
;
typedef
enum
ContextUsage
{
CTXUSAGE_RESOURCELOAD
=
1
,
/* Only loads textures: No State is applied */
CTXUSAGE_DRAWPRIM
=
2
,
/* OpenGL states are set up for blitting DirectDraw surfaces */
...
...
@@ -2160,6 +2165,8 @@ void get_drawable_size_swapchain(struct wined3d_context *context, UINT *width, U
void
get_drawable_size_backbuffer
(
struct
wined3d_context
*
context
,
UINT
*
width
,
UINT
*
height
)
DECLSPEC_HIDDEN
;
void
get_drawable_size_fbo
(
struct
wined3d_context
*
context
,
UINT
*
width
,
UINT
*
height
)
DECLSPEC_HIDDEN
;
void
draw_textured_quad
(
IWineD3DSurfaceImpl
*
src_surface
,
const
RECT
*
src_rect
,
const
RECT
*
dst_rect
,
WINED3DTEXTUREFILTERTYPE
Filter
)
DECLSPEC_HIDDEN
;
void
flip_surface
(
IWineD3DSurfaceImpl
*
front
,
IWineD3DSurfaceImpl
*
back
)
DECLSPEC_HIDDEN
;
/* Surface flags: */
...
...
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