diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 87d23940d9..752b82b73e 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -791,12 +791,6 @@ void video_driver_get_video_output_prev(void) } -bool video_driver_cached_frame_has_valid_fb(void) -{ - if (!video_state.frame_cache.data) - return false; - return (video_state.frame_cache.data == RETRO_HW_FRAME_BUFFER_VALID); -} void video_driver_cached_frame_set_ptr(const void *data) { @@ -1187,6 +1181,10 @@ bool video_driver_ctl(enum rarch_display_ctl_state state, void *data) switch (state) { + case RARCH_DISPLAY_CTL_CACHED_FRAME_HAS_VALID_FB: + if (!video_state.frame_cache.data) + return false; + return (video_state.frame_cache.data == RETRO_HW_FRAME_BUFFER_VALID); case RARCH_DISPLAY_CTL_CACHED_FRAME_RENDER: return video_driver_cached_frame(); case RARCH_DISPLAY_CTL_IS_FOCUSED: diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 94b266c282..2cc07c2b77 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -227,6 +227,7 @@ enum rarch_display_ctl_state RARCH_DISPLAY_CTL_IS_FOCUSED, /* Renders the current video frame. */ RARCH_DISPLAY_CTL_CACHED_FRAME_RENDER, + RARCH_DISPLAY_CTL_CACHED_FRAME_HAS_VALID_FB, RARCH_DISPLAY_CTL_GET_FRAME_COUNT }; @@ -378,8 +379,6 @@ void video_driver_cached_frame_set_ptr(const void *data); void video_driver_cached_frame_get(const void **data, unsigned *width, unsigned *height, size_t *pitch); -bool video_driver_cached_frame_has_valid_fb(void); - #ifdef __cplusplus } #endif diff --git a/screenshot.c b/screenshot.c index 347dbdfd29..93b5182af7 100644 --- a/screenshot.c +++ b/screenshot.c @@ -234,7 +234,7 @@ bool take_screenshot(void) if (viewport_read) ret = take_screenshot_viewport(); - else if (!video_driver_cached_frame_has_valid_fb()) + else if (!video_driver_ctl(RARCH_DISPLAY_CTL_CACHED_FRAME_HAS_VALID_FB, NULL)) ret = take_screenshot_raw(); else if (driver->video->read_frame_raw) {