(gfx drivers display) No more video_frame_info dependency

This commit is contained in:
twinaphex 2020-03-08 22:05:51 +01:00
parent 7a9684b6ea
commit c16568cf32
19 changed files with 118 additions and 121 deletions

View File

@ -1,6 +1,6 @@
//
// Created by Stuart Carnie on 6/24/18.
//
/*
* Created by Stuart Carnie on 6/24/18.
*/
#import <Foundation/Foundation.h>
@ -12,8 +12,8 @@
@property (nonatomic, readwrite) MTLClearColor clearColor;
- (instancetype)initWithContext:(Context *)context;
- (void)drawPipeline:(gfx_display_ctx_draw_t *)draw video:(video_frame_info_t *)video;
- (void)draw:(gfx_display_ctx_draw_t *)draw video:(video_frame_info_t *)video;
- (void)drawPipeline:(gfx_display_ctx_draw_t *)draw;
- (void)draw:(gfx_display_ctx_draw_t *)draw;
- (void)setScissorRect:(MTLScissorRect)rect;
- (void)clearScissorRect;

View File

@ -1,13 +1,13 @@
//
// Created by Stuart Carnie on 6/24/18.
//
/*
* Created by Stuart Carnie on 6/24/18.
*/
#import "Context.h"
#import "MenuDisplay.h"
#import "ShaderTypes.h"
#import "menu_driver.h"
#import <Metal/Metal.h>
// TODO(sgc): this dependency is incorrect
/* TODO(sgc): this dependency is incorrect */
#import "../metal_common.h"
@implementation MenuDisplay
@ -102,7 +102,7 @@
}
}
- (void)drawPipeline:(gfx_display_ctx_draw_t *)draw video:(video_frame_info_t *)video
- (void)drawPipeline:(gfx_display_ctx_draw_t *)draw
{
static struct video_coords blank_coords;
@ -117,7 +117,7 @@
switch (draw->pipeline.id)
{
// ribbon
/* ribbon */
default:
case VIDEO_SHADER_MENU:
case VIDEO_SHADER_MENU_2:
@ -142,7 +142,7 @@
_uniforms.time += 0.01;
}
- (void)draw:(gfx_display_ctx_draw_t *)draw video:(video_frame_info_t *)video
- (void)draw:(gfx_display_ctx_draw_t *)draw
{
const float *vertex = draw->coords->vertex ?: MenuDisplay.defaultVertices;
const float *tex_coord = draw->coords->tex_coord ?: MenuDisplay.defaultTexCoords;

View File

@ -37,12 +37,12 @@ static void gfx_display_ctr_viewport(gfx_display_ctx_draw_t *draw,
void *data) { }
static void gfx_display_ctr_draw(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data, unsigned video_width, unsigned video_height)
{
int colorR, colorG, colorB, colorA;
struct ctr_texture *texture = NULL;
const float *color = NULL;
ctr_video_t *ctr = (ctr_video_t*)video_info->userdata;
ctr_video_t *ctr = (ctr_video_t*)data;
if (!ctr || !draw)
return;
@ -135,9 +135,7 @@ static void gfx_display_ctr_draw(gfx_display_ctx_draw_t *draw,
}
static void gfx_display_ctr_draw_pipeline(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
{
}
void *data, unsigned video_width, unsigned video_height) { }
static void gfx_display_ctr_restore_clear_color(void)
{
@ -146,7 +144,7 @@ static void gfx_display_ctr_restore_clear_color(void)
#endif
}
static void gfx_display_ctr_clear_color(gfx_display_ctx_clearcolor_t *clearcolor, video_frame_info_t *video_info)
static void gfx_display_ctr_clear_color(gfx_display_ctx_clearcolor_t *clearcolor, void *data)
{
if (!clearcolor)
return;

View File

@ -60,10 +60,10 @@ static void gfx_display_d3d10_blend_end(void *data)
static void gfx_display_d3d10_viewport(gfx_display_ctx_draw_t *draw, void *data) { }
static void gfx_display_d3d10_draw(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data, unsigned video_width, unsigned video_height)
{
int vertex_count;
d3d10_video_t* d3d10 = (d3d10_video_t*)video_info->userdata;
d3d10_video_t* d3d10 = (d3d10_video_t*)data;
if (!d3d10 || !draw || !draw->texture)
return;
@ -182,9 +182,9 @@ static void gfx_display_d3d10_draw(gfx_display_ctx_draw_t *draw,
}
static void gfx_display_d3d10_draw_pipeline(gfx_display_ctx_draw_t* draw,
video_frame_info_t *video_info)
void *data, unsigned video_width, unsigned video_height)
{
d3d10_video_t* d3d10 = (d3d10_video_t*)video_info->userdata;
d3d10_video_t* d3d10 = (d3d10_video_t*)data;
if (!d3d10 || !draw)
return;
@ -240,10 +240,9 @@ static void gfx_display_d3d10_draw_pipeline(gfx_display_ctx_draw_t* draw,
static void gfx_display_d3d10_restore_clear_color(void) {}
static void gfx_display_d3d10_clear_color(
gfx_display_ctx_clearcolor_t* clearcolor,
video_frame_info_t *video_info)
gfx_display_ctx_clearcolor_t* clearcolor, void *data)
{
d3d10_video_t* d3d10 = (d3d10_video_t*)video_info->userdata;
d3d10_video_t* d3d10 = (d3d10_video_t*)data;
if (!d3d10 || !clearcolor)
return;

View File

@ -59,10 +59,10 @@ static void gfx_display_d3d11_blend_end(void *data)
static void gfx_display_d3d11_viewport(gfx_display_ctx_draw_t *draw, void *data) { }
static void gfx_display_d3d11_draw(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data, unsigned video_width, unsigned video_height)
{
int vertex_count;
d3d11_video_t *d3d11 = (d3d11_video_t*)video_info->userdata;
d3d11_video_t *d3d11 = (d3d11_video_t*)data;
if (!d3d11 || !draw || !draw->texture)
return;
@ -181,9 +181,9 @@ static void gfx_display_d3d11_draw(gfx_display_ctx_draw_t *draw,
}
static void gfx_display_d3d11_draw_pipeline(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data, unsigned video_width, unsigned video_height)
{
d3d11_video_t *d3d11 = (d3d11_video_t*)video_info->userdata;
d3d11_video_t *d3d11 = (d3d11_video_t*)data;
if (!d3d11 || !draw)
return;
@ -240,9 +240,9 @@ static void gfx_display_d3d11_restore_clear_color(void) {}
static void gfx_display_d3d11_clear_color(
gfx_display_ctx_clearcolor_t* clearcolor,
video_frame_info_t *video_info)
void *data)
{
d3d11_video_t *d3d11 = (d3d11_video_t*)video_info->userdata;
d3d11_video_t *d3d11 = (d3d11_video_t*)data;
if (!d3d11 || !clearcolor)
return;

View File

@ -61,10 +61,10 @@ static void gfx_display_d3d12_blend_end(void *data)
static void gfx_display_d3d12_viewport(gfx_display_ctx_draw_t *draw, void *data) { }
static void gfx_display_d3d12_draw(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data, unsigned video_width, unsigned video_height)
{
int vertex_count;
d3d12_video_t *d3d12 = (d3d12_video_t*)video_info->userdata;
d3d12_video_t *d3d12 = (d3d12_video_t*)data;
if (!d3d12 || !draw || !draw->texture)
return;
@ -198,9 +198,9 @@ static void gfx_display_d3d12_draw(gfx_display_ctx_draw_t *draw,
}
static void gfx_display_d3d12_draw_pipeline(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data, unsigned video_width, unsigned video_height)
{
d3d12_video_t *d3d12 = (d3d12_video_t*)video_info->userdata;
d3d12_video_t *d3d12 = (d3d12_video_t*)data;
if (!d3d12 || !draw)
return;
@ -261,9 +261,9 @@ static void gfx_display_d3d12_draw_pipeline(gfx_display_ctx_draw_t *draw,
static void gfx_display_d3d12_restore_clear_color(void) {}
static void gfx_display_d3d12_clear_color(
gfx_display_ctx_clearcolor_t* clearcolor, video_frame_info_t *video_info)
gfx_display_ctx_clearcolor_t* clearcolor, void *data)
{
d3d12_video_t *d3d12 = (d3d12_video_t*)video_info->userdata;
d3d12_video_t *d3d12 = (d3d12_video_t*)data;
if (!d3d12 || !clearcolor)
return;

View File

@ -113,13 +113,13 @@ static void gfx_display_d3d8_bind_texture(gfx_display_ctx_draw_t *draw,
}
static void gfx_display_d3d8_draw(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data,
unsigned video_width,
unsigned video_height)
{
unsigned i;
math_matrix_4x4 mop, m1, m2;
d3d8_video_t *d3d = (d3d8_video_t*)video_info->userdata;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
d3d8_video_t *d3d = (d3d8_video_t*)data;
Vertex * pv = NULL;
const float *vertex = NULL;
const float *tex_coord = NULL;
@ -221,20 +221,14 @@ static void gfx_display_d3d8_draw(gfx_display_ctx_draw_t *draw,
}
static void gfx_display_d3d8_draw_pipeline(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
{
}
static void gfx_display_d3d8_restore_clear_color(void)
{
/* not needed */
}
void *data, unsigned video_width, unsigned video_height) { }
static void gfx_display_d3d8_restore_clear_color(void) { }
static void gfx_display_d3d8_clear_color(
gfx_display_ctx_clearcolor_t *clearcolor, video_frame_info_t *video_info)
gfx_display_ctx_clearcolor_t *clearcolor, void *data)
{
DWORD clear_color = 0;
d3d8_video_t *d3d = (d3d8_video_t*)video_info->userdata;
d3d8_video_t *d3d = (d3d8_video_t*)data;
if (!d3d || !clearcolor)
return;

View File

@ -114,18 +114,16 @@ static void gfx_display_d3d9_bind_texture(gfx_display_ctx_draw_t *draw,
}
static void gfx_display_d3d9_draw(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data, unsigned video_width, unsigned video_height)
{
unsigned i;
math_matrix_4x4 mop, m1, m2;
LPDIRECT3DDEVICE9 dev;
d3d9_video_t *d3d = (d3d9_video_t*)video_info->userdata;
d3d9_video_t *d3d = (d3d9_video_t*)data;
Vertex * pv = NULL;
const float *vertex = NULL;
const float *tex_coord = NULL;
const float *color = NULL;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
if (!d3d || !draw || draw->pipeline.id)
return;
@ -216,7 +214,7 @@ static void gfx_display_d3d9_draw(gfx_display_ctx_draw_t *draw,
}
static void gfx_display_d3d9_draw_pipeline(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data, unsigned video_width, unsigned video_height)
{
#if defined(HAVE_HLSL) || defined(HAVE_CG)
static float t = 0;
@ -267,11 +265,11 @@ static void gfx_display_d3d9_restore_clear_color(void)
static void gfx_display_d3d9_clear_color(
gfx_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info)
void *data)
{
LPDIRECT3DDEVICE9 dev;
DWORD clear_color = 0;
d3d9_video_t *d3d = (d3d9_video_t*)video_info->userdata;
d3d9_video_t *d3d = (d3d9_video_t*)data;
if (!d3d || !clearcolor)
return;

View File

@ -37,11 +37,10 @@ static void gfx_display_gdi_blend_begin(void *data) { }
static void gfx_display_gdi_blend_end(void *data) { }
static void gfx_display_gdi_draw(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data, unsigned video_width, unsigned video_height)
{
struct gdi_texture *texture = NULL;
gdi_t *gdi = (gdi_t*)video_info->userdata;
unsigned video_height = video_info->height;
gdi_t *gdi = (gdi_t*)data;
BITMAPINFO info = {{0}};
if (!gdi || !draw || draw->x < 0 || draw->y < 0 || draw->width <= 1 || draw->height <= 1)
@ -108,15 +107,13 @@ static void gfx_display_gdi_draw(gfx_display_ctx_draw_t *draw,
}
static void gfx_display_gdi_draw_pipeline(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info) { }
void *data, unsigned video_width, unsigned video_height) { }
static void gfx_display_gdi_viewport(gfx_display_ctx_draw_t *draw, void *data) { }
static void gfx_display_gdi_restore_clear_color(void) { }
static void gfx_display_gdi_clear_color(
gfx_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info)
void *data)
{
(void)clearcolor;

View File

@ -218,11 +218,9 @@ gfx_display_gl_discard_draw_rectangle(gfx_display_ctx_draw_t *draw,
#endif
static void gfx_display_gl_draw(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data, unsigned video_width, unsigned video_height)
{
gl_t *gl = (gl_t*)video_info->userdata;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
gl_t *gl = (gl_t*)data;
if (!gl || !draw)
return;
@ -259,12 +257,15 @@ static void gfx_display_gl_draw(gfx_display_ctx_draw_t *draw,
gl->coords.color = gl->white_color_ptr;
}
static void gfx_display_gl_draw_pipeline(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
static void gfx_display_gl_draw_pipeline(
gfx_display_ctx_draw_t *draw,
void *data,
unsigned video_width,
unsigned video_height)
{
#ifdef HAVE_SHADERPIPELINE
struct uniform_info uniform_param;
gl_t *gl = (gl_t*)video_info->userdata;
gl_t *gl = (gl_t*)data;
static float t = 0;
video_coord_array_t *ca = gfx_display_get_coords_array();
@ -342,7 +343,7 @@ static void gfx_display_gl_restore_clear_color(void)
static void gfx_display_gl_clear_color(
gfx_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info)
void *data)
{
if (!clearcolor)
return;

View File

@ -100,10 +100,12 @@ static void gfx_display_gl1_viewport(gfx_display_ctx_draw_t *draw,
}
static void gfx_display_gl1_draw(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data,
unsigned video_width,
unsigned video_height)
{
video_shader_ctx_mvp_t mvp;
gl1_t *gl1 = (gl1_t*)video_info->userdata;
gl1_t *gl1 = (gl1_t*)data;
if (!gl1 || !draw)
return;
@ -177,7 +179,7 @@ static void gfx_display_gl1_restore_clear_color(void)
static void gfx_display_gl1_clear_color(
gfx_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info)
void *data)
{
if (!clearcolor)
return;

View File

@ -78,7 +78,9 @@ static void gfx_display_gl_core_viewport(gfx_display_ctx_draw_t *draw, void *dat
}
static void gfx_display_gl_core_draw_pipeline(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data,
unsigned video_width,
unsigned video_height)
{
#ifdef HAVE_SHADERPIPELINE
float output_size[2];
@ -87,9 +89,7 @@ static void gfx_display_gl_core_draw_pipeline(gfx_display_ctx_draw_t *draw,
static float t = 0.0f;
float yflip = 0.0f;
video_coord_array_t *ca = NULL;
gl_core_t *gl = (gl_core_t*)video_info->userdata;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
gl_core_t *gl = (gl_core_t*)data;
if (!gl || !draw)
return;
@ -152,13 +152,13 @@ static void gfx_display_gl_core_draw_pipeline(gfx_display_ctx_draw_t *draw,
}
static void gfx_display_gl_core_draw(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data, unsigned video_width, unsigned video_height)
{
const float *vertex = NULL;
const float *tex_coord = NULL;
const float *color = NULL;
GLuint texture = 0;
gl_core_t *gl = (gl_core_t*)video_info->userdata;
gl_core_t *gl = (gl_core_t*)data;
const struct
gl_core_buffer_locations *loc = NULL;
@ -292,7 +292,7 @@ static void gfx_display_gl_core_restore_clear_color(void)
static void gfx_display_gl_core_clear_color(
gfx_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info)
void *data)
{
if (!clearcolor)
return;

View File

@ -63,22 +63,28 @@ static void gfx_display_metal_blend_end(void *data)
}
static void gfx_display_metal_draw(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data,
unsigned video_width,
unsigned video_height)
{
MetalDriver *md = (__bridge MetalDriver *)video_info->userdata;
MetalDriver *md = (__bridge MetalDriver *)data;
if (!md || !draw)
return;
[md.display draw:draw video:video_info];
[md.display draw:draw];
}
static void gfx_display_metal_draw_pipeline(gfx_display_ctx_draw_t *draw, video_frame_info_t *video_info)
static void gfx_display_metal_draw_pipeline(
gfx_display_ctx_draw_t *draw,
void *data,
unsigned video_width,
unsigned video_height)
{
MetalDriver *md = (__bridge MetalDriver *)video_info->userdata;
MetalDriver *md = (__bridge MetalDriver *)data;
if (!md || !draw)
return;
[md.display drawPipeline:draw video:video_info];
[md.display drawPipeline:draw];
}
static void gfx_display_metal_viewport(gfx_display_ctx_draw_t *draw,
@ -114,9 +120,9 @@ static void gfx_display_metal_restore_clear_color(void) { }
static void gfx_display_metal_clear_color(
gfx_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info)
void *data)
{
MetalDriver *md = (__bridge MetalDriver *)video_info->userdata;
MetalDriver *md = (__bridge MetalDriver *)data;
if (!md)
return;

View File

@ -26,14 +26,15 @@ static void *gfx_display_switch_get_default_mvp(void *data) { return NULL; }
static void gfx_display_switch_blend_begin(void *data) { }
static void gfx_display_switch_blend_end(void *data) { }
static void gfx_display_switch_draw(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info) { }
void *data, unsigned video_width, unsigned video_height) { }
static void gfx_display_switch_draw_pipeline(
gfx_display_ctx_draw_t *draw, video_frame_info_t *video_info) { }
gfx_display_ctx_draw_t *draw,
void *data, unsigned video_width, unsigned video_height) { }
static void gfx_display_switch_viewport(gfx_display_ctx_draw_t *draw,
void *data) { }
static void gfx_display_switch_restore_clear_color(void) { }
static void gfx_display_switch_clear_color(gfx_display_ctx_clearcolor_t *clearcolor, video_frame_info_t *video_info) { }
static void gfx_display_switch_clear_color(gfx_display_ctx_clearcolor_t *clearcolor, void *data) { }
static bool gfx_display_switch_font_init_first(
void **font_handle, void *video_data,

View File

@ -85,14 +85,14 @@ static void gfx_display_vita2d_viewport(gfx_display_ctx_draw_t *draw,
}
static void gfx_display_vita2d_draw(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data, unsigned video_width, unsigned video_height)
{
unsigned i;
struct vita2d_texture *texture = NULL;
const float *vertex = NULL;
const float *tex_coord = NULL;
const float *color = NULL;
vita_video_t *vita2d = (vita_video_t*)video_info->userdata;
vita_video_t *vita2d = (vita_video_t*)data;
if (!vita2d || !draw)
return;
@ -145,9 +145,7 @@ static void gfx_display_vita2d_draw(gfx_display_ctx_draw_t *draw,
}
static void gfx_display_vita2d_draw_pipeline(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
{
}
void *data, unsigned video_width, unsigned video_height) { }
static void gfx_display_vita2d_restore_clear_color(void)
{
@ -155,8 +153,7 @@ static void gfx_display_vita2d_restore_clear_color(void)
}
static void gfx_display_vita2d_clear_color(
gfx_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info)
gfx_display_ctx_clearcolor_t *clearcolor, void *data)
{
if (!clearcolor)
return;

View File

@ -116,7 +116,7 @@ static void gfx_display_vk_viewport(gfx_display_ctx_draw_t *draw,
}
static void gfx_display_vk_draw_pipeline(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data, unsigned video_width, unsigned video_height)
{
#ifdef HAVE_SHADERPIPELINE
static uint8_t ubo_scratch_data[768];
@ -125,7 +125,7 @@ static void gfx_display_vk_draw_pipeline(gfx_display_ctx_draw_t *draw,
static struct video_coords blank_coords;
float output_size[2];
video_coord_array_t *ca = NULL;
vk_t *vk = (vk_t*)video_info->userdata;
vk_t *vk = (vk_t*)data;
if (!vk || !draw)
return;
@ -191,7 +191,7 @@ static void gfx_display_vk_draw_pipeline(gfx_display_ctx_draw_t *draw,
}
static void gfx_display_vk_draw(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data, unsigned video_width, unsigned video_height)
{
unsigned i;
struct vk_buffer_range range;
@ -200,7 +200,7 @@ static void gfx_display_vk_draw(gfx_display_ctx_draw_t *draw,
const float *tex_coord = NULL;
const float *color = NULL;
struct vk_vertex *pv = NULL;
vk_t *vk = (vk_t*)video_info->userdata;
vk_t *vk = (vk_t*)data;
if (!vk || !draw)
return;
@ -301,11 +301,11 @@ static void gfx_display_vk_restore_clear_color(void)
static void gfx_display_vk_clear_color(
gfx_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info)
void *data)
{
VkClearRect rect;
VkClearAttachment attachment;
vk_t *vk = (vk_t*)video_info->userdata;
vk_t *vk = (vk_t*)data;
if (!vk || !clearcolor)
return;

View File

@ -36,9 +36,9 @@ static void gfx_display_wiiu_blend_end(void *data) { }
static void gfx_display_wiiu_viewport(gfx_display_ctx_draw_t *draw, void *data) { }
static void gfx_display_wiiu_draw(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data, unsigned video_width, unsigned video_height)
{
wiiu_video_t *wiiu = (wiiu_video_t*)video_info->userdata;
wiiu_video_t *wiiu = (wiiu_video_t*)data;
if (!wiiu || !draw)
return;
@ -205,10 +205,10 @@ static void gfx_display_wiiu_draw(gfx_display_ctx_draw_t *draw,
}
static void gfx_display_wiiu_draw_pipeline(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
void *data, unsigned video_width, unsigned video_height)
{
video_coord_array_t *ca = NULL;
wiiu_video_t *wiiu = (wiiu_video_t*)video_info->userdata;
wiiu_video_t *wiiu = (wiiu_video_t*)data;
if (!wiiu || !draw)
return;
@ -267,7 +267,7 @@ static void gfx_display_wiiu_restore_clear_color(void)
static void gfx_display_wiiu_clear_color(
gfx_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info)
void *data)
{
if (!clearcolor)
return;

View File

@ -80,12 +80,12 @@ static void *gfx_display_null_get_default_mvp(void *data) { return NULL; }
static void gfx_display_null_blend_begin(void *data) { }
static void gfx_display_null_blend_end(void *data) { }
static void gfx_display_null_draw(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info) { }
void *data, unsigned width, unsigned height) { }
static void gfx_display_null_draw_pipeline(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info) { }
void *data, unsigned width, unsigned height) { }
static void gfx_display_null_viewport(gfx_display_ctx_draw_t *draw, void *data) { }
static void gfx_display_null_restore_clear_color(void) { }
static void gfx_display_null_clear_color(gfx_display_ctx_clearcolor_t *clearcolor, video_frame_info_t *video_info) { }
static void gfx_display_null_clear_color(gfx_display_ctx_clearcolor_t *clearcolor, void *data) { }
static bool gfx_display_null_font_init_first(
void **font_handle, void *video_data,
@ -741,7 +741,8 @@ void gfx_display_draw(gfx_display_ctx_draw_t *draw,
return;
if (draw->width <= 0)
return;
dispctx->draw(draw, video_info);
dispctx->draw(draw, video_info->userdata,
video_info->width, video_info->height);
}
void gfx_display_draw_blend(gfx_display_ctx_draw_t *draw,
@ -755,7 +756,8 @@ void gfx_display_draw_blend(gfx_display_ctx_draw_t *draw,
if (draw->width <= 0)
return;
gfx_display_blend_begin(video_info->userdata);
dispctx->draw(draw, video_info);
dispctx->draw(draw, video_info->userdata,
video_info->width, video_info->height);
gfx_display_blend_end(video_info->userdata);
}
@ -763,7 +765,8 @@ void gfx_display_draw_pipeline(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
{
if (dispctx && draw && dispctx->draw_pipeline)
dispctx->draw_pipeline(draw, video_info);
dispctx->draw_pipeline(draw, video_info->userdata,
video_info->width, video_info->height);
}
void gfx_display_draw_bg(gfx_display_ctx_draw_t *draw,

View File

@ -105,10 +105,11 @@ typedef struct gfx_display_ctx_draw gfx_display_ctx_draw_t;
typedef struct gfx_display_ctx_driver
{
/* Draw graphics to the screen. */
void (*draw)(gfx_display_ctx_draw_t *draw, video_frame_info_t *video_info);
void (*draw)(gfx_display_ctx_draw_t *draw,
void *data, unsigned video_width, unsigned video_height);
/* Draw one of the menu pipeline shaders. */
void (*draw_pipeline)(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info);
void *data, unsigned video_width, unsigned video_height);
void (*viewport)(gfx_display_ctx_draw_t *draw, void *data);
/* Start blending operation. */
void (*blend_begin)(void *data);
@ -118,7 +119,7 @@ typedef struct gfx_display_ctx_driver
void (*restore_clear_color)(void);
/* Set the color to be used when clearing the screen */
void (*clear_color)(gfx_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info);
void *data);
/* Get the default Model-View-Projection matrix */
void *(*get_default_mvp)(void *data);
/* Get the default vertices matrix */