forked from Mirrors/wine-wine
wined3d: Reduce indentation in the colour blit case in wined3d_surface_blt().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>oldstable
parent
cad4badbcf
commit
ce5b25b8bc
|
@ -3503,12 +3503,15 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
|
|||
struct wined3d_box src_box = {src_rect->left, src_rect->top, src_rect->right, src_rect->bottom, 0, 1};
|
||||
unsigned int dst_sub_resource_idx = surface_get_sub_resource_idx(dst_surface);
|
||||
unsigned int src_sub_resource_idx = surface_get_sub_resource_idx(src_surface);
|
||||
struct wined3d_texture_sub_resource *src_sub_resource, *dst_sub_resource;
|
||||
struct wined3d_texture *dst_texture = dst_surface->container;
|
||||
struct wined3d_texture *src_texture = src_surface->container;
|
||||
struct wined3d_device *device = dst_texture->resource.device;
|
||||
struct wined3d_swapchain *src_swapchain, *dst_swapchain;
|
||||
const struct wined3d_color_key *colour_key = NULL;
|
||||
DWORD src_ds_flags, dst_ds_flags;
|
||||
struct wined3d_context *context;
|
||||
enum wined3d_blit_op blit_op;
|
||||
BOOL scale, convert;
|
||||
DWORD dst_location;
|
||||
|
||||
|
@ -3625,15 +3628,10 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
|
|||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
struct wined3d_texture_sub_resource *src_sub_resource, *dst_sub_resource;
|
||||
enum wined3d_blit_op blit_op = WINED3D_BLIT_OP_COLOR_BLIT;
|
||||
const struct wined3d_color_key *colour_key = NULL;
|
||||
|
||||
TRACE("Colour blit.\n");
|
||||
|
||||
dst_sub_resource = surface_get_sub_resource(dst_surface);
|
||||
dst_sub_resource = &dst_texture->sub_resources[dst_sub_resource_idx];
|
||||
src_sub_resource = &src_texture->sub_resources[src_sub_resource_idx];
|
||||
|
||||
/* In principle this would apply to depth blits as well, but we don't
|
||||
|
@ -3649,6 +3647,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
|
|||
goto cpu;
|
||||
}
|
||||
|
||||
blit_op = WINED3D_BLIT_OP_COLOR_BLIT;
|
||||
if (flags & WINED3D_BLT_SRC_CKEY_OVERRIDE)
|
||||
{
|
||||
colour_key = &fx->src_color_key;
|
||||
|
@ -3679,8 +3678,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
|
|||
{
|
||||
if (!wined3d_resource_is_offscreen(&dst_texture->resource))
|
||||
{
|
||||
context = context_acquire(device,
|
||||
dst_texture, dst_sub_resource_idx);
|
||||
context = context_acquire(device, dst_texture, dst_sub_resource_idx);
|
||||
wined3d_texture_load_location(dst_texture, dst_sub_resource_idx,
|
||||
context, dst_texture->resource.draw_binding);
|
||||
context_release(context);
|
||||
|
@ -3693,18 +3691,18 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
|
|||
&& dst_texture == dst_swapchain->front_buffer
|
||||
&& src_texture == dst_swapchain->back_buffers[0])
|
||||
{
|
||||
/* Use present for back -> front blits. The idea behind this is
|
||||
* that present is potentially faster than a blit, in particular
|
||||
* when FBO blits aren't available. Some ddraw applications like
|
||||
* Half-Life and Prince of Persia 3D use Blt() from the backbuffer
|
||||
* to the frontbuffer instead of doing a Flip(). D3d8 and d3d9
|
||||
* applications can't blit directly to the frontbuffer. */
|
||||
/* Use present for back -> front blits. The idea behind this is that
|
||||
* present is potentially faster than a blit, in particular when FBO
|
||||
* blits aren't available. Some ddraw applications like Half-Life and
|
||||
* Prince of Persia 3D use Blt() from the backbuffer to the
|
||||
* frontbuffer instead of doing a Flip(). D3d8 and d3d9 applications
|
||||
* can't blit directly to the frontbuffer. */
|
||||
enum wined3d_swap_effect swap_effect = dst_swapchain->desc.swap_effect;
|
||||
|
||||
TRACE("Using present for backbuffer -> frontbuffer blit.\n");
|
||||
|
||||
/* Set the swap effect to COPY, we don't want the backbuffer to
|
||||
* become undefined. */
|
||||
/* Set the swap effect to COPY, we don't want the backbuffer to become
|
||||
* undefined. */
|
||||
dst_swapchain->desc.swap_effect = WINED3D_SWAP_EFFECT_COPY;
|
||||
wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, 0);
|
||||
dst_swapchain->desc.swap_effect = swap_effect;
|
||||
|
@ -3727,7 +3725,6 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
|
|||
wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~dst_location);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
fallback:
|
||||
/* Special cases for render targets. */
|
||||
|
|
Loading…
Reference in New Issue