While viewerframe mode refresh new is powerful, it is expensive. Forcing a complete frame rebuild burns CPU/GPU cycles. Here is how to optimize without breaking the "new" promise.
Legacy applications suffer from three "refresh rot" problems that the viewerframe mode refresh new pattern solves.
function assign_refresh_rate(region, gaze_dist, motion_magnitude):
if gaze_dist < fovea_threshold:
return max_refresh
elif motion_magnitude > high_motion_threshold:
return mid_refresh (e.g., 60Hz)
else:
return min_refresh (e.g., 15Hz) + edge_update_on_change