Make rendering asynchronous and timeline-aware

This commit is contained in:
SGavrl committed 2026-08-04 02:37:03 +00:00
1 parent 68f20cf525
commit 66f04d0f43
18 files changed
+3952 -290

No files matched your search

+7 -2
View File
@@ -561,7 +561,7 @@ def parse_obscura_scroll_report(stdout):
}
def obscura_environment(width, height):
def obscura_environment(width, height, animation_time_ms=None):
env = dict(
os.environ,
OBSCURA_SHOT_W=str(width),
@@ -587,6 +587,8 @@ def obscura_environment(width, height):
# same warm-up shot in the paired process.
OBSCURA_SHOT_RESOURCE_WARMUP="1",
)
if animation_time_ms is not None:
env["OBSCURA_SHOT_ANIMATION_TIME_MS"] = str(animation_time_ms)
return env
@@ -719,9 +721,10 @@ def capture_obscura(
settle_ms,
scroll=None,
geometry_selectors=None,
animation_time_ms=None,
):
env = with_controlled_scroll_environment(
obscura_environment(width, height), scroll
obscura_environment(width, height, animation_time_ms), scroll
)
command = [
binary,
@@ -1987,6 +1990,7 @@ def main():
args.settle_ms,
controlled_scroll,
args.geometry_selector,
args.animation_time_ms,
)
baseline_future = None
if args.baseline_bin:
@@ -2001,6 +2005,7 @@ def main():
args.settle_ms,
controlled_scroll,
args.geometry_selector,
args.animation_time_ms,
)
chrome_started = time.time()
+5
View File
@@ -119,6 +119,11 @@ class ControlledScrollTests(unittest.TestCase):
self.assertEqual(environment["OBSCURA_SHOT_SCROLL_Y"], "bottom")
self.assertEqual(environment["OBSCURA_SHOT_EVAL_AT_CAPTURE"], "1")
self.assertEqual(environment["OBSCURA_SHOT_RESOURCE_WARMUP"], "1")
self.assertNotIn("OBSCURA_SHOT_ANIMATION_TIME_MS", environment)
def test_obscura_capture_exports_explicit_animation_sample(self):
environment = paired_corpus.obscura_environment(1280, 720, 0)
self.assertEqual(environment["OBSCURA_SHOT_ANIMATION_TIME_MS"], "0")
def test_paired_state_expression_is_read_only_at_capture_boundary(self):
expression = paired_corpus.obscura_state_eval_expression(