mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 18:32:44 +00:00
Use video_driver_read_viewport
This commit is contained in:
parent
e3eb9fe9f0
commit
5538e2db1d
@ -753,3 +753,18 @@ bool video_driver_viewport_info(struct video_viewport *vp)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool video_driver_read_viewport(uint8_t *buffer)
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
|
||||
if (!driver)
|
||||
return false;
|
||||
if (!driver->video)
|
||||
return false;
|
||||
if (!driver->video->read_viewport)
|
||||
return false;
|
||||
|
||||
return driver->video->read_viewport(driver->video_data,
|
||||
buffer);
|
||||
}
|
||||
|
@ -298,6 +298,8 @@ void video_driver_set_texture_frame(const void *frame, bool rgb32,
|
||||
|
||||
bool video_driver_viewport_info(struct video_viewport *vp);
|
||||
|
||||
bool video_driver_read_viewport(uint8_t *buffer);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "../retroarch.h"
|
||||
#include "../runloop.h"
|
||||
#include "../intl/intl.h"
|
||||
#include "../gfx/video_driver.h"
|
||||
#include "../gfx/video_viewport.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -133,9 +134,7 @@ void recording_dump_frame(const void *data, unsigned width,
|
||||
/* Big bottleneck.
|
||||
* Since we might need to do read-backs asynchronously,
|
||||
* it might take 3-4 times before this returns true. */
|
||||
if (driver->video && driver->video->read_viewport)
|
||||
if (!driver->video->read_viewport(driver->video_data,
|
||||
global->record.gpu_buffer))
|
||||
if (!video_driver_read_viewport(global->record.gpu_buffer))
|
||||
return;
|
||||
|
||||
ffemu_data.pitch = global->record.gpu_width * 3;
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "runloop.h"
|
||||
#include "retroarch_logger.h"
|
||||
#include "screenshot.h"
|
||||
#include "gfx/video_driver.h"
|
||||
#include "gfx/video_viewport.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -179,7 +180,6 @@ static bool take_screenshot_viewport(void)
|
||||
uint8_t *buffer = NULL;
|
||||
bool retval = false;
|
||||
struct video_viewport vp = {0};
|
||||
driver_t *driver = driver_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
@ -191,9 +191,8 @@ static bool take_screenshot_viewport(void)
|
||||
if (!(buffer = (uint8_t*)malloc(vp.width * vp.height * 3)))
|
||||
return false;
|
||||
|
||||
if (driver->video && driver->video->read_viewport)
|
||||
if (!driver->video->read_viewport(driver->video_data, buffer))
|
||||
goto done;
|
||||
if (!video_driver_read_viewport(buffer))
|
||||
goto done;
|
||||
|
||||
screenshot_dir = settings->screenshot_directory;
|
||||
|
||||
|
@ -516,3 +516,8 @@ bool video_driver_viewport_info(struct video_viewport *vp)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool video_driver_read_viewport(uint8_t *buffer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user