26 lines
801 B
C++
26 lines
801 B
C++
#include "Explicit_Refresh_Strategy.h"
|
|
|
|
namespace renderive {
|
|
|
|
void Explicit_Refresh_Strategy::request_render() {
|
|
manual_request_pending.store(true, std::memory_order_release);
|
|
}
|
|
|
|
Refresh_Action Explicit_Refresh_Strategy::on_trigger(
|
|
Refresh_Trigger,
|
|
const Refresh_Runtime_Snapshot& runtime,
|
|
const Frame_Lifecycle_Record*) {
|
|
Refresh_Action action;
|
|
if (!manual_request_pending.load(std::memory_order_acquire))
|
|
return action;
|
|
if (!runtime.enabled || runtime.destroying || runtime.render_job_active)
|
|
return action;
|
|
manual_request_pending.store(false, std::memory_order_release);
|
|
action.try_render = true;
|
|
if (runtime.middle_has_new_frame && !runtime.paint_active)
|
|
action.request_paint = true;
|
|
return action;
|
|
}
|
|
|
|
} // namespace renderive
|